/**
 * PathwayAI Pro — Auth Experience v5 (reference: institute hero + glass card)
 * UI only — pairs with includes/auth_experience.php
 */

:root {
    --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --auth-ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
    --auth-dur: 0.32s;
    --auth-card-w: min(460px, 92%);
    --auth-input-h: 54px;
}

/* ── Dark (default / student panel aligned) ── */
body.pathway-auth-page.dark,
body.pathway-auth-page.pathway-dark-global {
    --auth-panel-bg: #050810;
    --auth-card-bg: rgba(8, 12, 24, 0.78);
    --auth-card-border: rgba(125, 185, 255, 0.28);
    --auth-card-shadow:
        0 28px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 60px rgba(37, 99, 235, 0.12);
    --auth-text: #f8fafc;
    --auth-muted: #a7b6cb;
    --auth-kicker: #7dd3fc;
    --auth-input-bg: rgba(255, 255, 255, 0.96);
    --auth-input-border: rgba(255, 255, 255, 0.88);
    --auth-input-text: #0f172a;
    --auth-input-label: #64748b;
    --auth-focus-ring: 0 0 0 1px rgba(96, 165, 250, 0.55), 0 0 0 4px rgba(59, 130, 246, 0.2), 0 0 28px rgba(59, 130, 246, 0.25);
    --auth-primary: linear-gradient(135deg, #38bdf8 0%, #2563eb 48%, #1d4ed8 100%);
    --auth-primary-hover: linear-gradient(135deg, #7dd3fc 0%, #3b82f6 48%, #2563eb 100%);
    --auth-link: #7dd3fc;
}

/* ── Light ── */
body.pathway-auth-page:not(.dark):not(.pathway-dark-global) {
    --auth-panel-bg: #e8eef7;
    --auth-card-bg: rgba(255, 255, 255, 0.88);
    --auth-card-border: rgba(37, 99, 235, 0.18);
    --auth-card-shadow: 0 28px 64px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
    --auth-text: #0b1220;
    --auth-muted: #5c6b82;
    --auth-kicker: #2563eb;
    --auth-input-bg: rgba(248, 250, 252, 0.95);
    --auth-input-border: rgba(37, 99, 235, 0.22);
    --auth-focus-ring: 0 0 0 1px rgba(37, 99, 235, 0.45), 0 0 0 4px rgba(37, 99, 235, 0.12);
    --auth-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 52%, #1d4ed8 100%);
    --auth-primary-hover: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --auth-link: #2563eb;
}

html:has(body.pathway-auth-page) {
    height: 100%;
    min-height: 100%;
    min-height: 100dvh;
    background: #050810;
}

body.pathway-auth-page {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: #050810 !important;
    color: var(--auth-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ═══ Full-viewport hero background + floating glass card ═══ */
.pathway-auth-shell {
    display: block;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    background: transparent;
}

.pathway-auth-main {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    padding: clamp(1.25rem, 4vh, 2.75rem) clamp(1rem, 4vw, 2.5rem);
    background: transparent;
    box-sizing: border-box;
}

/* Soft readability veil — keep campus visible around the card */
.pathway-auth-main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 55% 70% at 50% 48%, rgba(5, 8, 16, 0.42), transparent 72%),
        linear-gradient(180deg, rgba(5, 8, 16, 0.38) 0%, rgba(5, 8, 16, 0.18) 40%, rgba(5, 8, 16, 0.55) 100%);
}

/* Full-bleed responsive wallpaper layer */
.pathway-auth-visual {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    min-width: 100%;
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    background-color: #060a14;
    background-image: var(--auth-hero-url);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    pointer-events: none;
    overflow: hidden;
}

/* ═══ Hero stage — fills the fixed visual ═══ */
.pathway-auth-hero-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
}

.pathway-auth-hero-sky {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% 18%, rgba(37, 99, 235, 0.22), transparent 62%),
        radial-gradient(ellipse 120% 80% at 50% 110%, rgba(8, 18, 40, 0.95), transparent 55%),
        linear-gradient(180deg, #060d1c 0%, #050810 42%, #04070f 100%);
    z-index: 1;
}

.pathway-auth-hero-stars {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.55;
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(1px 1px at 22% 8%, rgba(191, 219, 254, 0.75), transparent),
        radial-gradient(1.5px 1.5px at 35% 22%, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(1px 1px at 48% 12%, rgba(147, 197, 253, 0.7), transparent),
        radial-gradient(1px 1px at 62% 18%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1px 1px at 74% 10%, rgba(191, 219, 254, 0.8), transparent),
        radial-gradient(1.5px 1.5px at 86% 24%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 92% 14%, rgba(147, 197, 253, 0.65), transparent);
    animation: authStarsTwinkle 12s ease-in-out infinite;
}

.pathway-auth-hero-rings {
    position: absolute;
    left: 50%;
    top: 16%;
    width: min(68vw, 520px);
    height: min(68vw, 520px);
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    opacity: 0.55;
}

.pathway-auth-hero-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px dashed transparent;
    mask: radial-gradient(circle, transparent 58%, #000 59%, #000 68%, transparent 69%);
    -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%, #000 68%, transparent 69%);
    opacity: 0.14;
}

.pathway-auth-hero-ring--outer {
    border-color: rgba(168, 85, 247, 0.45);
    border-top-color: rgba(56, 189, 248, 0.55);
    animation: authRingSpin 48s linear infinite;
}

.pathway-auth-hero-ring--inner {
    inset: 12%;
    border-color: rgba(56, 189, 248, 0.42);
    border-bottom-color: rgba(168, 85, 247, 0.38);
    animation: authRingSpin 36s linear infinite reverse;
}

.pathway-auth-hero-scene {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    z-index: 5;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.pathway-auth-hero-art {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover !important;
    object-position: center center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    filter: saturate(1.06) contrast(1.03) brightness(1.02);
    transform: none;
    animation: none;
}

.pathway-auth-hero-window-glow {
    position: absolute;
    left: 50%;
    bottom: 28%;
    width: min(42vw, 320px);
    height: min(18vw, 120px);
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(251, 191, 36, 0.14), transparent 72%);
    z-index: 6;
    pointer-events: none;
    animation: authBloomPulse 7s ease-in-out infinite;
}

.pathway-auth-hero-road-glow {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(50vw, 380px);
    height: 38%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, transparent 0%, rgba(59, 130, 246, 0.08) 45%, rgba(37, 99, 235, 0.16) 100%);
    z-index: 6;
    pointer-events: none;
    mix-blend-mode: screen;
}

.pathway-auth-hero-fog {
    position: absolute;
    inset: 0;
    z-index: 7;
    pointer-events: none;
    background: radial-gradient(ellipse 70% 45% at 50% 78%, rgba(59, 130, 246, 0.08), transparent 70%);
    animation: authFogDrift 20s ease-in-out infinite;
}

.pathway-auth-hero-bloom {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 24%, rgba(96, 165, 250, 0.1), transparent 38%),
        radial-gradient(circle at 50% 68%, rgba(59, 130, 246, 0.06), transparent 42%);
    mix-blend-mode: screen;
    animation: authBloomPulse 9s ease-in-out infinite;
}

.pathway-auth-hero-rays {
    position: absolute;
    inset: -15%;
    z-index: 8;
    pointer-events: none;
    background: conic-gradient(from 200deg at 50% 30%, transparent 0deg, rgba(147, 197, 253, 0.04) 28deg, transparent 56deg);
    animation: authRaysSpin 80s linear infinite;
    opacity: 0.65;
}

.pathway-auth-hero-sweep {
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 44%, rgba(147, 197, 253, 0.05) 50%, transparent 56%);
    transform: translateX(-120%);
    animation: authLightSweep 16s var(--auth-ease-soft) infinite;
}

#pathwayAuthCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    z-index: 10;
    pointer-events: none;
}

@keyframes authRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes authStarsTwinkle {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.72; }
}

@keyframes authFogDrift {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.75; }
    50% { transform: translate(-1.5%, -1%) scale(1.03); opacity: 1; }
}

@keyframes authBloomPulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 1; }
}

@keyframes authRaysSpin {
    to { transform: rotate(360deg); }
}

@keyframes authLightSweep {
    0%, 72% { transform: translateX(-120%); opacity: 0; }
    78% { opacity: 0.85; }
    92% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(120%); opacity: 0; }
}

@keyframes authShimmer {
    0%, 100% { opacity: 0.55; transform: translateX(-4%); }
    50% { opacity: 0.95; transform: translateX(4%); }
}

@keyframes authHeroDrift {
    from { transform: scale(1.02) translate3d(0, 0, 0); }
    to { transform: scale(1.06) translate3d(-0.6%, -0.4%, 0); }
}

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

/* ═══ Glass card ═══ */
.pathway-auth-card {
    width: var(--auth-card-w);
    max-width: min(500px, 100%);
    max-height: calc(100dvh - 2.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 28px;
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    animation: authCardIn 0.85s var(--auth-ease) both;
    position: relative;
    z-index: 1;
}

.pathway-auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, transparent 38%);
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(22px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pathway-auth-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px 8px;
    flex-wrap: nowrap;
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
}

.pathway-auth--student-login .pathway-auth-toolbar,
.pathway-auth--admin-login .pathway-auth-toolbar {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 16px 22px 6px;
    opacity: 1;
}

.pathway-auth--student-login .pathway-auth-card {
    margin-top: 0;
}

.pathway-auth--student-login .pathway-auth-drawer {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
}

.pathway-auth--student-login .pathway-auth-drawer summary {
    font-size: 0.8rem;
    opacity: 0.72;
}

.pathway-auth-back {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--auth-muted) !important;
    text-decoration: none;
    transition: color var(--auth-dur) ease;
    flex: 0 0 auto;
    white-space: nowrap;
}

.pathway-auth-back:hover {
    color: var(--auth-text) !important;
}

.pathway-auth-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.pathway-auth-lang label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.pathway-auth-lang-select {
    font-size: 0.82rem !important;
    min-height: 34px !important;
    padding: 5px 10px !important;
    border-radius: 10px;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text);
}

.pathway-auth-card__body {
    position: relative;
    z-index: 1;
    padding: 0.35rem clamp(1.75rem, 4vw, 2.25rem) clamp(2rem, 4vw, 2.5rem);
    clear: both;
}

/* Reference login: hide in-card brand on student login */
.pathway-auth--student-login .pathway-auth-brand {
    display: none;
}

.pathway-auth-kicker {
    display: block;
    margin: 0.35rem 0 0.45rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--auth-kicker);
    letter-spacing: 0.01em;
    line-height: 1.35;
}

.pathway-auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.pathway-auth-brand--horizontal {
    justify-content: flex-start;
    margin-bottom: 1.75rem;
}

.pathway-auth-brand-mark--horizontal {
    display: block;
    width: auto;
    max-width: min(320px, 100%);
    height: auto;
}

.pathway-auth-brand-mark__img--horizontal {
    width: auto;
    height: 58px;
    max-height: 58px;
    max-width: min(320px, 88vw);
    object-fit: contain;
    object-position: left center;
}

.pathway-auth-brand strong {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--auth-text);
}

.pathway-auth-brand small {
    display: block;
    font-size: 0.68rem;
    color: var(--auth-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.12rem;
}

.pathway-auth-brand-mark:not(.pathway-auth-brand-mark--horizontal) {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: transparent;
}

.pathway-auth-brand-mark__img:not(.pathway-auth-brand-mark__img--horizontal) {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.pathway-auth-card h1,
.pathway-auth-card h2 {
    margin: 0 0 0.45rem;
    clear: both;
    font-size: clamp(1.85rem, 4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: var(--auth-text);
}

.pathway-auth-lead {
    margin: 0 0 1.65rem;
    color: var(--auth-muted);
    line-height: 1.6;
    font-size: 0.98rem;
}

.pathway-auth-alert {
    margin-bottom: 1rem;
    border-radius: 14px;
    animation: authAlertIn 0.42s var(--auth-ease) both;
}

.pathway-auth-alert.alert.error {
    animation: authAlertShake 0.48s var(--auth-ease) both;
}

.pathway-auth-alert.alert.success {
    animation: authAlertIn 0.52s var(--auth-ease) both;
}

@keyframes authAlertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authAlertShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ═══ Form fields with icons ═══ */
.pathway-auth-form {
    display: grid;
    gap: 0.92rem;
}

.pathway-auth-field {
    position: relative;
}

.pathway-auth-field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(96, 165, 250, 0.85);
    pointer-events: none;
    z-index: 2;
    transition: color var(--auth-dur) ease, filter var(--auth-dur) ease;
}

.pathway-auth-field-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.pathway-auth-field:not(:has(.pathway-auth-field-icon)) .pathway-auth-input {
    padding-left: 1rem;
}

.pathway-auth-field:not(:has(.pathway-auth-field-icon)) .pathway-auth-label {
    left: 1rem;
}

body.pathway-auth-page .pathway-auth-input,
body.pathway-auth-page .pathway-auth-form select.pathway-auth-input {
    min-height: var(--auth-input-h) !important;
    padding: 1.25rem 1rem 0.45rem 1rem !important;
    background: var(--auth-input-bg) !important;
    border: 1px solid var(--auth-input-border) !important;
    color: var(--auth-input-text, var(--auth-text)) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

body.pathway-auth-page .pathway-auth-field:not(:has(.pathway-auth-field-icon)) .pathway-auth-input {
    padding-left: 1.05rem !important;
}

body.pathway-auth-page .pathway-auth-field--password .pathway-auth-input {
    padding-right: 3rem !important;
}

body.pathway-auth-page .pathway-auth-label {
    position: absolute !important;
    pointer-events: none !important;
}

.pathway-auth-input,
.pathway-auth-form select.pathway-auth-input {
    width: 100%;
    min-height: var(--auth-input-h);
    padding: 1.25rem 1rem 0.45rem 2.85rem;
    border-radius: 14px;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text);
    font: inherit;
    font-size: 1rem;
    transition:
        border-color var(--auth-dur) var(--auth-ease),
        box-shadow var(--auth-dur) var(--auth-ease),
        transform 0.2s var(--auth-ease);
}

.pathway-auth-field--password .pathway-auth-input {
    padding-right: 3rem;
}

.pathway-auth-label {
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.96rem;
    color: var(--auth-input-label, var(--auth-muted));
    pointer-events: none;
    transition:
        transform var(--auth-dur) var(--auth-ease),
        font-size var(--auth-dur) var(--auth-ease),
        color var(--auth-dur) ease,
        top var(--auth-dur) var(--auth-ease);
}

.pathway-auth-input:focus,
.pathway-auth-input:not(:placeholder-shown),
.pathway-auth-form select.pathway-auth-input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: var(--auth-focus-ring);
    transform: translateY(-1px);
}

.pathway-auth-input:focus + .pathway-auth-label,
.pathway-auth-input:not(:placeholder-shown) + .pathway-auth-label,
.pathway-auth-field.is-filled .pathway-auth-label {
    top: 0.72rem;
    transform: translateY(0);
    font-size: 0.72rem;
    color: #2563eb;
    font-weight: 600;
}

.pathway-auth-field:focus-within .pathway-auth-field-icon {
    color: #2563eb;
    filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.35));
}

.pathway-auth-pass-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--auth-dur) ease, color var(--auth-dur) ease;
}

.pathway-auth-pass-toggle:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #0f172a;
}

.pathway-auth-pass-toggle svg {
    width: 18px;
    height: 18px;
}

.pathway-auth-caps {
    margin: 0.35rem 0 0 2.85rem;
    font-size: 0.78rem;
    color: #d97706;
}

.pathway-auth-caps[hidden] {
    display: none !important;
}

.pathway-auth-hint {
    margin: -0.2rem 0 0;
    font-size: 0.84rem;
    color: var(--auth-muted);
    line-height: 1.5;
}

/* Remember me / forgot password row */
.pathway-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -0.1rem 0 0.15rem;
}

.pathway-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

.pathway-auth-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #3b82f6;
    cursor: pointer;
}

.pathway-auth-forgot {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--auth-link) !important;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--auth-dur) ease, opacity var(--auth-dur) ease;
}

.pathway-auth-forgot:hover {
    color: #93c5fd;
}

/* Or divider + social */
.pathway-auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 1.2rem 0 0.95rem;
    color: var(--auth-muted);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.pathway-auth-divider::before,
.pathway-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(80, 150, 255, 0.16);
}

.pathway-auth-social {
    display: grid;
    gap: 0.65rem;
}

.pathway-auth-social-btn {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(80, 150, 255, 0.24);
    background: rgba(6, 10, 18, 0.62);
    color: var(--auth-text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        transform 0.22s var(--auth-ease),
        border-color var(--auth-dur) ease,
        box-shadow var(--auth-dur) ease,
        background var(--auth-dur) ease;
}

body.pathway-auth-page:not(.dark):not(.pathway-dark-global) .pathway-auth-social-btn {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(37, 99, 235, 0.18);
}

.pathway-auth-social-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.42);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.pathway-auth-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pathway-auth-footer--cta {
    justify-content: center;
    text-align: center;
    width: 100%;
    margin-top: 1.35rem;
}

.pathway-auth-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 16px);
    z-index: 12000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(8, 14, 28, 0.94);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #f8fafc;
    font-size: 0.88rem;
    line-height: 1.45;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.pathway-auth-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ═══ Primary CTA (reference gradient + arrow) ═══ */
.pathway-auth-form .btn,
.pathway-auth-form .admin-submit,
.pathway-auth-actions .btn {
    min-height: 54px;
    border-radius: 999px !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    transition:
        transform 0.2s var(--auth-ease),
        box-shadow 0.28s var(--auth-ease),
        filter 0.2s ease !important;
}

.pathway-auth-form .btn-primary,
.pathway-auth-form .btn-secondary,
.pathway-auth-form .admin-submit,
.pathway-auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    background: var(--auth-primary) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 14px 36px rgba(37, 99, 235, 0.38),
        0 0 28px rgba(59, 130, 246, 0.22) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pathway-auth-submit::after {
    content: "→";
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 0.22s var(--auth-ease);
}

.pathway-auth-form .btn-primary:hover,
.pathway-auth-form .btn-secondary:hover,
.pathway-auth-form .admin-submit:hover,
.pathway-auth-submit:hover {
    background: var(--auth-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.24) inset,
        0 18px 42px rgba(37, 99, 235, 0.45),
        0 0 36px rgba(59, 130, 246, 0.28) !important;
}

.pathway-auth-submit:hover::after {
    transform: translateX(3px);
}

.pathway-auth-form .btn-primary:active,
.pathway-auth-submit:active {
    transform: translateY(0) scale(0.99);
}

.pathway-auth-submit {
    position: relative;
    overflow: hidden;
}

.pathway-auth-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: authRipple 0.55s var(--auth-ease-soft) forwards;
    pointer-events: none;
}

@keyframes authRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.pathway-auth-form.is-success .pathway-auth-submit {
    animation: authBtnSuccess 0.65s var(--auth-ease) both;
}

@keyframes authBtnSuccess {
    0% { transform: scale(1); }
    40% { transform: scale(1.02); box-shadow: 0 0 40px rgba(34, 197, 94, 0.35); }
    100% { transform: scale(1); }
}

.pathway-auth-form.is-loading .pathway-auth-submit {
    pointer-events: none;
    opacity: 0.88;
    filter: brightness(0.96);
}

.pathway-auth-form.is-loading .pathway-auth-submit .pathway-auth-spinner {
    display: inline-block;
}

.pathway-auth-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.65s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.pathway-auth-form .btn-outline {
    background: rgba(8, 12, 22, 0.45) !important;
    color: var(--auth-text) !important;
    border: 1px solid var(--auth-input-border) !important;
    backdrop-filter: blur(8px);
}

body.pathway-auth-page:not(.dark):not(.pathway-dark-global) .pathway-auth-form .btn-outline {
    background: rgba(255, 255, 255, 0.75) !important;
}

.pathway-auth-footer,
.pathway-auth-actions {
    margin-top: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
    font-size: 0.92rem;
    color: var(--auth-muted);
    line-height: 1.55;
}

.pathway-auth-footer a,
.pathway-auth-actions a {
    color: var(--auth-link) !important;
    font-weight: 600;
    text-decoration: none;
}

.pathway-auth-footer form.logout-inline {
    display: inline;
    margin: 0;
}

.pathway-auth-footer form.logout-inline button.pathway-auth-footer-logout {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 600;
    color: var(--auth-link) !important;
    cursor: pointer;
    text-decoration: none;
    line-height: inherit;
}

.pathway-auth-drawer {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(80, 150, 255, 0.12);
}

.pathway-auth-drawer summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--auth-muted);
    font-size: 0.88rem;
}

.pathway-auth-stack label:not(.pathway-auth-label) {
    display: grid;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--auth-text);
}

.pathway-auth-stack label:not(.pathway-auth-label) input,
.pathway-auth-stack label:not(.pathway-auth-label) select {
    min-height: var(--auth-input-h);
    border-radius: 14px;
    border: 1px solid var(--auth-input-border);
    background: var(--auth-input-bg);
    color: var(--auth-text);
    padding: 0.75rem 1rem;
}

.pathway-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.pathway-auth--admin-login .pathway-auth-card {
    width: min(540px, 92vw);
}

.pathway-auth-footnote {
    margin-top: 1.25rem;
    font-size: 0.84rem;
    color: var(--auth-muted);
}

/* ═══ Responsive ═══ */
@media (max-width: 1024px) {
    .pathway-auth-main {
        align-items: center;
        justify-content: center;
        padding: 1.25rem;
    }

    .pathway-auth-main::before {
        background:
            linear-gradient(180deg, rgba(5, 8, 16, 0.5) 0%, rgba(5, 8, 16, 0.28) 42%, rgba(5, 8, 16, 0.62) 100%);
    }

    .pathway-auth-card {
        width: min(500px, 100%);
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
    }

    .pathway-auth-visual,
    .pathway-auth-hero-art {
        background-position: center 28%;
        object-position: center 28%;
    }
}

@media (max-width: 640px) {
    .pathway-auth-toolbar {
        padding: 14px 16px 4px;
        gap: 8px;
    }

    .pathway-auth-card__body {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .pathway-auth-visual,
    .pathway-auth-hero-art {
        background-position: center 24%;
        object-position: center 24%;
    }

    /* Avoid iOS fixed-bg jank: keep visual fixed but clip to viewport */
    .pathway-auth-visual {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
    }
}

@media (orientation: portrait) {
    .pathway-auth-visual,
    .pathway-auth-hero-art {
        background-position: center 22%;
        object-position: center 22%;
    }
}

@media (orientation: landscape) and (max-height: 520px) {
    .pathway-auth-visual,
    .pathway-auth-hero-art {
        background-position: center center;
        object-position: center center;
    }
}

@media (max-width: 480px) {
    .pathway-auth-card {
        border-radius: 22px;
        max-height: none;
    }

    .pathway-auth-main {
        padding: 0.85rem;
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pathway-auth-hero-fog,
    .pathway-auth-hero-bloom,
    .pathway-auth-hero-rays,
    .pathway-auth-hero-sweep,
    .pathway-auth-hero-stars,
    .pathway-auth-hero-ring--outer,
    .pathway-auth-hero-ring--inner,
    .pathway-auth-hero-art,
    .pathway-auth-card,
    .pathway-auth-alert,
    .pathway-auth-toolbar,
    .pathway-auth-card__body > * {
        animation: none !important;
    }

    .pathway-auth-hero-art {
        transform: none !important;
    }

    #pathwayAuthCanvas {
        display: none;
    }

    .pathway-auth-submit::after {
        transition: none;
    }
}

/* ═══ Polish pass: glass depth, stagger, scrollbar ═══ */
.pathway-auth-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(96, 165, 250, 0.35) transparent;
}

.pathway-auth-card::-webkit-scrollbar {
    width: 6px;
}

.pathway-auth-card::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.35);
    border-radius: 999px;
}

.pathway-auth-toolbar {
    animation: authStaggerIn 0.55s var(--auth-ease) both;
}

.pathway-auth-kicker {
    animation: authStaggerIn 0.6s var(--auth-ease) 0.05s both;
    text-transform: none;
    letter-spacing: 0.02em;
}

.pathway-auth-card h1,
.pathway-auth-card h2 {
    animation: authStaggerIn 0.65s var(--auth-ease) 0.08s both;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.pathway-auth-lead {
    animation: authStaggerIn 0.65s var(--auth-ease) 0.12s both;
}

.pathway-auth-form {
    animation: authStaggerIn 0.7s var(--auth-ease) 0.16s both;
}

.pathway-auth-divider,
.pathway-auth-social,
.pathway-auth-footer--cta,
.pathway-auth-drawer {
    animation: authStaggerIn 0.75s var(--auth-ease) 0.22s both;
}

.pathway-auth-social-btn {
    border-radius: 14px;
    min-height: 50px;
}

.pathway-auth-check span {
    transition: color var(--auth-dur) ease;
}

.pathway-auth-check:hover span {
    color: var(--auth-text);
}

.pathway-auth-lang-select {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color var(--auth-dur) ease, box-shadow var(--auth-dur) ease;
}

.pathway-auth-lang-select:hover,
.pathway-auth-lang-select:focus {
    border-color: rgba(125, 185, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

body.pathway-auth-page.dark .pathway-auth-card {
    background:
        linear-gradient(165deg, rgba(18, 28, 48, 0.72) 0%, rgba(8, 12, 24, 0.82) 100%);
}

.pathway-auth-social-note {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--auth-muted);
}

.pathway-auth-social-note a {
    color: var(--auth-link);
    font-weight: 600;
}

.pathway-auth-social--disabled .pathway-auth-social-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.25);
}

@media (min-width: 1100px) {
    .pathway-auth-main {
        justify-content: flex-start;
        padding-left: clamp(2rem, 8vw, 7rem);
    }

    .pathway-auth-main::before {
        background:
            radial-gradient(ellipse 48% 70% at 22% 50%, rgba(5, 8, 16, 0.5), transparent 70%),
            linear-gradient(90deg, rgba(5, 8, 16, 0.58) 0%, rgba(5, 8, 16, 0.22) 42%, transparent 68%);
    }
}

/* ── Teacher retired / institute mode (UI only) ── */
.pathway-auth-alert.alert.info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.35);
    color: #e0f2fe;
    animation: authAlertIn 0.48s var(--auth-ease) both;
}

.pathway-auth-retired-list {
    list-style: none;
    margin: 0 0 1.35rem;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.pathway-auth-retired-list li {
    position: relative;
    padding: 0.72rem 0.9rem 0.72rem 2.35rem;
    border-radius: 12px;
    border: 1px solid rgba(125, 185, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--auth-text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.pathway-auth-retired-list li::before {
    content: "";
    position: absolute;
    left: 0.85rem;
    top: 50%;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #7dd3fc, #2563eb);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.pathway-auth--teacher-retired .pathway-auth-actions .btn-outline {
    background: rgba(8, 12, 22, 0.45) !important;
    color: var(--auth-text) !important;
    border: 1px solid rgba(125, 185, 255, 0.35) !important;
}

.pathway-auth--teacher-retired .pathway-auth-actions .btn-primary {
    min-width: 9.5rem;
    justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
    .pathway-auth-alert.alert.info {
        animation: none;
    }
}
