/* Sign-in — page styles.
   Extracted from login.php (704 lines of inline \3c style>).
   This entry point does NOT load style.css, so it cannot use the --c-*
   or --z-* tokens; its values stay literal on purpose. It is standalone
   by design — a signed-out visitor should not download the whole app's
   stylesheet to read one page.
   Cache-busted with filemtime, which inline CSS could never be. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
        /* TALLY: the fixed palette, same eleven values landing.css serves. */
        --blue:    #0f172a;   /* the action ink */
        --blue-d:  #000000;
        --slate:   #334155;
        --slate-d: #0f172a;
        --muted:   #475569;
        --border:  #e2e8f0;
        --bg:      #f1f5f9;
    }

    html, body {
        height: 100%;
        font-family: 'Public Sans', -apple-system, sans-serif;
    }

    /* ── Layout ─────────────────────────────────── */
    .lg-wrap {
        display: flex;
        min-height: 100vh; min-height: 100dvh;
    }

    /* ── Left panel ─────────────────────────────── */
    .lg-left {
        width: 420px;
        flex-shrink: 0;
        background: var(--slate-d);
        display: flex;
        flex-direction: column;
        padding: 48px 44px;
        position: relative;
        overflow: hidden;
    }

    /* Decorative blobs */
    .lg-blob {
        position: absolute;
        border-radius: 50%;
        filter: blur(80px);
        pointer-events: none;
    }
    .lg-blob-1 {
        width: 320px; height: 320px;
        background: rgba(15, 23, 42,.35);
        top: -80px; left: -80px;
    }
    .lg-blob-2 {
        width: 260px; height: 260px;
        background: rgba(15, 23, 42,.25);
        bottom: 40px; right: -60px;
    }
    .lg-blob-3 {
        width: 180px; height: 180px;
        background: rgba(100, 116, 139,.2);
        bottom: 200px; left: 40px;
    }

    /* Grid dots pattern */
    .lg-dots {
        position: absolute;
        inset: 0;
        background-image: rgba(255,255,255,.06) 1px;
        background-size: 28px 28px;
        pointer-events: none;
    }

    /* Brand mark */
    .lg-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        position: relative;
        z-index: 1;
    }
    .lg-brand-logo {
        width: 40px; height: 40px;
        border-radius: 10px;
        object-fit: contain;
        background: rgba(255,255,255,.15);
        border: 1px solid rgba(255,255,255,.25);
        padding: 4px;
        flex-shrink: 0;
    }
    .lg-brand-name {
        font-size: 20px;
        font-weight: 800;
        color: #fff;
        letter-spacing: -.3px;
    }

    /* Hero text
       `margin-top: auto` alone shoved this to the floor of the panel, leaving a
       third of a screen of empty navy above it while the form opposite was
       vertically centred — two halves of one screen using two different
       alignments. Auto on both sides centres it between the brand and the
       footnote, so the two columns agree. */
    .lg-hero {
        position: relative;
        z-index: 1;
        margin-block: auto;
        padding-bottom: 8px;
    }
    .lg-hero-tag {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(15, 23, 42,.2);
        border: 1px solid rgba(15, 23, 42,.4);
        color: #cbd5e1;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .6px;
        text-transform: uppercase;
        padding: 4px 12px;
        border-radius: 20px;
        margin-bottom: 20px;
    }
    .lg-hero-title {
        font-size: 32px;
        font-weight: 800;
        color: #fff;
        line-height: 1.2;
        letter-spacing: -.5px;
        margin-bottom: 14px;
    }
    .lg-hero-title span {
        color: #FFFFFF;
    }
    .lg-hero-desc {
        font-size: 14px;
        color: #475569;
        line-height: 1.6;
        margin-bottom: 32px;
    }

    /* Feature list */
    .lg-features {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .lg-feature {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        color: #cbd5e1;
    }
    .lg-feature-dot {
        width: 6px; height: 6px;
        background: rgba(255, 255, 255, 0.45);
        border-radius: 50%;
        flex-shrink: 0;
    }

    /* Copyright */
    .lg-copy {
        position: relative;
        z-index: 1;
        font-size: 11px;
        color: #334155;
        margin-top: 40px;
    }

    /* ── Right panel ─────────────────────────────── */
    .lg-right {
        flex: 1;
        background: var(--bg);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px 24px;
    }

    .lg-form-wrap {
        width: 100%;
        max-width: 400px;
    }

    /* Back-to-homepage link */
    .lg-back-home {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 24px;
        color: #475569;
        font-size: 13px;
        font-weight: 600;
        text-decoration: none;
        transition: color .15s;
    }
    .lg-back-home:hover { color: #0f172a; }

    /* Form header */
    .lg-form-head {
        margin-bottom: 32px;
    }
    .lg-form-title {
        font-size: 26px;
        font-weight: 800;
        color: var(--slate);
        letter-spacing: -.4px;
        margin-bottom: 6px;
    }
    .lg-form-sub {
        font-size: 14px;
        color: var(--muted);
    }

    /* Error */
    .lg-error {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
        font-size: 13px;
        font-weight: 500;
        padding: 10px 14px;
        border-radius: 8px;
        margin-bottom: 20px;
    }

    /* Fields */
    .lg-field {
        margin-bottom: 18px;
    }
    .lg-label {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: var(--slate);
        margin-bottom: 6px;
        letter-spacing: .2px;
    }
    .lg-input-wrap {
        position: relative;
    }
    .lg-input-icon {
        position: absolute;
        left: 13px;
        top: 50%;
        transform: translateY(-50%);
        color: #475569;
        font-size: 15px;
        pointer-events: none;
    }
    .lg-input {
        width: 100%;
        padding: 10px 12px 10px 38px;
        font-size: 14px;
        font-family: inherit;
        color: var(--slate);
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        outline: none;
        transition: border-color .15s, box-shadow .15s;
    }
    .lg-input:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(15, 23, 42,.1);
    }
    .lg-input::placeholder { color: #cbd5e1; }

    /* Password toggle */
    .lg-pw-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #475569;
        cursor: pointer;
        font-size: 16px;
        padding: 0;
        line-height: 1;
    }
    .lg-pw-toggle:hover { color: var(--muted); }
    .lg-input.has-toggle { padding-right: 40px; }

    /* Submit */
    .lg-submit {
        width: 100%;
        padding: 11px;
        background: var(--blue);
        color: #fff;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        border: none;
        border-radius: 3px;
        cursor: pointer;
        transition: background .15s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 8px;
    }
    .lg-submit:hover { background: var(--blue-d); }

    /* Divider */
    .lg-divider {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 24px 0;
        color: #475569;
        font-size: 12px;
        font-weight: 500;
    }
    .lg-divider::before, .lg-divider::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border);
    }

    /* Portal button */
    .lg-portal-btn {
        width: auto;
        padding: 10px 16px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 500;
        color: var(--muted);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: border-color .15s, color .15s, background .15s;
    }
    .lg-portal-btn:hover {
        border-color: var(--blue);
        color: var(--blue);
        background: #f1f5f9;
    }

    /* ── Portal Modal ───────────────────────────── */
    .pm-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15,23,42,.55);
        backdrop-filter: blur(4px);
        z-index: 100002; /* above the cookie consent bar (99999) + its modal (100000) */
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    .pm-overlay.open { display: flex; }

    .pm-card {
        background: #fff;
        border-radius: 16px;
        width: 100%;
        max-width: 420px;
        overflow: hidden;
        box-shadow: 0 24px 64px rgba(0,0,0,.2);
    }
    .pm-header {
        padding: 20px 24px;
        background: #0f172a;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .pm-title {
        font-size: 16px;
        font-weight: 700;
        color: #fff;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .pm-close {
        width: 32px; height: 32px;
        background: rgba(255,255,255,.15);
        border: none;
        border-radius: 8px;
        color: #fff;
        font-size: 16px;
        cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        transition: background .15s;
    }
    .pm-close:hover { background: rgba(255,255,255,.25); }

    .pm-body { padding: 24px; }
    .pm-desc {
        font-size: 13px;
        color: var(--muted);
        margin-bottom: 20px;
        line-height: 1.5;
    }
    .pm-error {
        display: none;
        background: #fef2f2;
        border: 1px solid #fecaca;
        color: #991b1b;
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 6px;
        margin-bottom: 14px;
    }
    .pm-label {
        display: block;
        font-size: 11px;
        font-weight: 600;
        color: var(--slate);
        text-transform: uppercase;
        letter-spacing: .4px;
        margin-bottom: 6px;
    }
    .pm-code-input {
        width: 100%;
        padding: 14px 12px;
        font-size: 2rem;
        font-weight: 700;
        font-family: 'Courier New', monospace;
        letter-spacing: 12px;
        text-align: center;
        color: #12684a;
        background: #f8fafc;
        border: 2px solid #bbf7d0;
        border-radius: 10px;
        outline: none;
        margin-bottom: 16px;
        transition: border-color .15s, box-shadow .15s;
    }
    .pm-code-input:focus {
        border-color: #157a58;
        box-shadow: 0 0 0 3px rgba(22,163,74,.12);
        background: #fff;
    }
    .pm-code-input::placeholder {
        color: #86efac;
        letter-spacing: 12px;
    }

    /* Clean text input for email / password (NOT the access-code style). */
    .pm-text-input {
        width: 100%;
        height: 48px;
        padding: 0 14px;
        font-size: 15px;
        font-weight: 500;
        font-family: inherit;
        color: #0f172a;
        background: #fff;
        border: 1.5px solid #e2e8f0;
        border-radius: 11px;
        outline: none;
        transition: border-color .15s, box-shadow .15s;
    }
    .pm-text-input::placeholder { color: #475569; font-weight: 400; letter-spacing: normal; }
    .pm-text-input:focus { border-color: #0f172a; box-shadow: 0 0 0 3px rgba(29,158,117,.13); }

    /* Store search autocomplete */
    .pm-search-wrap {
        position: relative;
        margin-bottom: 16px;
    }
    .pm-search-icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #475569;
        font-size: 14px;
        pointer-events: none;
        z-index: 1;
    }
    .pm-search-input {
        width: 100%;
        padding: 10px 36px 10px 34px;
        font-size: 14px;
        font-family: inherit;
        color: var(--slate);
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        outline: none;
        transition: border-color .15s, box-shadow .15s;
    }
    .pm-search-input:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(15, 23, 42,.1);
    }
    .pm-search-input::placeholder { color: #cbd5e1; }
    .pm-search-input.has-value { font-weight: 600; color: var(--slate); }
    .pm-clear-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #475569;
        cursor: pointer;
        font-size: 13px;
        padding: 2px;
        display: none;
        line-height: 1;
    }
    .pm-clear-btn:hover { color: var(--muted); }
    .pm-suggestions {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        left: 0; right: 0;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0,0,0,.12);
        z-index: 200;
        max-height: 200px;
        overflow-y: auto;
    }
    .pm-suggestions.open { display: block; }
    .pm-sug-item {
        padding: 9px 12px 9px 34px;
        font-size: 13px;
        color: var(--slate);
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: background .1s;
        position: relative;
    }
    .pm-sug-item:first-child { border-radius: 8px 8px 0 0; }
    .pm-sug-item:last-child  { border-radius: 0 0 8px 8px; }
    .pm-sug-item:hover, .pm-sug-item.active { background: #f1f5f9; color: var(--blue); }
    .pm-sug-item .sug-icon {
        position: absolute;
        left: 11px;
        font-size: 12px;
        color: #475569;
    }
    .pm-sug-item:hover .sug-icon,
    .pm-sug-item.active .sug-icon { color: var(--blue); }
    .pm-sug-empty {
        padding: 10px 12px;
        font-size: 13px;
        color: #475569;
        text-align: center;
    }
    .pm-store-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #f1f5f9;
        border: 1px solid #e2e8f0;
        color: var(--blue);
        font-size: 11px;
        font-weight: 600;
        padding: 2px 8px;
        border-radius: 4px;
        margin-bottom: 16px;
    }
    .pm-code-input {
        font-size: 1.6rem;
        font-family: 'Courier New', monospace;
        font-weight: 700;
        letter-spacing: 10px;
        text-align: center;
        text-transform: uppercase;
    }
    .pm-hint {
        font-size: 11px;
        color: #475569;
        margin-top: -12px;
        margin-bottom: 16px;
    }
    .pm-submit {
        width: 100%;
        padding: 11px;
        background: var(--blue);
        color: #fff;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: background .15s;
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .pm-submit:hover  { background: var(--blue-d); }
    .pm-submit:disabled { opacity: .65; cursor: not-allowed; }

    /* ── Responsive ─────────────────────────────────────────── */

    /* Large Desktop (1400px+) */
    @media (min-width: 1400px) {
        .lg-left { width: 480px; padding: 56px 52px; }
        .lg-hero-title { font-size: 36px; }
        .lg-form-wrap { max-width: 440px; }
    }

    /* Desktop (1024px – 1399px) — default, looks great as-is */

    /* Tablet landscape (768px – 1023px) */
    @media (max-width: 1023px) and (min-width: 768px) {
        .lg-left {
            width: 320px;
            padding: 36px 32px;
        }
        .lg-hero-tag { font-size: 10px; margin-bottom: 14px; }
        .lg-hero-title { font-size: 24px; margin-bottom: 10px; }
        .lg-hero-desc { font-size: 13px; margin-bottom: 22px; }
        .lg-features { gap: 8px; }
        .lg-feature { font-size: 12px; }
        .lg-right { padding: 32px 20px; }
        .lg-form-title { font-size: 22px; }
    }

    /* Tablet portrait + Mobile (< 768px) */
    @media (max-width: 767px) {
        /* Stack vertically */
        .lg-wrap { flex-direction: column; min-height: 100vh; min-height: 100dvh; }

        /* Left becomes a compact top banner — clears the notch via safe-area
           and gives extra bottom room for the form "sheet" to rise over it. */
        .lg-left {
            width: 100%;
            flex-shrink: 0;
            padding: calc(20px + env(safe-area-inset-top, 0px)) 24px 40px;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }

        /* Hide blobs & hero text on mobile, keep brand only */
        .lg-hero, .lg-copy { display: none; }
        .lg-blob-1 { width: 200px; height: 200px; top: -60px; left: -60px; }
        .lg-blob-2 { width: 160px; height: 160px; bottom: -40px; right: -40px; }
        .lg-blob-3 { display: none; }

        /* Right panel becomes a white "sheet" with rounded top that rises over
           the dark banner — a modern app login feel. */
        .lg-right {
            flex: 1;
            background: #fff;
            flex-direction: column;          /* stack so justify-content centers vertically */
            align-items: stretch;            /* form fills width */
            justify-content: center;         /* center vertically so the sheet isn't mostly empty */
            padding: 30px 24px calc(40px + env(safe-area-inset-bottom, 0px));
            border-radius: 26px 26px 0 0;
            margin-top: -22px;
            position: relative;
            z-index: 1;
            box-shadow: 0 -10px 30px rgba(15, 23, 42, .12);
        }
        /* When the fixed cookie bar is showing, reserve its height here so the
           Customer Portal button + footer never sit underneath it (cc-bar-open and
           --cc-bar-h are set by app/Core/cookie-consent.php). */
        html.cc-bar-open .lg-right { padding-bottom: calc(var(--cc-bar-h, 160px) + 28px); }
        .lg-form-wrap { max-width: 100%; }
        .lg-form-head { margin-bottom: 24px; }
        .lg-form-title { font-size: 22px; }

        /* Bigger tap targets */
        .lg-input  { padding: 13px 12px 13px 40px; font-size: 16px; }
        .lg-submit { padding: 14px; font-size: 15px; }
        .lg-portal-btn { padding: 13px 16px; font-size: 14px; }
        .lg-pw-toggle { font-size: 18px; right: 14px; }
        .lg-input-icon { font-size: 17px; left: 14px; }
        .lg-field { margin-bottom: 20px; }
        .lg-label { font-size: 13px; margin-bottom: 7px; }

        /* Modal fills screen on mobile */
        .pm-overlay { align-items: flex-end; padding: 0; }
        .pm-card {
            border-radius: 20px 20px 0 0;
            max-width: 100%;
        }
        .pm-code-input { font-size: 18px; letter-spacing: 4px; }
        .pm-code-input, .pm-search-input { padding: 13px 12px 13px 34px; font-size: 16px; }
        .pm-submit { padding: 14px; font-size: 15px; }
        .pm-suggestions { max-height: 160px; }
    }

    /* Small mobile (< 400px) */
    @media (max-width: 399px) {
        .lg-right { padding: 28px 18px 36px; }
        .lg-form-title { font-size: 20px; }
        .lg-brand-name { font-size: 17px; }
    }
