/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---- Layout ---- */
.container {
    width: 100%;
    max-width: 440px;
    padding: 2rem 1.5rem;
}

header { text-align: center; margin-bottom: 1.5rem; }

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.02em;
}

footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #64748b;
}

/* ---- Card ---- */
.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2rem;
}

.card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: #f1f5f9;
}

.card p {
    color: #94a3b8;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.code-input {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover { background: #475569; }

/* ---- Flash Messages ---- */
.flashes { margin-bottom: 1rem; }

.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash-success { background: #064e3b; color: #6ee7b7; border: 1px solid #065f46; }
.flash-error   { background: #7f1d1d; color: #fca5a5; border: 1px solid #991b1b; }
.flash-warning { background: #78350f; color: #fcd34d; border: 1px solid #92400e; }

/* ---- QR Code ---- */
.qr-container {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-container img {
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

/* ---- Secret Display ---- */
.secret-display {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
}

.secret-display p { margin-bottom: 0.5rem; }

.secret-code {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.15em;
    word-break: break-all;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

/* ---- Misc ---- */
.form-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
}

.form-footer a {
    color: #38bdf8;
    text-decoration: none;
}

.form-footer a:hover { text-decoration: underline; }

.hint {
    font-size: 0.85rem;
    color: #64748b;
}

.welcome {
    text-align: center;
    margin-bottom: 1.5rem;
}

.welcome p:first-child {
    font-size: 1.2rem;
    color: #f1f5f9;
}

.user-info {
    background: #0f172a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #334155;
}

.user-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.user-info p:last-child { margin-bottom: 0; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: #064e3b; color: #6ee7b7; }
