/* ==========================================================================
   login.css — Standalone auth page styles (login, enroll-totp)
   ==========================================================================
   These styles apply to standalone auth pages that do NOT use the portal
   base.html layout (i.e. login and TOTP enrollment). Shared UI classes
   like .alert, .alert-error, .qr-wrapper, .secret-display, .secret-meta,
   and .divider are defined in style.css which is also loaded on these pages.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Page layout — centered card on neutral background
   --------------------------------------------------------------------------- */

.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #f4f5f7;
    overflow-y: auto;
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* ---------------------------------------------------------------------------
   Card
   --------------------------------------------------------------------------- */

.login-card {
    width: 100%;
    max-width: 400px;
    margin: 2rem 1rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 2.5rem 2rem;
}

/* ---------------------------------------------------------------------------
   Brand + subtitle
   --------------------------------------------------------------------------- */

.login-brand {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #1e3a5f;
    margin-bottom: 0.25rem;
    font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    text-transform: uppercase;
}

.login-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

/* ---------------------------------------------------------------------------
   Form elements
   --------------------------------------------------------------------------- */

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form .form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.login-form .form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #111827;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    box-sizing: border-box;
}

.login-form .form-input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.login-form .form-input::placeholder {
    color: #9ca3af;
}

/* ---------------------------------------------------------------------------
   Primary button
   --------------------------------------------------------------------------- */

.login-btn {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #1e3a5f;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    margin-top: 0.5rem;
}

.login-btn:hover {
    background-color: #16304f;
}

.login-btn:active {
    background-color: #0f2640;
}

.login-btn-spaced {
    margin-top: 1rem;
}

/* ---------------------------------------------------------------------------
   OTP digit inputs (6 individual boxes)
   --------------------------------------------------------------------------- */

.otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
    caret-color: #1e3a5f;
}

.otp-digit:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
    outline: none;
}

.otp-digit::placeholder {
    color: #9ca3af;
    opacity: 0.3;
}

/* ---------------------------------------------------------------------------
   Step indicators
   --------------------------------------------------------------------------- */

.step-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.step-user {
    text-align: center;
    font-size: 0.85rem;
    color: #374151;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* ---------------------------------------------------------------------------
   Instructions text (centered muted paragraph)
   --------------------------------------------------------------------------- */

.instructions {
    color: #6b7280;
    font-size: 0.8125rem;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* ---------------------------------------------------------------------------
   Back / start-over link
   --------------------------------------------------------------------------- */

.back-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.825rem;
    color: #6b7280;
    text-decoration: none;
}

.back-link:hover {
    color: #1e3a5f;
}

/* ---------------------------------------------------------------------------
   Collapsible details (manual secret entry)
   --------------------------------------------------------------------------- */

.details-summary {
    font-size: 0.8125rem;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    text-align: center;
    list-style: none;
}

.details-summary::-webkit-details-marker {
    display: none;
}

.details-summary::before {
    content: "\25B8  ";
}

details[open] > .details-summary::before {
    content: "\25BE  ";
}

.details-summary:hover {
    color: #1e3a5f;
}

/* ---------------------------------------------------------------------------
   Responsive — small phones
   --------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .otp-digit {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }

    .otp-container {
        gap: 8px;
    }

    .login-card {
        padding: 2rem 1.25rem;
        margin: 1rem 0.5rem;
    }
}
