/**
 * auth.css — Redesign theme for unauthenticated screens
 *
 * Shared, self-contained styling for the pre-login surfaces:
 *   welcome.html (SSO / auth-method selection), login.html (password),
 *   guid.html (GUID), access_denied.html.
 *
 * Mirrors the redesign error page (templates/error.html): DM Sans, soft green
 * gradient canvas, white card with hairline border + soft shadow, the
 * "Guardrail" wordmark with a green accent, and #34C77B brand buttons.
 *
 * Kept self-contained (explicit values, no design-tokens.css dependency) so
 * these screens render correctly even when the app shell / session is
 * unavailable — the same resilience philosophy as error.html. Token values
 * are copied from static/css/design-tokens.css; keep them in sync.
 */

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

body.auth-body {
    font-family: 'DM Sans', 'Public Sans', Verdana, sans-serif;
    background: linear-gradient(160deg, #daf0e8 0%, #edf8f3 60%, #f7f8fa 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #111827;
}

/* ---- Top bar wordmark ---- */
.auth-topbar {
    padding: 18px 32px;
    display: flex;
    align-items: center;
}
.auth-topbar__wordmark {
    font-size: 1rem;           /* 16px — --ds-text-md */
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.2px;
    text-decoration: none;
}
.auth-topbar__wordmark span { color: #34C77B; }

/* ---- Centered content ---- */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    background: #ffffff;
    border: 1px solid #e5e8ec;
    border-radius: 16px;
    padding: 44px 44px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ---- Headings ---- */
.auth-title {
    font-size: 1.5rem;          /* 24px — --ds-text-xl */
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.4px;
    color: #111827;
    margin-bottom: 8px;
}
.auth-title span { color: #34C77B; }

.auth-subtitle {
    font-size: 0.875rem;        /* 14px — --ds-text-base */
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 28px;
    text-wrap: balance;         /* avoid a lone trailing word on the last line */
}

.auth-icon {
    font-size: 2.5rem;          /* 40px — --ds-text-3xl */
    color: #34C77B;
    display: block;
    margin: 0 auto 16px;
    line-height: 1;
    transform: scaleX(1.2);     /* shield-lock: widen shoulders to match design */
}

.auth-divider {
    width: 40px;
    height: 2px;
    background: #e5e8ec;
    border-radius: 2px;
    margin: 0 auto 24px;
}

/* ---- Buttons ---- */
.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 11px 18px;
    font-family: inherit;
    font-size: 0.875rem;        /* 14px */
    font-weight: 500;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

/* Primary — brand green (matches error page CTA) */
.auth-btn--primary {
    background: #34C77B;
    color: #111827;
    border-color: #34C77B;
}
.auth-btn--primary:hover  { background: #28D283; border-color: #28D283; color: #111827; }
.auth-btn--primary:active { background: #129B5B; border-color: #129B5B; color: #111827; }

/* Provider — neutral white button with hairline border; greens on hover.
   Provider identity is carried by the coloured icon, keeping the surface
   cohesive with the redesign theme. */
.auth-btn--provider {
    background: #ffffff;
    color: #111827;
    border-color: #d0d5dd;
}
.auth-btn--provider:hover {
    border-color: #34C77B;
    background: #f3fbf7;
    box-shadow: 0 0 0 3px rgba(52, 199, 123, 0.12);
}
.auth-btn--provider:active { background: #e9f7f0; }

.auth-btn__icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
/* Provider icons share a neutral slate so the surface stays on-theme; the
   green hover ring + green primary CTA carry the brand. */
.auth-btn--provider .auth-btn__icon { color: #4b5563; }
.auth-btn--provider:hover .auth-btn__icon { color: #129B5B; }

/* ---- Forms ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.auth-field { position: relative; width: 100%; }

.auth-input {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 0.875rem;        /* 14px */
    color: #111827;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.auth-input::placeholder { color: #9ca3af; }
.auth-input:focus {
    outline: none;
    border-color: #34C77B;
    box-shadow: 0 0 0 3px rgba(52, 199, 123, 0.15);
}
.auth-input--has-toggle { padding-right: 42px; }

.auth-pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 120ms ease;
}
.auth-pw-toggle:hover { color: #129B5B; }
.auth-pw-toggle .hidden { display: none; }

.auth-submit { margin-top: 4px; }

/* ---- Flash / alert messages ---- */
.auth-alert {
    font-size: 0.8125rem;       /* 13px */
    line-height: 1.5;
    padding: 10px 13px;
    border-radius: 8px;
    border: 1px solid transparent;
    margin-bottom: 18px;
    text-align: left;
}
.auth-alert--error {
    background: #fdecee;
    border-color: #f4c7cd;
    color: #9b1c2a;
}
.auth-alert--warning {
    background: #fff7e6;
    border-color: #ffe2ad;
    color: #92600a;
}

/* ---- Footer link ---- */
.auth-footer { margin-top: 22px; }
.auth-link {
    font-size: 0.8125rem;       /* 13px */
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: color 120ms ease;
}
.auth-link:hover { color: #129B5B; }

/* ---- Keyboard focus indicators ----
   Use :focus-visible (not :focus) so the halo only shows for keyboard
   navigation, not mouse clicks — clicking a button shouldn't leave a
   permanent ring stuck on it. Halo style matches the existing
   .auth-input:focus rule so every focusable element on the auth screens
   shares the same look. Important for the .auth-pw-toggle inside the
   password input: without an explicit rule the browser default ring
   visually overlaps the green input ring. */
.auth-btn:focus-visible,
.auth-pw-toggle:focus-visible,
.auth-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 199, 123, 0.35);
}

@media (max-width: 480px) {
    .auth-card { padding: 32px 24px 28px; }
    .auth-topbar { padding: 16px 20px; }
}
