/*
 * PPIS SMS — shared authentication layout.
 *
 * A compact, sharp-cornered login card on the violet gradient + school
 * line-art background. Presentation only. All auth logic, routes and OAuth
 * handlers live in the Filament Login pages; this stylesheet is loaded by the
 * reusable <x-auth-layout> Blade component and styles every panel's sign-in
 * screen.
 *
 * The palette is exposed as CSS custom properties so it can be re-themed
 * without touching markup. Light theme is the default; the `.dark` scope
 * (Filament adds `dark` to <html> in dark mode) supplies the dark variant.
 * The background stays violet in both themes; the card follows the theme.
 */

.ppis-auth {
    /* Brand palette — override these to re-theme. */
    --auth-base: #0f0b1e;
    --auth-violet: #7f77dd;
    --auth-violet-deep: #5b4fc4;
    --auth-coral: #d85a30;

    /* Light theme (default) — the card. */
    --auth-card-bg: #ffffff;
    --auth-card-border: #e6e4f1;
    --auth-text: #1d1a2e;
    --auth-muted: #64607f;
    --auth-hairline: #e6e4f1;
    --auth-pill-bg: #ffffff;
    --auth-pill-border: #e0ddef;
    --auth-pill-text: #2f2c46;
    --auth-pill-hover: #f5f3fd;
    --auth-tag-bg: #efeafc;
    --auth-tag-text: #5b4fc4;
    --auth-verse-bg: #f7f6fc;
    --auth-focus-ring: rgba(127, 119, 221, 0.55);

    /* Decorative school-themed line-art tile (see public/images/auth-lines.svg). */
    --auth-lines: url('/images/auth-lines.svg');

    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    overflow-y: auto;
    padding: 1.75rem 1.25rem;
    color: var(--auth-text);
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    background:
        var(--auth-lines) 0 0 / 340px repeat,
        radial-gradient(120% 80% at 100% 0%, rgba(216, 90, 48, 0.24) 0%, transparent 45%),
        radial-gradient(100% 90% at 0% 100%, rgba(127, 119, 221, 0.42) 0%, transparent 55%),
        linear-gradient(160deg, var(--auth-violet-deep) 0%, #4a3fa8 45%, var(--auth-base) 100%);
    background-attachment: fixed;
}

/* Dark variant — Filament toggles `dark` on <html>. */
.dark .ppis-auth {
    --auth-card-bg: #14102b;
    --auth-card-border: #2c2551;
    --auth-text: #ece9fb;
    --auth-muted: #a29dc4;
    --auth-hairline: #2c2551;
    --auth-pill-bg: #1b1638;
    --auth-pill-border: #2c2551;
    --auth-pill-text: #ded9f5;
    --auth-pill-hover: #241d45;
    --auth-tag-bg: #241d45;
    --auth-tag-text: #b3aaf0;
    --auth-verse-bg: #1b1638;
    --auth-focus-ring: rgba(148, 140, 233, 0.75);
}

/* ------------------------------------------------------------------ *
 * Centered card — compact, sharp corners. `margin: auto` centers it in
 * the flex container and keeps it scrollable when taller than the viewport.
 * ------------------------------------------------------------------ */
.ppis-auth__card {
    width: 100%;
    max-width: 25rem;
    margin: auto;
    padding: 1.5rem 1.5rem 1.25rem;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    box-shadow: 0 24px 60px -28px rgba(15, 11, 30, 0.7);
}

/* Header — logo, optional badge, portal name, Scripture. */
.ppis-auth__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
    margin-bottom: 1.15rem;
}
.ppis-auth__logo {
    height: 3.25rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
/* Show the light logo in light theme, the dark logo in dark theme. */
.ppis-auth__logo--dark { display: none; }
.dark .ppis-auth__logo--light { display: none; }
.dark .ppis-auth__logo--dark { display: inline-block; }
.ppis-auth__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--auth-tag-text);
    background: var(--auth-tag-bg);
}
.ppis-auth__portal {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--auth-text);
}
.ppis-auth__verse {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-left: 3px solid var(--auth-coral);
    background: var(--auth-verse-bg);
    font-style: italic;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--auth-muted);
    text-align: left;
}
.ppis-auth__verse cite {
    display: block;
    margin-top: 0.3rem;
    font-style: normal;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--auth-muted);
}

/* Divider. */
.ppis-auth__divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.1rem 0 0.85rem;
    color: var(--auth-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ppis-auth__divider::before,
.ppis-auth__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-hairline);
}

/* Social provider pills (squared). */
.ppis-auth__socials {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ppis-auth__pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.9rem;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--auth-pill-text);
    background: var(--auth-pill-bg);
    border: 1px solid var(--auth-pill-border);
    transition: background-color 0.18s ease, border-color 0.18s ease;
}
.ppis-auth__pill:hover {
    background: var(--auth-pill-hover);
    border-color: var(--auth-violet);
}
.ppis-auth__pill svg { width: 1.15rem; height: 1.15rem; flex: none; }
.ppis-auth__pill-label { flex: 1 1 auto; text-align: left; }
.ppis-auth__tag {
    flex: none;
    padding: 0.12rem 0.5rem;
    border-radius: 2px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--auth-tag-text);
    background: var(--auth-tag-bg);
}

/* Footer — DPO/DPS registration badge + RA 10173 notice. */
.ppis-auth__foot {
    margin-top: 1.15rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--auth-hairline);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}
.ppis-auth__seal {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.32rem 0.65rem;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--auth-muted);
    border: 1px solid var(--auth-hairline);
    transition: border-color 0.18s ease, color 0.18s ease;
}
.ppis-auth__seal:hover { border-color: var(--auth-violet); color: var(--auth-text); }
.ppis-auth__seal svg { width: 1.05rem; height: 1.05rem; flex: none; color: #22a06b; }
.ppis-auth__legal {
    font-size: 0.68rem;
    line-height: 1.45;
    color: var(--auth-muted);
}
.ppis-auth__legal strong { font-weight: 600; }

/* ------------------------------------------------------------------ *
 * Filament form field accents (scoped) — square the native fields and
 * button, tint focus + submit to the brand palette, keep focus visible.
 * ------------------------------------------------------------------ */
.ppis-auth .fi-input-wrp,
.ppis-auth .fi-btn,
.ppis-auth .fi-fo-field-wrp .fi-input {
    border-radius: 0;
}
.ppis-auth .fi-input:focus,
.ppis-auth .fi-input-wrp:focus-within {
    --tw-ring-color: var(--auth-violet);
}
/* Gradient "Sign in" button (the primary form action). */
.ppis-auth .fi-form-actions .fi-btn {
    background-image: linear-gradient(120deg, var(--auth-violet-deep), var(--auth-violet) 55%, var(--auth-coral));
    border: none;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 20px -8px rgba(91, 79, 196, 0.7);
    transition: filter 0.18s ease;
}
.ppis-auth .fi-form-actions .fi-btn:hover { filter: brightness(1.06); }

/* Visible focus states everywhere. */
.ppis-auth a:focus-visible,
.ppis-auth button:focus-visible,
.ppis-auth .ppis-auth__pill:focus-visible,
.ppis-auth .fi-input:focus-visible {
    outline: 3px solid var(--auth-focus-ring);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Responsive tweaks for small screens.
 * ------------------------------------------------------------------ */
@media (max-width: 480px) {
    .ppis-auth { padding: 1.25rem 0.9rem; }
    .ppis-auth__card { padding: 1.35rem 1.25rem 1.15rem; }
    .ppis-auth__logo { height: 3rem; }
}

/* ------------------------------------------------------------------ *
 * Accessibility: respect reduced-motion preferences.
 * ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .ppis-auth *,
    .ppis-auth *::before,
    .ppis-auth *::after {
        animation: none !important;
        transition: none !important;
    }
}
