/* LIAMS auth shell — shared by the sign-in, forgot-password and reset-password
   pages (resources/views/auth/*.blade.php). One stylesheet, one visual identity:
   this used to live as an inline <style> block duplicated per page, which is
   exactly how the citizen registration page drifted from this look in the first
   place. Extracted verbatim from the original login page; no rule was changed
   in the move. */

        :root {
            --ink:        #0B1220;
            --ink-2:      #101B30;
            --ink-3:      #16233D;
            --ink-soft:   #64748B;
            --ink-faint:  #94A3B8;
            --paper:      #F8FAFC;
            --rule:       #E2E8F0;
            --brand:      #15803D;
            --brand-dark: #0F6430;
            --accent:     #38BDF8;
            --accent-glow:#0EA5E9;

            /* GIS Cadastral Map Status Colors */
            --st-available: #14B8A6;
            --st-reserved:  #F59E0B;
            --st-allocated: #3B82F6;
            --st-titled:    #22C55E;
            --st-disputed:  #EF4444;

            --danger: #B3261E;
            --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
            --safe-t: env(safe-area-inset-top, 0px);
            --safe-b: env(safe-area-inset-bottom, 0px);
        }

        * { box-sizing: border-box; }
        html, body {
            height: 100%; margin: 0; overflow-x: hidden;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            -webkit-font-smoothing: antialiased;
            background-color: var(--ink);
        }

        .shell {
            min-height: 100dvh;
            display: grid;
            grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        }

        /* ============================================================
           LEFT — GIS BRAND / MAP PANEL (FUTURISTIC REDESIGN)
           ============================================================ */
        .brand-panel {
            position: relative;
            height: 100dvh;
            /* The photography IS the background now — this only tints it. */
            background: #060B14;
            color: #fff;
            padding: clamp(2rem, 4vw, 4rem);
            padding-top: calc(clamp(2rem, 4vw, 4rem) + var(--safe-t));
            display: flex; flex-direction: column; justify-content: space-between;
            overflow: hidden;
            border-right: 1px solid rgba(255,255,255,0.05);
        }

        /* ---------- login backdrop carousel ---------- */
        .slideshow { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
        .slideshow .slide {
            position: absolute; inset: 0;
            background-size: cover; background-position: center;
            opacity: 0; transition: opacity 1.6s ease-in-out;
            transform: scale(1.06);
        }
        .slideshow .slide.is-active { opacity: 1; animation: slowPan 12s ease-out forwards; }
        @keyframes slowPan { from { transform: scale(1.06); } to { transform: scale(1.13); } }

        /* Scrim: the panel's own radial gradient, kept over the photography so the
           headline and feature rows never lose contrast against a bright frame. */
        .slideshow-scrim {
            position: absolute; inset: 0; z-index: 0;
            /* Light enough to let the photograph through, weighted toward the bottom-left
               where the crest and status strip sit — that is the only text that has to
               hold contrast now the feature list is gone. */
            /* Weighted to BOTH ends, because the content sits at both: the crest and
               headline at the top, the status strip at the bottom. The middle band stays
               light so the photograph is genuinely visible rather than merely implied. */
            background:
                linear-gradient(to bottom,
                    rgba(3,6,10,.86) 0%,
                    rgba(6,11,20,.62) 26%,
                    rgba(8,13,23,.24) 52%,
                    rgba(6,11,20,.66) 82%,
                    rgba(3,6,10,.88) 100%);
        }
        /* Raise only the CONTENT blocks above the backdrop. An earlier blanket
           `.brand-panel > *` rule forced position:relative onto the decorative layers
           too, which pulled the 640px parcel-field SVG back into the flex flow and
           pushed the crest and headline down to the middle of the panel. The decorative
           layers must stay absolutely positioned. */
        .brand-panel > .brand-top,
        .brand-panel > .brand-bottom { position: relative; z-index: 2; }

        /* The scrim is deliberately light so the photography reads, which means a bright
           frame can come up under white type. A shadow on the text itself holds contrast
           on every slide without putting the darkness back over the image. */
        .brand-panel .crest-text,
        .brand-panel .brand-headline,
        .brand-panel .brand-bottom,
        .brand-panel .gis-chrome { text-shadow: 0 1px 3px rgba(2,6,16,.85), 0 0 18px rgba(2,6,16,.55); }

        @media (prefers-reduced-motion: reduce) {
            .slideshow .slide { transition: none; animation: none; }
        }

        /* High-tech dual-layer coordinate grid */
        .graticule {
            position: absolute; inset: 0; pointer-events: none;
            background-image:
                linear-gradient(rgba(56,189,248,.07) 1px, transparent 1px),
                linear-gradient(90deg, rgba(56,189,248,.07) 1px, transparent 1px),
                linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
            background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
            background-position: center center;
            mask-image: radial-gradient(ellipse 100% 100% at 30% 50%, #000 20%, transparent 80%);
        }

        /* Laser scan sweep for "live" system feel */
        .scan-line {
            position: absolute; left: 0; right: 0; height: 200px; top: -200px;
            background: linear-gradient(180deg, transparent, rgba(56,189,248,.03), rgba(56,189,248,.15), transparent);
            border-bottom: 1px solid rgba(56,189,248,0.4);
            animation: sweep 8s linear infinite; pointer-events: none;
            box-shadow: 0 10px 30px rgba(56,189,248,0.1);
        }
        @keyframes sweep { to { transform: translateY(calc(100dvh + 200px)); } }

        /* Complex, realistic SVG Cadastral Layout */
        .parcel-field {
            position: absolute; right: -15%; top: 10%;
            width: min(900px, 85vw); height: 120%;
            opacity: 0.85; pointer-events: none;
            transform: rotate(-10deg) scale(1.1);
            filter: drop-shadow(0 0 20px rgba(0,0,0,0.5));
        }

        .road-mesh { fill: #111A29; stroke: rgba(255,255,255,0.15); stroke-width: 2; stroke-dasharray: 6 4; }
        .plot-label { font-family: var(--font-mono); font-size: 12px; font-weight: 600; fill: rgba(255,255,255,0.7); text-anchor: middle; dominant-baseline: middle; }
        .plot-area { font-family: var(--font-mono); font-size: 8px; fill: rgba(255,255,255,0.4); text-anchor: middle; }

        .plot { stroke-width: 1.5; transition: fill-opacity 0.3s ease; }
        .plot.avail { fill: var(--st-available); fill-opacity: 0.15; stroke: var(--st-available); }
        .plot.alloc { fill: var(--st-allocated); fill-opacity: 0.15; stroke: var(--st-allocated); }
        .plot.titled { fill: var(--st-titled); fill-opacity: 0.15; stroke: var(--st-titled); }
        .plot.rsvd { fill: var(--st-reserved); fill-opacity: 0.15; stroke: var(--st-reserved); }
        .plot.disp { fill: var(--st-disputed); fill-opacity: 0.25; stroke: var(--st-disputed); }

        .beacon { fill: #fff; stroke: #000; stroke-width: 1; filter: drop-shadow(0 0 4px rgba(255,255,255,0.8)); }

        .brand-top { position: relative; z-index: 1; }

        /* INCREASED LOGO SIZE AND REFINED TYPOGRAPHY */
        .crest-lockup { display: flex; align-items: center; gap: 1.2rem; margin-bottom: clamp(2rem, 5vh, 4rem); }
        .crest-mark {
            /* Responsive-first: scales with the viewport and only then caps out, so the
               arms stay legible on a phone instead of shrinking to a token. */
            width: clamp(76px, 9vw, 116px); height: clamp(76px, 9vw, 116px);
            border-radius: 20px; flex: none;
            background: linear-gradient(135deg, #1E7C42, var(--brand-dark), #0A451F);
            box-shadow: 0 10px 25px rgba(15, 100, 48, 0.5), inset 0 2px 0 rgba(255,255,255,0.2);
            display: flex; align-items: center; justify-content: center;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,0.1);
        }
        .crest-mark img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
        .crest-mark .fallback-glyph { font-size: 2rem; }

        .crest-text .state { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 800; letter-spacing: .08em; line-height: 1.2; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
        .crest-text .ministry { font-size: .8rem; color: rgba(255,255,255,.65); margin-top: .3rem; max-width: 380px; line-height: 1.5; }

        .brand-headline {
            font-size: clamp(1rem, 2.8vw, 2.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
            max-width: 800px; margin: 0 0 1.2rem;
            text-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        .brand-headline span {
            /* Plain white. The previous mint-to-sky gradient was clipped to the glyphs
               and vanished over the lighter slides; solid white holds on all ten. */
            color: #fff;
            background: none;
            -webkit-background-clip: border-box; background-clip: border-box;
        }
        .brand-sub { font-size: 1.05rem; color: rgba(255,255,255,.7); max-width: 480px; line-height: 1.6; margin: 0; }

        /* GLASSMORPHISM FEATURES */

        /* GIS CHROME - Glassmorphic data strip */
        .gis-chrome {
            position: relative; z-index: 1;
            display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
            margin-top: clamp(2rem, 5vh, 3rem);
            padding: .85rem 1.25rem;
            background: rgba(11, 18, 32, 0.6);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255,255,255,.1);
            border-radius: 12px;
            font-family: var(--font-mono);
            box-shadow: 0 10px 30px rgba(0,0,0,0.4);
            max-width: fit-content;
        }
        .gis-chip { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: rgba(255,255,255,.7); }
        .gis-chip .k { color: var(--accent); opacity: 0.8; }
        .gis-chip .v { color: #fff; font-weight: 600; letter-spacing: 0.05em; }
        .gis-north {
            width: 24px; height: 28px; flex: none; display: flex; flex-direction: column;
            align-items: center; gap: 2px; color: rgba(255,255,255,.9);
        }
        .gis-north svg { width: 14px; height: 18px; filter: drop-shadow(0 0 4px rgba(255,255,255,0.4)); }
        .gis-north span { font-size: .6rem; font-weight: 700; letter-spacing: .04em; }
        .gis-scale { display: flex; align-items: center; gap: .5rem; }
        .gis-scale .bar { width: 60px; height: 6px; border: 1.5px solid rgba(255,255,255,.6); border-top: none; position: relative; }
        .gis-scale .bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: rgba(255,255,255,.6); }
        .gis-scale span { font-size: .7rem; color: rgba(255,255,255,.6); }

        .brand-bottom {
            position: relative; z-index: 1;
            display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
            padding-top: 1.5rem; margin-top: 2rem;
            border-top: 1px solid rgba(255,255,255,.1);
            font-size: .75rem; color: rgba(255,255,255,.45);
            padding-bottom: var(--safe-b);
            font-weight: 500;
        }
        .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34D399; margin-right: .5rem; box-shadow: 0 0 10px rgba(52,211,153,.6), 0 0 0 3px rgba(52,211,153,.15); }

        /* ============================================================
           RIGHT — FORM PANEL
           ============================================================ */
        .form-panel {
            background: var(--paper);
            display: flex; align-items: center; justify-content: center;
            padding: clamp(1.5rem, 4vh, 2.5rem) clamp(1.5rem, 4vw, 3rem);
            padding-bottom: calc(clamp(1.5rem, 4vh, 2.5rem) + 3.4rem + var(--safe-b));
            position: relative;
        }
        .form-card { width: 100%; max-width: 420px; text-align: center; }
        .form-card .input-shell input { text-align: left; }
        .form-card .row-between { text-align: left; }
        /* Labels sit against the left edge of the control they name, so the eye
           travels straight down the field stack rather than zig-zagging. */
        .form-card .field label { text-align: left; }

        .mobile-brand { display: none; }

        .form-crest {
            display: block; height: clamp(88px, 11vw, 132px); width: auto;
            margin: 0 auto 1.15rem; object-fit: contain;
            background: none; border: 0; border-radius: 0; box-shadow: none;
        }

        .form-card .eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: .6rem; }
        .form-card h1 { font-size: clamp(1.4rem, 3vw, 1.7rem); font-weight: 800; color: var(--ink); margin: 0 0 .5rem; letter-spacing: -0.02em; }
        .form-card .lede { font-size: .95rem; color: var(--ink-soft); margin: 0 0 2rem; line-height: 1.55; }

        .field { margin-bottom: 1.25rem; position: relative; }
        .field label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .5rem; }
        .input-shell {
            position: relative; display: flex; align-items: center;
            background: #fff; border: 1.5px solid var(--rule); border-radius: 10px;
            transition: all .2s ease;
            box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        }
        .input-shell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(21,128,61,.1); }
        .input-shell .ic { width: 46px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: .95rem; flex: none; transition: color 0.2s; }
        .input-shell:focus-within .ic { color: var(--brand); }
        .input-shell input {
            flex: 1; min-width: 0; border: none; outline: none; background: transparent;
            padding: .85rem .2rem .85rem 0; font-size: 1rem; color: var(--ink); font-family: inherit; font-weight: 500;
        }
        .input-shell input::placeholder { color: var(--ink-faint); font-weight: 400; }
        .toggle-visibility { width: 48px; height: 48px; flex: none; border: none; background: transparent; cursor: pointer; color: var(--ink-faint); font-size: .95rem; transition: color 0.2s; }
        .toggle-visibility:hover { color: var(--ink-soft); }
        .toggle-visibility:focus-visible { outline: 2px solid var(--brand); border-radius: 8px; }

        /* Validation Error States */
        .field.has-error .input-shell { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179,38,30,.1); }
        .field.has-error .ic { color: var(--danger); }
        .field-error { font-size: .8rem; font-weight: 500; color: var(--danger); margin-top: .5rem; display: none; align-items: flex-start; gap: .4rem; line-height: 1.4; animation: slideDown 0.2s ease; }
        .field.has-error .field-error { display: flex; }
        @keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

        .row-between { display: flex; align-items: center; justify-content: space-between; margin: .5rem 0 1.8rem; flex-wrap: wrap; gap: .5rem; }
        .remember { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
        .remember input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; border-radius: 4px; }
        .remember label { cursor: pointer; }
        .forgot { background: transparent; border: 0; padding: 0; font-family: inherit; cursor: pointer; font-size: .85rem; color: var(--brand); text-decoration: none; font-weight: 600; transition: color 0.2s; }
        .forgot:hover { color: var(--brand-dark); text-decoration: underline; }

        .btn-signin {
            width: 100%; min-height: 52px; padding: .85rem 1rem; border: none; border-radius: 10px;
            background: linear-gradient(155deg, #1B8F49, var(--brand-dark));
            color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .02em;
            cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .6rem;
            box-shadow: 0 8px 20px rgba(21,128,61,.25);
            transition: transform .1s ease, box-shadow .2s ease, opacity .2s ease;
        }
        .btn-signin:hover { box-shadow: 0 12px 28px rgba(21,128,61,.35); transform: translateY(-1px); }
        .btn-signin:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(21,128,61,.2); }
        .btn-signin:disabled { opacity: .7; cursor: not-allowed; transform: none; box-shadow: none; }

        .btn-signin .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; display: none; }
        .btn-signin.is-loading .spinner { display: inline-block; }
        .btn-signin.is-loading .btn-label, .btn-signin.is-loading i { display: none; }
        @keyframes spin { to { transform: rotate(360deg); } }

        .alert-banner { display: flex; gap: .75rem; align-items: flex-start; background: #FDF1F1; border: 1px solid #F4C9C6; color: #7A1E17; border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1.5rem; font-size: .875rem; line-height: 1.5; font-weight: 500;}
        .alert-banner.ok { background: #F0FBF4; border-color: #BBE5C8; color: #0F5A2C; }
        .alert-banner i { margin-top: .15rem; font-size: 1rem; }

        .divider-note { display: flex; align-items: center; gap: .8rem; margin: 2rem 0 1.5rem; font-size: .75rem; font-weight: 700; color: var(--ink-faint); letter-spacing: .05em; }
        .divider-note::before, .divider-note::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

        .security-note { display: flex; gap: .75rem; align-items: flex-start; justify-content: center; text-align: left; font-size: .8rem; color: var(--ink-soft); line-height: 1.6; background: var(--paper); padding: 1rem; border-radius: 8px; border: 1px dashed var(--rule); }
        .security-note i { color: var(--brand); margin-top: .2rem; font-size: 1rem;}

        /* Pinned to the foot of the panel rather than trailing the card. Taken out of
           flow, with matching space reserved by .form-panel's padding-bottom so it can
           never ride up over the security notice on a short viewport. */
        .form-foot {
            position: absolute; left: 0; right: 0; bottom: calc(1.1rem + var(--safe-b));
            margin: 0; padding: 0 1.5rem;
            text-align: center; font-size: .75rem; color: var(--ink-faint); font-weight: 500;
        }

        /* ============================================================
           RESPONSIVE
           ============================================================ */
        @media (max-width: 1100px) {
            .shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
            .parcel-field { width: 120%; right: -25%; }
            .brand-headline { font-size: clamp(1.8rem, 3vw, 2.5rem); }
        }

        @media (max-width: 900px) {
            .shell { grid-template-columns: 1fr; }
            .brand-panel { display: none; }
            .mobile-brand {
                display: flex; align-items: center; gap: 1rem;
                padding: calc(1.5rem + var(--safe-t)) 1.5rem 1.5rem;
                background: linear-gradient(135deg, var(--ink), var(--ink-3)); color: #fff;
                border-bottom: 1px solid rgba(255,255,255,0.1);
            }
            .mobile-brand .crest-mark {
                width: 54px; height: 54px; border-radius: 12px;
                background: linear-gradient(135deg, #1E7C42, var(--brand-dark));
                box-shadow: 0 4px 10px rgba(0,0,0,0.3);
                border: 1px solid rgba(255,255,255,0.2);
            }
            .mobile-brand .mb-text .state { font-size: 1rem; font-weight: 800; letter-spacing: .05em; }
            .mobile-brand .mb-text .sub { font-size: .75rem; color: rgba(255,255,255,.7); margin-top: 2px; }
            .form-panel { padding-top: 2.5rem; align-items: flex-start; }
            .form-crest { display: none; }
        }

        @media (max-width: 380px) {
            .form-card .lede { margin-bottom: 1.5rem; }
            .row-between { margin-bottom: 1.25rem; }
            .gis-chrome { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
        }

        @media (prefers-reduced-motion: reduce) {
            .scan-line { animation: none; display: none; }
            .btn-signin .spinner { animation: none; }
        }
