﻿/* Lavish POS sign-in styles */
:root {
    --navy: #16233F;
    --gold: #E2A63B;
    --bg: #dfe4ec;
    --panel: #f3f5f9;
    --ink: #16233F;
    --muted: #5d6985;
    --line: #c3cad9;
    --key: #ffffff;
    --key-edge: #aab3c8;
    --accent: #16233F;
    --accent-ink: #E2A63B;
    --sel: #16233F;
    --ok: #17814f;
    --bad: #d3341c;
    --paper: #fbfbf8;
    --paper-ink: #2a2f34;
    color-scheme: light;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top,0px);
    padding-bottom: env(safe-area-inset-bottom,0px);
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) {
        --bg: #0b1324;
        --panel: #13203a;
        --ink: #e8edf5;
        --muted: #98a5c2;
        --line: #2a3a5e;
        --key: #1d2c4d;
        --key-edge: #080e1c;
        --accent: #E2A63B;
        --accent-ink: #16233F;
        --sel: #E2A63B;
        --ok: #3ec585;
        --bad: #ff6b52;
        --paper: #ecebe4;
        --paper-ink: #23282d;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0b1324;
    --panel: #13203a;
    --ink: #e8edf5;
    --muted: #98a5c2;
    --line: #2a3a5e;
    --key: #1d2c4d;
    --key-edge: #080e1c;
    --accent: #E2A63B;
    --accent-ink: #16233F;
    --sel: #E2A63B;
    --ok: #3ec585;
    --bad: #ff6b52;
    --paper: #ecebe4;
    --paper-ink: #23282d;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0
}

html, body {
    min-height: 100%
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: Archivo,system-ui,sans-serif;
    display: grid;
    place-items: center;
    padding: 20px;
    min-height: 100vh
}

.stage {
    width: min(960px,100%)
}

/* offline banner */
.banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--gold);
    color: var(--navy);
    border-radius: 12px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0 16px;
    margin-bottom: 0;
    transition: max-height .35s,opacity .25s,padding .35s,margin .35s
}

    .banner.show {
        max-height: 140px;
        opacity: 1;
        padding: 12px 16px;
        margin-bottom: 12px
    }

    .banner.back {
        background: var(--ok);
        color: #fff
    }

    .banner svg {
        flex: none;
        width: 26px;
        height: 26px
    }

    .banner .t {
        flex: 1;
        font-size: 14px;
        line-height: 1.4
    }

        .banner .t b {
            display: block;
            font-size: 15px;
            font-weight: 800
        }

    .banner button {
        flex: none;
        border: 2px solid currentColor;
        background: transparent;
        color: inherit;
        border-radius: 8px;
        padding: 8px 12px;
        font: 600 13px Archivo,sans-serif;
        cursor: pointer
    }

        .banner button:focus-visible {
            outline: 3px solid var(--navy);
            outline-offset: 2px
        }

.shell {
    display: grid;
    grid-template-columns: 340px 1fr;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden
}

/* big logo, sits above the receipt */
.brandbox {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 22px
}

.brand-img {
    display: block;
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain
}

.brand-fb {
    display: none;
    width: 104px;
    height: 104px;
    place-items: center;
    border-radius: 26px;
    background: var(--navy);
    color: var(--gold);
    font: 800 56px Archivo,sans-serif
}

.brandbox.nologo .brand-fb {
    display: grid
}

/* logo used as an icon: staff list, PIN pane, lock screen */
.tile {
    flex: none;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #fff;
    border: 1.5px solid var(--line);
    color: var(--navy);
    font-weight: 800
}

    .tile img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 12%
    }

    .tile .ini {
        display: none
    }

    .tile.nologo {
        background: var(--gold);
        border-color: transparent;
        color: var(--navy)
    }

        .tile.nologo .ini {
            display: grid;
            place-items: center
        }

/* receipt */
.receipt-wrap {
    background: var(--bg);
    padding: 28px 26px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--line)
}

.receipt {
    width: 100%;
    background: var(--paper);
    color: var(--paper-ink);
    font-family: "IBM Plex Mono",ui-monospace,monospace;
    font-size: 13px;
    line-height: 1.55;
    padding: 22px 20px 40px;
    position: relative;
    animation: print .9s steps(14,end) both;
    -webkit-mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%;
    mask: conic-gradient(from -45deg at bottom,#0000,#000 1deg 89deg,#0000 90deg) 50%/14px 100%
}

@keyframes print {
    from {
        clip-path: inset(0 0 100% 0)
    }

    to {
        clip-path: inset(0 0 0 0)
    }
}

.receipt h1 {
    font-family: Archivo,sans-serif;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -.01em;
    line-height: 1.1;
    margin-bottom: 2px
}

.receipt .sub {
    color: #6b7279
}

.rule {
    border: 0;
    border-top: 1px dashed #a9aeb3;
    margin: 14px 0
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 10px
}

    .row b {
        font-weight: 500
    }

.st {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    margin-right: 6px
}

    .st.off {
        background: var(--gold)
    }

#clock {
    font-size: 30px;
    font-weight: 500;
    letter-spacing: -.02em;
    font-family: "IBM Plex Mono",monospace
}

.hint {
    margin-top: 14px;
    font-size: 12px;
    color: #6b7279
}

.q {
    display: none
}

body.off .q {
    display: flex
}

.stamp {
    display: none;
    position: absolute;
    right: 16px;
    top: 20px;
    border: 2px solid #b97d0c;
    color: #b97d0c;
    font: 600 11px "IBM Plex Mono",monospace;
    padding: 3px 8px;
    transform: rotate(-7deg);
    letter-spacing: .04em;
    background: var(--paper)
}

body.off .stamp {
    display: block
}

.sim {
    background: none;
    border: 0;
    color: var(--muted);
    font: 600 13px Archivo,sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 14px 0
}

    .sim:focus-visible {
        outline: 3px solid var(--gold);
        outline-offset: 2px
    }

/* ---------- layout: receipt | who | PIN ---------- */
.stage {
    width: min(1120px,100%)
}

.shell {
    display: grid;
    grid-template-columns: 270px minmax(0,1fr) 340px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden
}

/* who: name + list of staff */
.who {
    position: relative;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0
}

.head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px
}

.headtxt {
    min-width: 0
}

.head h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1
}

.head p {
    color: var(--muted);
    margin-top: 4px;
    font-size: 15px
}

.theme {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 14px;
    font: 600 13px Archivo,sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s,color .15s
}

@media (hover:hover) {
    .theme:hover {
        background: color-mix(in srgb,var(--ink) 7%,var(--panel));
        color: var(--ink)
    }
}

/* big avatar + lock badge: only visible on the lock screen */
.lockwrap {
    display: none;
    position: relative;
    width: 84px;
    height: 84px;
    margin-bottom: 14px
}

.lockav {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    font: 800 30px Archivo,sans-serif
}

.lockico {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 32px;
    height: 32px;
    padding: 7px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--gold);
    border: 3px solid var(--panel)
}

.pick {
    border: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0
}

.find {
    width: 100%;
    height: 48px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--key);
    color: var(--ink);
    font: 400 16px Archivo,sans-serif;
    padding: 0 14px
}

    .find:focus-visible {
        outline: 3px solid var(--gold);
        outline-offset: 2px
    }

.staff {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
    max-height: min(56vh,440px);
    overflow-y: auto;
    padding: 3px;
    margin: -3px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch
}

    .staff input {
        position: absolute;
        opacity: 0;
        pointer-events: none
    }

    .staff label {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 68px;
        padding: 8px 12px;
        border: 1.5px solid var(--line);
        border-radius: 12px;
        cursor: pointer;
        background: var(--key);
        transition: border-color .15s, background .15s;
        touch-action: manipulation
    }

    .staff .av {
        width: 46px;
        height: 46px;
        border-radius: 11px;
        font-size: 15px;
        transition: border-color .15s,box-shadow .15s
    }

    .staff .nm {
        display: block;
        font-weight: 600;
        font-size: 16px;
        line-height: 1.2;
        overflow-wrap: anywhere
    }

    .staff .rl {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 12.5px;
        color: var(--muted);
        margin-top: 2px
    }

    .staff input:checked + label {
        border-color: var(--sel);
        box-shadow: inset 0 0 0 1.5px var(--sel);
        background: color-mix(in srgb,var(--gold) 14%,var(--key))
    }

        .staff input:checked + label .av {
            border-color: var(--gold);
            box-shadow: 0 0 0 2px var(--gold)
        }

    .staff input:focus-visible + label {
        outline: 3px solid var(--gold);
        outline-offset: 2px
    }

.none {
    grid-column: 1/-1;
    color: var(--muted);
    font-size: 14px;
    padding: 14px 4px;
    line-height: 1.5
}

    .none .pwgo {
        margin-top: 14px;
        max-width: 260px
    }

/* PIN pane: always in view, next to the names */
.pinpane {
    padding: 26px 26px 22px;
    background: color-mix(in srgb,var(--ink) 4%,var(--panel));
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0
}

.pinwho {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px
}

.av-big {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font: 800 18px Archivo,sans-serif
}

.lbl {
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2
}

.rl2 {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px
}

.dots {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 6px 0 2px
}

.dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--ink);
    transition: background .1s,transform .1s
}

    .dot.on {
        background: var(--ink);
        transform: scale(1.08)
    }

.dots.bad .dot {
    border-color: var(--bad);
    background: var(--bad)
}

.dots.bad {
    animation: shake .35s
}

.dots.good .dot {
    border-color: var(--ok);
    background: var(--ok)
}

@keyframes shake {
    20%,60% {
        transform: translateX(-8px)
    }

    40%,80% {
        transform: translateX(8px)
    }
}

#msg {
    min-height: 40px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    line-height: 1.35
}

    #msg.bad {
        color: var(--bad);
        font-weight: 600
    }

    #msg.good {
        color: var(--ok);
        font-weight: 600
    }

.pad {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px
}

.k {
    height: 70px;
    border-radius: 14px;
    border: 0;
    background: color-mix(in srgb,var(--ink) 7%,var(--panel));
    color: var(--ink);
    font: 600 26px Archivo,sans-serif;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .12s,color .12s,transform .08s;
    -webkit-tap-highlight-color: transparent
}

@media (hover:hover) {
    .k:hover {
        background: color-mix(in srgb,var(--ink) 13%,var(--panel))
    }
}

.k:active {
    background: var(--accent);
    color: var(--accent-ink);
    transform: scale(.96)
}

.k:focus-visible, .theme:focus-visible, .alt button:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px
}

.k.fn {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--line)
}

@media (hover:hover) {
    .k.fn:hover {
        background: color-mix(in srgb,var(--ink) 7%,var(--panel))
    }
}

.k.go {
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 17px;
    grid-column: 1/-1;
    height: 60px;
    margin-top: 2px
}

    .k.go:active {
        transform: scale(.98);
        filter: brightness(1.12)
    }

    .k.go:disabled {
        opacity: .4;
        cursor: not-allowed
    }

.alt {
    display: flex;
    gap: 6px 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2px
}

    .alt button {
        background: none;
        border: 0;
        color: var(--ink);
        font: 600 14px Archivo,sans-serif;
        cursor: pointer;
        padding: 8px 2px;
        text-decoration: underline;
        text-decoration-color: var(--gold);
        text-decoration-thickness: 2px;
        text-underline-offset: 4px
    }

    .alt .extra {
        display: none
    }

    .alt.open .extra {
        display: inline-block
    }

    .alt #moreBtn {
        color: var(--muted)
    }

    .alt #notYou[hidden] {
        display: none
    }

/* shared primary button (admin modal + unregistered-device message) */
.pwgo {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: var(--accent-ink);
    font: 600 16px Archivo,sans-serif;
    cursor: pointer
}

    .pwgo:focus-visible {
        outline: 3px solid var(--gold);
        outline-offset: 2px
    }

    .pwgo:disabled {
        opacity: .5;
        cursor: not-allowed
    }

/* ---------- admin sign-in pop-up ---------- */
.modal {
    margin: auto;
    padding: 0;
    width: min(420px,calc(100% - 24px));
    max-height: calc(100% - 24px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: var(--ink);
    font-family: Archivo,system-ui,sans-serif;
    box-shadow: 0 24px 60px rgba(8,14,28,.45)
}

    .modal::backdrop {
        background: rgba(11,19,36,.62);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px)
    }

    .modal[open] {
        animation: pop .2s ease-out
    }

    .modal form {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 22px 22px 24px
    }

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.m-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px
}

    .m-head h3 {
        font-size: 22px;
        font-weight: 800;
        letter-spacing: -.01em;
        line-height: 1.15
    }

    .m-head p {
        color: var(--muted);
        font-size: 14px;
        line-height: 1.4;
        margin-top: 4px
    }

.m-x {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font: 400 24px/1 Archivo,sans-serif;
    cursor: pointer
}

    .m-x:focus-visible {
        outline: 3px solid var(--gold);
        outline-offset: 2px
    }

@media (hover:hover) {
    .m-x:hover {
        background: color-mix(in srgb,var(--ink) 7%,var(--panel));
        color: var(--ink)
    }
}

.m-lbl {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 6px
}

.m-msg {
    min-height: 22px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--muted)
}

    .m-msg.bad {
        color: var(--bad);
        font-weight: 600
    }

    .m-msg.good {
        color: var(--ok);
        font-weight: 600
    }

.row[hidden] {
    display: none
}

/* signed-in line prints on the receipt */
.row.signed:not([hidden]) {
    animation: print .5s steps(8,end) both;
    color: var(--ok);
    font-weight: 600
}

/* lock-screen mode: someone was already signed in on this till, so only the PIN pad is needed.
   Centered card with the logo + lock badge; the theme button tucks into the top-right corner. */
body.lockmode #pickBox {
    display: none
}

body.lockmode .who {
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 380px
}

body.lockmode .head {
    justify-content: center;
    width: 100%
}

body.lockmode .headtxt {
    display: flex;
    flex-direction: column;
    align-items: center
}

body.lockmode .lockwrap {
    display: block
}

body.lockmode .head h2 {
    font-size: clamp(26px,3.2vw,36px)
}

body.lockmode .head p {
    font-size: 16px;
    margin-top: 8px;
    max-width: 30ch;
    line-height: 1.45
}

body.lockmode .theme {
    position: absolute;
    top: 18px;
    right: 18px
}

/* not a registered till: names and keypad are hidden */
body.unreg .pinpane {
    display: none
}

body.unreg .shell {
    grid-template-columns: 270px minmax(0,1fr)
}

/* ---------- tablets (and small laptops): receipt becomes a slim strip on top ---------- */
@media (max-width:1040px) {
    .shell, body.unreg .shell {
        grid-template-columns: minmax(0,1fr) 330px
    }

    .receipt-wrap {
        grid-column: 1/-1;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 18px 20px 0;
        align-items: stretch
    }

    .brandbox {
        margin-bottom: 14px
    }

    .brand-img {
        max-height: 84px
    }

    .brand-fb {
        width: 76px;
        height: 76px;
        font-size: 40px;
        border-radius: 20px
    }

    .receipt {
        padding: 12px 18px 24px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 22px
    }

        .receipt .rule {
            display: none
        }

        .receipt h1 {
            font-size: 18px
        }

    #clock {
        font-size: 22px
    }

    .r-rows {
        display: flex;
        flex-wrap: wrap;
        gap: 2px 20px;
        margin-left: auto
    }

        .r-rows .row {
            gap: 8px
        }

    .sim {
        display: none
    }

    body.unreg .shell {
        grid-template-columns: 1fr
    }
}

/* ---------- phones ---------- */
@media (max-width:700px) {
    body {
        padding: 12px
    }

        .shell, body.unreg .shell {
            grid-template-columns: 1fr
        }

    .brand-img {
        max-height: 68px
    }

    .who {
        padding: 20px 18px 8px
    }

    body.lockmode .who {
        min-height: 0;
        padding-top: 56px
    }

    .pinpane {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 20px 18px 22px
    }

    .pad {
        max-width: 360px;
        width: 100%;
        margin: 0 auto
    }

    .staff {
        grid-template-columns: 1fr;
        max-height: 250px
    }

    .r-rows {
        margin-left: 0
    }

    .banner {
        flex-wrap: wrap
    }

    #msg {
        min-height: 22px
    }
}

.roll {
    display: block;
    height: 1.5em;
    line-height: 1.5em;
    overflow: hidden
}

    .roll > span {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        height: 1.5em;
        transition: transform .35s cubic-bezier(.6,0,.2,1)
    }

.go.busy .roll > span {
    transform: translateY(-100%)
}

.k.go.busy:disabled {
    opacity: 1;
    cursor: progress
}

.spin {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    animation: rot .7s linear infinite
}

@keyframes rot {
    to {
        transform: rotate(360deg)
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important
    }
}
