/* Sign-in pages (login.html and the two-factor pages in src/auth-pages.js). */
:root {
    --fg-900: #0b2113;
    --fg-700: #1a4a2c;
    --fg-600: #21663c;
    --fg-500: #2b7d4b;
    --fg-400: #3fa165;
    --fg-300: #63bb84;
    --fg-100: #cdead7;
    --fg-50: #eef7f1;
    --n-900: #141a15;
    --n-700: #323d35;
    --n-500: #5f6c63;
    --n-300: #94a097;
    --n-200: #b9c2ba;
    --n-100: #dde3dc;
    --n-50: #f3f5ef;
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background:
        radial-gradient(900px 520px at 15% -10%, rgba(99,187,132,.16), transparent 60%),
        radial-gradient(760px 520px at 110% 115%, rgba(18,165,148,.14), transparent 55%),
        linear-gradient(170deg, #0d2717 0%, var(--fg-900) 55%, #081a0e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--n-900);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--fg-100); color: var(--fg-900); }

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    animation: rise .5s cubic-bezier(.21,1.02,.55,1.1);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card {
    background: linear-gradient(178deg, #ffffff, #fbfcf9);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 22px;
    box-shadow:
        0 1px 0 rgba(255,255,255,.25) inset,
        0 10px 30px rgba(0, 0, 0, 0.28),
        0 30px 80px rgba(0, 0, 0, 0.35);
    padding: 48px 40px 42px;
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--fg-500), var(--fg-300), #12a594);
}

.header {
    text-align: center;
    margin-bottom: 36px;
}

.header-glyph {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    line-height: 1;
    color: var(--fg-300);
    margin-bottom: 10px;
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--fg-900);
    margin-bottom: 8px;
}
.header-title .accent { color: var(--fg-500); font-style: italic; }

.header-subtitle {
    font-size: 11.5px;
    color: var(--n-500);
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.error-message {
    display: none;
    background-color: #fbe9e7;
    border: 1px solid #f3c1bc;
    border-left: 3px solid #ce3a30;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #ab2b23;
    text-align: center;
}

.error-message.show {
    display: block;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--n-500);
}

input[type="text"],
input[type="password"] {
    padding: 12px 16px;
    border: 1px solid var(--n-100);
    border-radius: 10px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    color: var(--n-900);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--fg-400);
    box-shadow: 0 0 0 3px rgba(63, 161, 101, 0.14);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: var(--n-300);
}

.submit-button {
    padding: 13px 24px;
    background: linear-gradient(175deg, var(--fg-500), var(--fg-600));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 12px rgba(33,102,60,.35);
    transition: background-color 0.2s, transform 0.1s, box-shadow .2s;
    margin-top: 8px;
}

.submit-button:hover {
    background: linear-gradient(175deg, var(--fg-600), var(--fg-700));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 16px rgba(33,102,60,.4);
}

.submit-button:active {
    transform: scale(0.98);
}

.footer-note {
    margin-top: 26px;
    text-align: center;
    font-size: 11px;
    color: var(--n-300);
    letter-spacing: .04em;
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .header-title {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-container { animation: none; }
}

/* The two-factor steps (src/auth-pages.js, <body class="auth-step">). */
.auth-step .lede { font-size: 14px; line-height: 1.5; margin: 0 0 16px; color: inherit; opacity: .85; }
.auth-step .qr { display: flex; justify-content: center; margin: 4px 0 12px; }
.auth-step .qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }
.auth-step .key { font-family: ui-monospace, Menlo, monospace; font-size: 13px; letter-spacing: .06em; word-break: break-all; text-align: center; margin: 0 0 16px; }
.auth-step .codes { font-family: ui-monospace, Menlo, monospace; font-size: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 8px 0 16px; padding: 12px; border-radius: 8px; background: rgba(0,0,0,.05); }
.auth-step .alt { font-size: 13px; margin-top: 12px; opacity: .8; }
.auth-step .error-message { display: block; }
.auth-step ol.steps { font-size: 14px; line-height: 1.5; padding-left: 20px; margin: 0 0 14px; }
.auth-step a.submit-button { display: block; text-align: center; text-decoration: none; }

/* Passkey sign-in (login.html): the primary button, the password form below. */
.passkey { margin-bottom: 4px; }
.passkey[hidden] { display: none; }
.passkey .passkey-button { width: 100%; margin-top: 0; }
.passkey .passkey-button:disabled { opacity: .7; cursor: progress; }
.passkey-hint { font-size: 12.5px; text-align: center; color: var(--n-500); margin: 8px 0 0; }
.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 6px; font-size: 12px; color: var(--n-500); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--n-100); }
.passkey ~ .form .submit-button { background: #fff; color: var(--fg-700); border: 1px solid var(--n-200); box-shadow: none; }
.passkey[hidden] ~ .form .submit-button { background: linear-gradient(175deg, var(--fg-500), var(--fg-600)); color: #fff; border: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 12px rgba(33,102,60,.35); }
.passkey ~ .form .submit-button:hover { background: var(--fg-50); }
.passkey[hidden] ~ .form .submit-button:hover { background: linear-gradient(175deg, var(--fg-600), var(--fg-700)); }
