/* ============================================================
   ResourceHub — Auth Experience (Login & Register)
   ------------------------------------------------------------
   Two-column split layout:
   - Left: Brand & Knowledge Graph Illustration panel
   - Right: Modern Form Panel (with Email + Google Auth)
   ============================================================ */

:root {
    /* Panel wash and glows are built from --brand-color-rgb (defined in
       style.css and flipped automatically by html.dark-mode), so this
       file never has to hand-maintain a second, drifting set of colors
       for dark mode - the same rule reads correctly in both themes. */
    --auth-panel-bg: linear-gradient(155deg, #f8fafc 0%, #f1f5f9 55%, rgba(var(--brand-color-rgb), 0.06) 100%);
    --auth-shell-bg: #ffffff;
    --auth-shell-border: rgba(226, 232, 240, 0.85);
    --auth-shell-shadow: 0 20px 45px -15px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    --auth-text-heading: #0f172a;
    --auth-text-body: #475569;
    --auth-node-bg: #ffffff;
    --auth-card-bg: #ffffff;
    --auth-chip-bg: rgba(255, 255, 255, 0.85);
    --auth-chip-border: rgba(203, 213, 225, 0.7);
    --auth-chip-color: #334155;
    --auth-glow-1: rgba(var(--brand-color-rgb), 0.22);
    --auth-glow-2: rgba(var(--brand-color-rgb), 0.14);
    --auth-glow-3: rgba(var(--brand-color-rgb), 0.10);
}

html.dark-mode {
    --auth-panel-bg: linear-gradient(155deg, #090d16 0%, #0d121f 55%, rgba(var(--brand-color-rgb), 0.10) 100%);
    --auth-shell-bg: #0f1422;
    --auth-shell-border: rgba(255, 255, 255, 0.09);
    --auth-shell-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --auth-text-heading: #f8fafc;
    --auth-text-body: #94a3b8;
    --auth-node-bg: #121829;
    --auth-card-bg: #151c30;
    --auth-chip-bg: rgba(255, 255, 255, 0.06);
    --auth-chip-border: rgba(255, 255, 255, 0.12);
    --auth-chip-color: #e2e8f0;
}

/* ---------- Viewport-aware auth page layout ----------
   <main> used to be a plain .container with py-4/py-lg-5 (24px/48px
   top+bottom), and .auth-shell added its own 1.5rem margin on top of
   that - on a normal 768-900px laptop viewport, that compounded dead
   space alone was often enough to push the card's bottom below the
   fold before the (580px-tall) illustration panel even entered the
   picture.

   min-height (not height) reserves "the rest of the viewport below the
   navbar" and flexbox centers the card inside it - it only ever *adds*
   room when the viewport has it to spare. A card taller than the
   available space (a short window, or the taller Sign Up card) simply
   overflows and scrolls normally instead of being squeezed or clipped.

   --auth-navbar-space approximates the floating navbar's own on-screen
   footprint (mt-3 + content + py-2 + mb-4 - navbar.html) so centering
   happens in what's actually left of the viewport, not the full 100vh.
   It's also the containing block + clip boundary for the knowledge
   network canvas below, on the same reasoning as .dashboard-main in
   style.css: negative-z-index canvas behind, overflow: hidden so it
   can never leak into the navbar or footer. */
.auth-page-main {
    --auth-navbar-space: 113px;
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - var(--auth-navbar-space));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

@media (max-width: 991.98px) {
    .auth-page-main {
        --auth-navbar-space: 100px;
        padding-bottom: 2rem;
    }
}

/* ---------- Main Shell Container ---------- */
.auth-shell {
    position: relative;
    z-index: 1;
    max-width: 1060px;
    margin: 0 auto;
    background-color: var(--auth-shell-bg);
    border: 1px solid var(--auth-shell-border);
    box-shadow: var(--auth-shell-shadow);
    border-radius: 1.5rem !important;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ---------- Left Brand & Illustration Panel ---------- */
.auth-illustration-panel {
    position: relative;
    padding: 3rem 2.5rem;
    overflow: hidden;
    background: var(--auth-panel-bg);
    border-right: 1px solid var(--auth-shell-border);
    isolation: isolate;
    min-height: 580px;
}

/* Ambient glow blobs */
.auth-panel-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(65px);
    pointer-events: none;
    z-index: -1;
}

.auth-panel-glow-1 {
    width: 280px;
    height: 280px;
    background: var(--auth-glow-1);
    top: -60px;
    left: -60px;
}

.auth-panel-glow-2 {
    width: 260px;
    height: 260px;
    background: var(--auth-glow-2);
    bottom: -50px;
    right: -40px;
}

.auth-panel-glow-3 {
    width: 200px;
    height: 200px;
    background: var(--auth-glow-3);
    top: 45%;
    left: 20%;
}

/* Brand Header */
.auth-panel-top {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-panel-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none !important;
    width: fit-content;
}

.auth-panel-brand-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.4px;
    color: var(--auth-text-heading) !important;
    text-decoration: none;
}

/* Matches the "Hub" treatment in the navbar wordmark exactly (navbar.html) -
   flat brand-color, no gradient clip, so the mark is identical everywhere
   it appears on the site. */
.auth-brand-accent {
    color: var(--brand-color);
    font-weight: 800;
}

.auth-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    width: fit-content;
    background: var(--auth-chip-bg);
    border: 1px solid var(--auth-chip-border);
    color: var(--auth-chip-color);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
}

.auth-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10B981;
    box-shadow: 0 0 8px #10B981;
    display: inline-block;
}

/* Center Illustration */
.auth-panel-illustration {
    width: 100%;
    max-width: 360px;
    margin: 1.5rem auto;
    position: relative;
}

.auth-network-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* SVG Animations */
.auth-pulse-ring {
    transform-origin: center;
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.95);
        opacity: 0.12;
    }
    100% {
        transform: scale(1.15);
        opacity: 0.28;
    }
}

.auth-floating-card {
    transform-origin: center;
    animation: floatCodeCard 4s ease-in-out infinite alternate;
}

@keyframes floatCodeCard {
    0% {
        transform: translate(290px, 32px) rotate(6deg);
    }
    100% {
        transform: translate(290px, 24px) rotate(4deg);
    }
}

/* Bottom Copy & Features */
.auth-panel-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--auth-text-heading);
    margin: 0;
}

.auth-panel-copy {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--auth-text-body);
    margin: 0;
}

.auth-feature-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.4rem;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    background: var(--auth-chip-bg);
    border: 1px solid var(--auth-chip-border);
    color: var(--auth-chip-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    backdrop-filter: blur(8px);
}

.auth-chip i {
    font-size: 0.85rem;
    color: var(--brand-color);
}

/* ---------- Right Form Panel ---------- */
.auth-form-panel {
    padding: 3.5rem 3rem;
    background-color: var(--auth-shell-bg);
}

@media (max-width: 991.98px) {
    .auth-form-panel {
        padding: 2.5rem 1.75rem;
    }
}

.auth-form-panel h1 {
    color: var(--auth-text-heading);
    letter-spacing: -0.5px;
}

/* Form inputs intentionally have no local overrides here - .contribute-input
   is the site-wide input style (style.css), already themed off --brand-color
   for its focus ring in both modes. Redeclaring it per-page is how this
   panel drifted out of sync with every other form on the site. */

/* Form labels */
.auth-form-panel .form-label {
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    color: var(--auth-text-body) !important;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--auth-text-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--auth-shell-border);
}

/* Remember me row */
.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-remember-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--auth-text-body);
    cursor: pointer;
    user-select: none;
}

.auth-remember-check input {
    cursor: pointer;
    border-radius: 4px;
    border-color: #cbd5e1;
    accent-color: var(--brand-color);
}

/* Dark-mode unchecked surface/border, and the checked/focus states
   entirely, are now owned by the global .form-check-input rules in
   style.css (single source of truth per the site's "reusable CSS, not
   page-by-page" rule) - a local copy used to live here, but at
   (0,3,2) it outranked style.css's own (0,2,0) `.form-check-input:focus`
   rule and silently ate the focus border whenever this checkbox was
   tabbed-to-but-unchecked. Removed rather than re-duplicated. */

/* Links use the site-wide .text-brand (style.css) as-is - no local
   override, so "Forgot?" / "Sign up" match every other brand-colored
   link on the site instead of a page-local orange. */
.auth-form-panel .text-brand:hover {
    text-decoration: underline !important;
}

/* Google Hint text */
.auth-google-hint {
    font-size: 0.8rem;
    text-align: center;
    color: var(--auth-text-body);
    margin-top: 0.65rem;
    margin-bottom: 0;
}
