/* ==========================================================================
   TILL 14 — staff sign-in pages (Mobile Banker, Teller, Branch Manager,
   Coordinator, Audit, Risk). Markup lives in includes/login_view.php.
   Light / dark via html[data-theme] (js/t14-theme.js).
   ========================================================================== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

:root {
    --green: #0E5A3A;
    --deep: #0A4630;
    --ink: #10231A;
    --gold: #E8B13A;
    --font-head: 'Bricolage Grotesque', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --bg: #F4F5F2;
    --surface: #FFFFFF;
    --text: #10231A;
    --text-2: #34433B;
    --muted: #5F6E66;
    --faint: #8E9A93;
    --line: #DDE3DE;
    --line-strong: #C9D1CB;
    --input-bg: #FFFFFF;
    --hover: #EEF2EE;
    --tag-bg: #EDF3EF;
    --tag-text: #0E5A3A;
    --link: #0E5A3A;
    --red: #B42318;
    --red-bg: #FEF3F2;
    --red-line: #F9D2CE;
    --amber: #8A5A00;
    --amber-bg: #FFF8E6;
    --amber-line: #F3DDA4;
    --focus: rgba(232, 177, 58, 0.24);
    --btn: #0E5A3A;
    --btn-hover: #10231A;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #0B1712;
    --surface: #12211A;
    --text: #E8EFEA;
    --text-2: #C9D5CE;
    --muted: #9DB0A6;
    --faint: #73867C;
    --line: #22362C;
    --line-strong: #2F473A;
    --input-bg: #0F1D16;
    --hover: #1A2C23;
    --tag-bg: rgba(232, 177, 58, 0.12);
    --tag-text: #F0C866;
    --link: #F0C866;
    --red: #FF9B91;
    --red-bg: rgba(180, 35, 24, 0.16);
    --red-line: rgba(255, 155, 145, 0.28);
    --amber: #F0C866;
    --amber-bg: rgba(232, 177, 58, 0.12);
    --amber-line: rgba(232, 177, 58, 0.3);
    --focus: rgba(232, 177, 58, 0.3);
    --btn: #17734A;
    --btn-hover: #1C8A59;
    color-scheme: dark;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
    -webkit-font-smoothing: antialiased;
}

.t14-icon {
    flex-shrink: 0;
}

/* ── Brand panel ──────────────────────────────────────────────────────── */
.lg-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--deep);
    background-image:
        radial-gradient(circle at 72% 46%, rgba(232, 177, 58, 0.16), transparent 46%),
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: auto, 24px 24px;
    color: #fff;
    padding: 40px 56px 40px;
    display: flex;
    flex-direction: column;
}

.lg-panel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold) 0 34%, var(--green) 34% 100%);
}

.lg-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    width: max-content;
}

.lg-brand img {
    width: 42px;
    height: 42px;
}

.lg-brand-name {
    font: 800 19px/1.1 var(--font-head);
    letter-spacing: -0.015em;
}

.lg-brand-name b {
    color: var(--gold);
}

.lg-brand-name span {
    display: block;
    font: 500 11px var(--font-body);
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.6);
}

/* Ring with the role's icon in the middle */
.lg-emblem {
    position: relative;
    width: 188px;
    height: 188px;
    margin: auto 0 34px;
}

.lg-emblem svg.lg-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.lg-tick {
    stroke: rgba(255, 255, 255, 0.13);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke 0.35s ease;
}

.lg-tick.on {
    stroke: var(--gold);
}

.lg-emblem-core {
    position: absolute;
    inset: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.lg-copy {
    max-width: 460px;
}

.lg-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}

.lg-panel h1 {
    font: 800 clamp(34px, 3.8vw, 52px)/1.02 var(--font-head);
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.lg-panel h1 span {
    color: var(--gold);
}

.lg-desc {
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 26px;
}

.lg-points {
    list-style: none;
    display: grid;
    gap: 12px;
}

.lg-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.86);
}

.lg-points li > span {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lg-panel-foot {
    margin-top: 40px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Form side ────────────────────────────────────────────────────────── */
.lg-main {
    display: flex;
    flex-direction: column;
    padding: 28px 56px 28px;
    min-width: 0;
}

.lg-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.lg-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 4px;
}

.lg-home:hover {
    color: var(--link);
}

.lg-theme {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lg-theme:hover {
    color: var(--text);
    background: var(--hover);
}

.lg-theme .when-dark,
html[data-theme="dark"] .lg-theme .when-light {
    display: none;
}

html[data-theme="dark"] .lg-theme .when-dark {
    display: inline;
}

.lg-wrap {
    width: 100%;
    max-width: 410px;
    margin: auto;
    padding: 36px 0;
}

.lg-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--tag-text);
    background: var(--tag-bg);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 18px;
}

.lg-wrap h2 {
    font: 800 32px/1.1 var(--font-head);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.lg-sub {
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.55;
    margin-bottom: 28px;
}

/* Notices */
.lg-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--red-line);
    border-left: 3px solid var(--red);
    background: var(--red-bg);
    color: var(--red);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
}

.lg-alert .t14-icon {
    margin-top: 1px;
}

.lg-alert.is-warn {
    border-color: var(--amber-line);
    border-left-color: var(--gold);
    background: var(--amber-bg);
    color: var(--amber);
}

/* Login-hours card (Mobile Banker) */
.lg-closed {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 18px;
    margin-bottom: 22px;
}

.lg-closed-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.lg-closed-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--amber-bg);
    color: var(--amber);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lg-closed-head strong {
    display: block;
    font: 700 16px var(--font-head);
}

.lg-closed-head small {
    font-size: 12.5px;
    color: var(--muted);
}

.lg-clock {
    margin-left: auto;
    font: 700 15px var(--font-head);
    font-variant-numeric: tabular-nums;
    color: var(--text);
    white-space: nowrap;
}

.lg-closed p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-2);
}

.lg-hours {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--hover);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

/* Fields */
.lg-field {
    margin-bottom: 18px;
}

.lg-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
}

.lg-label label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.lg-label a {
    font-size: 13px;
    font-weight: 600;
    color: var(--link);
    text-decoration: none;
}

.lg-label a:hover {
    text-decoration: underline;
}

.lg-control {
    position: relative;
}

.lg-control > .t14-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--faint);
    pointer-events: none;
    transition: color 0.2s;
}

.lg-control input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--input-bg);
    padding: 0 48px 0 44px;
    font: 500 15px var(--font-body);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lg-control input::placeholder {
    color: var(--faint);
    font-weight: 400;
}

.lg-control input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--focus);
}

html[data-theme="dark"] .lg-control input:focus {
    border-color: var(--gold);
}

.lg-control:focus-within > .t14-icon {
    color: var(--link);
}

.lg-control input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lg-reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lg-reveal:hover {
    background: var(--hover);
    color: var(--text);
}

.lg-reveal:focus-visible {
    outline: 2px solid var(--gold);
}

.lg-caps {
    display: none;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--amber);
}

.lg-caps.show {
    display: block;
}

/* Failed-attempt meter (Mobile Banker) */
.lg-attempts {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 18px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--amber);
}

.lg-attempts i {
    display: inline-flex;
    gap: 4px;
}

.lg-attempts b {
    width: 22px;
    height: 5px;
    border-radius: 3px;
    background: var(--line-strong);
}

.lg-attempts b.used {
    background: var(--red);
}

/* Submit */
.lg-submit {
    width: 100%;
    height: 54px;
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    background: var(--btn);
    color: #fff;
    font: 700 15px var(--font-head);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

.lg-submit:hover {
    background: var(--btn-hover);
}

.lg-submit:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.lg-submit[disabled] {
    cursor: not-allowed;
    background: var(--line-strong);
    color: var(--muted);
}

.lg-submit.loading {
    cursor: progress;
    background: var(--btn);
    color: #fff;
}

.lg-spin {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-spin 0.8s linear infinite;
}

.lg-submit.loading .lg-spin {
    display: inline-block;
}

.lg-submit.loading .lg-arrow {
    display: none;
}

@keyframes lg-spin {
    to {
        transform: rotate(360deg);
    }
}

.lg-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 20px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted);
}

.lg-note .t14-icon {
    color: var(--link);
    margin-top: 1px;
}

.lg-foot {
    font-size: 12px;
    color: var(--faint);
    text-align: center;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    body {
        grid-template-columns: 1fr;
        align-content: start;
    }

    .lg-panel {
        padding: 18px 20px 26px;
        padding-top: max(18px, env(safe-area-inset-top));
    }

    .lg-emblem {
        position: absolute;
        width: 220px;
        height: 220px;
        right: -56px;
        top: -40px;
        margin: 0;
        opacity: 0.55;
        z-index: -1;
    }

    .lg-emblem-core {
        display: none;
    }

    .lg-copy {
        margin-top: 26px;
    }

    .lg-eyebrow {
        margin-bottom: 10px;
        letter-spacing: 0.24em;
    }

    .lg-panel h1 {
        font-size: 30px;
        margin-bottom: 8px;
    }

    .lg-desc {
        font-size: 14px;
        margin-bottom: 0;
    }

    .lg-points,
    .lg-panel-foot {
        display: none;
    }

    .lg-main {
        padding: 0 20px 24px;
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .lg-top {
        position: absolute;
        top: max(14px, env(safe-area-inset-top));
        right: 16px;
    }

    .lg-home {
        display: none;
    }

    .lg-theme {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.18);
        color: #fff;
    }

    .lg-wrap {
        max-width: 520px;
        padding: 26px 0 28px;
    }

    .lg-tag {
        display: none;
    }

    .lg-wrap h2 {
        font-size: 26px;
    }

    .lg-sub {
        margin-bottom: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg-tick {
        transition: none;
    }

    .lg-spin {
        animation-duration: 2s;
    }
}
