*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #09090F;
    --surface:   rgba(255,255,255,0.055);
    --border:    rgba(255,255,255,0.09);
    --text:      #F5F5F7;
    --muted:     rgba(255,255,255,0.38);
    --accent:    #5EE6B0;
    --danger:    #FF453A;
}

html { font-size: 16px; }

body {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 70% -10%, rgba(94,230,176,0.09) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 10% 90%,  rgba(80,80,200,0.07)  0%, transparent 55%);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ---- Auth card ---- */
.auth-card {
    background: rgba(255,255,255,0.055);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 22px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.08);
    padding: 36px 28px;
    width: 100%;
    max-width: 360px;
}

.auth-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-align: center;
    color: var(--text);
    margin-bottom: 24px;
}

.auth-subtitle {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.auth-help {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.5;
}

.auth-error {
    background: rgba(255,69,58,0.12);
    border: 1px solid rgba(255,69,58,0.35);
    color: #FF453A;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ---- Form elements ---- */
form { display: flex; flex-direction: column; gap: 4px; }

label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 12px;
    margin-bottom: 4px;
}

input[type="text"],
input[type="password"] {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 11px;
    color: var(--text);
    font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
    padding: 11px 14px;
    width: 100%;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--accent);
    background: rgba(94,230,176,0.05);
}

button[type="submit"] {
    margin-top: 20px;
    background: var(--accent);
    color: #09090F;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    padding: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
    width: 100%;
    letter-spacing: -0.01em;
}

button[type="submit"]:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

button[type="submit"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- TOTP digit inputs ---- */
.totp-inputs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.totp-digit {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    padding: 10px 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 11px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.totp-digit:focus {
    border-color: var(--accent);
}

/* ---- QR code block ---- */
.qr-wrap {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
}

.secret-reveal {
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--muted);
}

.secret-reveal summary {
    cursor: pointer;
    padding: 4px 0;
}

.secret-key {
    display: block;
    font-family: monospace;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: var(--text);
    word-break: break-all;
    padding: 8px 0;
}
