/* =============================================================
   Login — modern orange / white / gray. Page-scoped (loaded only
   by Views/Home/Index.cshtml). Preserves the ids/classes Login.js
   relies on: #Login-Container / #SecondWall-Container /
   #ResetPassword-Container (.auth-container/.active), #Pin-Boxes
   (input + select.PIN-Tile), .login-input, .accept.
   ============================================================= */

:root {
    /* --brand/--ink/--muted/--paper/--line* removed: use tokens.css's
       canonical values (already in scope via _Layout) instead of a local
       copy -- --brand here had drifted to #B5530E vs tokens.css's #E8633C.
       --font/--mono removed for the same reason, earlier. */
    --r-lg: 20px;
    --r-md: 12px;
    --shadow: 0 1px 2px rgba(20,16,12,.07), 0 18px 50px rgba(30,20,10,.30);
}

/* ---- full-screen login canvas (override global layout chrome) ---- */
html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    padding-top: 0 !important; /* no navbar on login: drop Nav.css's 56px body offset */
    overflow-x: hidden;
    font-family: var(--font-sans);
    background: radial-gradient(900px 500px at 15% -20%, #F6E3C8 0%, transparent 55%), radial-gradient(700px 500px at 110% 120%, #EADAB9 0%, transparent 50%), linear-gradient(160deg, #F4EBDB 0%, #EEE2CC 60%, #E9DCC2 100%) !important;
    background-attachment: fixed !important;
}

#nav, .footer, #Menu-Div {
    display: none !important;
}

#Main-Div.main-section, #Main-Div {
    margin: 0 !important;
    margin-top: 0 !important; /* no navbar on login: drop .main-section's 80px top offset */
    padding: 16px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100vh !important;
    height: 100dvh !important; /* dynamic viewport so it never overflows one screen */
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex !important;
    align-items: safe center;
    justify-content: safe center;
    overflow-y: auto; /* the page never scrolls; only this canvas, only if a stage is very tall */
    position: relative;
    box-sizing: border-box;
}

    /* grain + a slow drifting glow for depth */
    #Main-Div::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        opacity: .35;
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/></svg>");
    }

    #Main-Div::after {
        content: "";
        position: fixed;
        width: 520px;
        height: 520px;
        left: -120px;
        bottom: -160px;
        background: radial-gradient(circle, rgba(217,116,31,.08), transparent 70%);
        filter: blur(10px);
        pointer-events: none;
        animation: login-drift 16s ease-in-out infinite alternate;
    }

@keyframes login-drift {
    from {
        transform: translate(0,0);
    }

    to {
        transform: translate(60px,-40px);
    }
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- card / stages ---- */
.stage-wrap {
    position: relative;
    width: 100%;
    max-width: 440px;
    z-index: 1;
}

.auth-container {
    display: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 26px 32px 26px;
    box-sizing: border-box;
}

    .auth-container.active {
        display: block;
        animation: login-rise .45s cubic-bezier(.2,.7,.2,1) both;
    }

/* ---- brand lockup ---- */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, var(--brand) 0%, var(--brand-deep) 100%);
    box-shadow: 0 6px 16px rgba(156,74,8,.32);
    color: #fff;
}

.brand-name {
    font-size: 0.84375rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}

    .brand-name b {
        color: var(--ink);
    }

.stage-title {
    font-size: 1.4375rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 4px;
    letter-spacing: -.01em;
    color: var(--ink);
}

.stage-sub {
    font-size: 0.90625rem;
    color: var(--muted);
    text-align: center;
    margin: 0 0 16px;
    line-height: 1.5;
}

/* ---- fields ---- */
.field {
    margin-bottom: 16px;
    text-align: left;
}

    .field label {
        display: block;
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--ink-soft);
        margin: 0 0 6px 2px;
    }

.login-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-family: var(--font-sans);
    font-size: 0.96875rem;
    color: var(--ink);
    background: var(--paper-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

    .login-input::placeholder {
        color: var(--muted);
        opacity: .8;
    }

    .login-input:focus {
        border-color: var(--brand);
        background: var(--paper);
        box-shadow: 0 0 0 3px var(--brand-pale);
    }

/* ---- hold-to-reveal password ---- */
.login-input-wrap {
    position: relative;
}

    .login-input-wrap .login-input {
        padding-right: 46px;
    }

.login-peek {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: color .15s;
}

    .login-peek:hover, .login-peek.is-peeking {
        color: var(--brand);
    }

    .login-peek svg {
        width: 18px;
        height: 18px;
        display: block;
    }

/* ---- primary button (.accept is reused by Login.js) ---- */
.accept {
    width: 100%;
    height: 46px;
    margin-top: 6px;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.96875rem;
    font-weight: 700;
    color: #fff;
    border-radius: var(--r-md);
    background: linear-gradient(150deg, var(--brand) 0%, var(--brand-deep) 100%);
    box-shadow: 0 6px 16px rgba(156,74,8,.30);
    transition: filter .15s, transform .05s, box-shadow .15s;
}

    .accept:hover {
        filter: brightness(1.06);
    }

    .accept:active {
        transform: translateY(1px);
    }

    .accept:focus-visible {
        outline: 2px solid var(--brand);
        outline-offset: 2px;
    }

/* ---- PIN: 2 dropdowns + 4 inputs, built by Login.js into #Pin-Boxes ---- */
#Pin-Boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 6px 0 8px;
}

    #Pin-Boxes input, #Pin-Boxes select {
        width: 52px;
        height: 62px;
        text-align: center;
        font-family: var(--font-mono);
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--ink);
        background: var(--paper-2);
        border: 1px solid var(--border-strong);
        border-radius: var(--r-md);
        outline: none;
        padding: 0;
        box-sizing: border-box;
        transition: border-color .15s, box-shadow .15s, background .15s;
    }

        #Pin-Boxes input:focus, #Pin-Boxes select:focus {
            border-color: var(--brand);
            background: var(--paper);
            box-shadow: 0 0 0 3px var(--brand-pale);
        }

        #Pin-Boxes select.PIN-Tile {
            -webkit-appearance: none;
            appearance: none;
            cursor: pointer;
            background: var(--brand-pale);
            border-color: var(--brand-line);
            color: var(--brand-deep);
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%239C4A08' stroke-width='1.8'><path d='M1 1l4 4 4-4'/></svg>");
            background-repeat: no-repeat;
            background-position: center 46px;
        }

.pin-caption {
    display: flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
    font-size: 0.78125rem;
    color: var(--muted);
    margin: 14px 0 22px;
}

    .pin-caption .dot {
        width: 13px;
        height: 13px;
        border-radius: 4px;
        background: var(--brand-pale);
        border: 1px solid var(--brand-line);
        flex: none;
    }

#SecondWall-div {
    text-align: center;
}

/* ---- reset password — requirements ---- */
#Reset-Password .req-list {
    list-style: none;
    margin: 0 0 22px;
    padding: 14px 16px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

#Reset-Password .req-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

#Reset-Password li.req {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.84375rem;
    color: var(--muted);
    padding: 3px 0;
}

    #Reset-Password li.req .req-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--brand);
        flex: none;
    }

@media (max-width: 480px) {
    .auth-container {
        padding: 30px 22px;
    }

    #Pin-Boxes {
        gap: 7px;
    }

        #Pin-Boxes input, #Pin-Boxes select {
            width: 42px;
            height: 54px;
            font-size: 1.25rem;
        }

            #Pin-Boxes select.PIN-Tile {
                background-position: center 40px;
            }
}

/* ---- Forgot-password hint (no self-service reset; contact support) ---- */
.login-help {
    position: relative;
    text-align: center;
    margin-top: 16px;
}

.login-help-trigger {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--muted);
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: help;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--line-2);
}

    .login-help-trigger:hover,
    .login-help-trigger:focus-visible {
        color: var(--ink-soft);
        text-decoration-color: var(--brand);
        outline: none;
    }

.login-help-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 280px;
    padding: 9px 12px;
    font-size: 0.78125rem;
    line-height: 1.45;
    color: #FBF6EC; /* light constant: the bubble stays dark in both themes */
    background: #2a2521;
    border-radius: var(--r-md);
    box-shadow: 0 6px 18px rgba(20,16,12,.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 5;
}

    .login-help-bubble::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: #2a2521;
    }

.login-help-trigger:hover + .login-help-bubble,
.login-help-trigger:focus-visible + .login-help-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .login-help-bubble {
        transition: none;
    }
}

/* ---- dark mode (saved theme; Theme.js sets data-theme on login too) ----
   tokens.css has no dark values for --paper/--paper-2/--ink/--brand-pale
   (light-only tokens), so this page scopes its own, aligned to the dark
   family: panel #2B2724 / row-hover #34302C / text #E8E0D6. */
html[data-theme="dark"] {
    --paper: #2B2724;
    --paper-2: #34302C;
    --ink: #E8E0D6;
    --ink-soft: #C9C0B4;
    --brand-pale: rgba(232, 99, 60, .16);
}

    html[data-theme="dark"] body {
        background: radial-gradient(900px 500px at 15% -20%, #2B2520 0%, transparent 55%), radial-gradient(700px 500px at 110% 120%, #262019 0%, transparent 50%), linear-gradient(160deg, #211D1A 0%, #1E1B19 60%, #191613 100%) !important;
    }