:root {
    --bg: #0f1115;
    --panel: #161922;
    --panel-2: #1d2230;
    --border: #2a3142;
    --text: #e7ecf3;
    --muted: #97a0b0;
    --accent: #4f8cff;
    --accent-strong: #2f6dff;
    --danger: #ff6464;
    --ok: #4caf50;
    --warning: #f0a830;
    --radius: 10px;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 2px 12px rgba(0, 0, 0, 0.25);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.container-narrow {
    max-width: 460px;
    margin: 0 auto;
    padding: 4rem 1.25rem;
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.125rem; color: var(--muted); font-weight: 500; }

p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.125rem;
    margin: 0 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand .dot {
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.field { margin-bottom: 1rem; }
.field label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
    width: 100%;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    font-family: var(--font);
    font-size: 0.95rem;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

textarea {
    min-height: 140px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 540px) {
    .row { grid-template-columns: 1fr; }
}

button, .btn {
    background: var(--accent);
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 0.7rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.12s ease;
}
button:hover, .btn:hover { background: var(--accent-strong); }
button[disabled], .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--panel-2); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #e25656; }

.alert {
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.alert-error   { background: rgba(255, 100, 100, 0.12); color: #ffb4b4; border: 1px solid rgba(255, 100, 100, 0.3); }
.alert-success { background: rgba(76, 175, 80, 0.10); color: #9be09f; border: 1px solid rgba(76, 175, 80, 0.3); }
.alert-warning { background: rgba(240, 168, 48, 0.12); color: #ffd58a; border: 1px solid rgba(240, 168, 48, 0.3); }

.tag {
    display: inline-block;
    background: var(--panel-2);
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}
.tag-ok { color: #9be09f; }
.tag-warn { color: #ffd58a; }
.tag-dead { color: #ffb4b4; }

.code-display {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    word-break: break-all;
    user-select: all;
    margin: 0;
    white-space: pre-wrap;
}

.action-row { display: flex; gap: 0.75rem; align-items: center; }

.list {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.list th, .list td {
    text-align: left;
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.list th { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.list tr:last-child td { border-bottom: 0; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.topbar form { margin: 0; }

.public-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}
.public-card {
    max-width: 560px;
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.secret-output {
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    max-height: 420px;
    overflow: auto;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
    gap: 0.75rem;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.hidden { display: none !important; }

.help {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.4rem;
}
