/* Entrada do ChefOS (e telas irmãs: esqueci a senha, senha nova, teste grátis).
   Acesso à esquerda, em superfície neutra; à direita o "passe": campo chapado na cor Brasa, um trilho de aço e as comandas em papel térmico. */
:root {
    --font-sans: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-cupom: 'Cascadia Mono', Consolas, 'SF Mono', Menlo, 'Roboto Mono', monospace;
    --accent: #c2410c;
    --accent-hover: #9a3412;
    --coluna: clamp(400px, 34vw, 540px);
    --tinta: #1a1d23;
    --tinta-suave: #555b66;
}

:root[data-theme="dark"] {
    --bg: #0f1115;
    --surface: #14171c;
    --text: #eceef1;
    --text-soft: #b9c0c9;
    --muted: #8f98a4;
    --line: #2a313b;
    --field: #0f1115;
    --field-line: #414a57;
    --warn: #f0b429;
    --danger: #f2788a;
    --ok: #4cc38a;
    --campo: #8a2f0f;
    --trilho: #14171c;
    --papel: #ebe8e1;
}

:root[data-theme="light"] {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --text: #1a1d23;
    --text-soft: #424a56;
    --muted: #5f6874;
    --line: #dde1e7;
    --field: #ffffff;
    --field-line: #aeb6c1;
    --warn: #8a5200;
    --danger: #b4162f;
    --ok: #12704a;
    --campo: #c2410c;
    --trilho: #1a1d23;
    --papel: #fffdf8;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Idioma e tema ---------- */
.ajustes {
    position: fixed;
    top: 16px;
    right: calc(100% - var(--coluna) + 16px);
    z-index: 10;
    display: flex;
    gap: 8px;
}

.ajustes .idioma-fixo {
    position: relative;
    top: auto;
    right: auto;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-soft);
    font: 500 0.8rem var(--font-sans);
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--field-line);
    color: var(--text);
}

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon {
    display: none;
}

/* ---------- Estrutura ---------- */
.stage {
    display: grid;
    grid-template-columns: var(--coluna) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
}

.access {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 72px clamp(24px, 4vw, 64px) 32px;
}

.access-inner {
    width: 100%;
    max-width: 380px;
    margin: auto;
}

.brand {
    margin-bottom: 40px;
}

.brand-logo {
    display: block;
    width: auto;
    height: 44px;
    margin-left: -3px;
    color: var(--text);
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.subtitle {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ---------- Avisos ---------- */
.system-ws-alert {
    --tom: var(--accent);
    margin-top: 20px;
    padding: 12px 16px;
    border: 1px solid var(--tom);
    border-radius: 8px;
    background: var(--surface);
    background: color-mix(in srgb, var(--tom) 10%, var(--surface));
    color: var(--text);
    font-size: 0.875rem;
    line-height: 1.45;
}

.system-ws-alert[data-ws-type="accept"] {
    --tom: var(--ok);
}

.system-ws-alert[data-ws-type="alert"] {
    --tom: var(--warn);
}

.system-ws-alert[data-ws-type="error"] {
    --tom: var(--danger);
}

/* ---------- Formulário ---------- */
.form {
    display: grid;
    gap: 20px;
    margin-top: 32px;
}

.field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 600;
}

.caps-warning {
    color: var(--warn);
    font-size: 0.78rem;
}

.field-wrap {
    position: relative;
}

.field-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--field-line);
    border-radius: 8px;
    background: var(--field);
    color: var(--text);
    font: 400 1rem var(--font-sans);
}

.field-input::placeholder {
    color: var(--muted);
}

.field-input:hover {
    border-color: var(--muted);
}

.field-input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
}

.field-input.has-toggle {
    padding-right: 48px;
}

.btn-eye {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.btn-eye:hover {
    color: var(--text);
}

.btn-eye .icon-hide,
.btn-eye[aria-pressed="true"] .icon-show {
    display: none;
}

.btn-eye[aria-pressed="true"] .icon-hide {
    display: block;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: 600 1rem var(--font-sans);
    cursor: pointer;
}

.btn-submit:hover,
.btn-submit[aria-busy="true"] {
    background: var(--accent-hover);
}

.btn-submit[aria-busy="true"] {
    cursor: progress;
}

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

.btn-submit[aria-busy="true"] .spinner {
    display: block;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

.legal {
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

.legal a {
    color: var(--text-soft);
    font-weight: 500;
    text-underline-offset: 3px;
}

.legal a:hover {
    color: var(--text);
}

.assinatura {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 0.76rem;
}

.assinatura strong {
    color: var(--text-soft);
    font-weight: 600;
}

.assinatura a {
    white-space: nowrap;
}

/* ---------- Apresentação (campo Brasa) ---------- */
.showcase {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 48px clamp(32px, 6vw, 96px);
    background: var(--campo);
    color: #fff;
}

.showcase :focus-visible {
    outline-color: #fff;
}

.showcase-inner {
    width: 100%;
    max-width: 640px;
}

.eyebrow {
    color: #ffe3d3;
    font-size: 0.9rem;
    font-weight: 600;
}

.headline {
    max-width: 18ch;
    margin-top: 8px;
    font-size: clamp(2rem, 3.3vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    text-wrap: balance;
}

.lede {
    max-width: 56ch;
    margin-top: 16px;
    color: #ffeade;
    font-size: 1rem;
}

/* Lista de benefícios das telas irmãs (teste grátis) */
.benefits {
    display: grid;
    gap: 20px;
    margin-top: 32px;
    padding: 0;
    list-style: none;
}

.benefits li {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 16px;
    align-items: start;
}

.b-icon {
    box-sizing: content-box;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
}

.benefits b {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

.benefits span {
    color: #ffeade;
    font-size: 0.875rem;
}

/* ---------- O passe (só na entrada) ---------- */
.showcase-passe {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 32px;
    padding: 0 clamp(28px, 4vw, 72px) 40px;
}

/* o trilho de aço atravessa o campo inteiro */
.showcase-passe::before {
    content: '';
    position: absolute;
    top: 40px;
    right: 0;
    left: 0;
    height: 16px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.28);
    background: var(--trilho);
}

.passe {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2.2vw, 36px);
    width: 100%;
    max-width: 960px;
    margin: auto 0;
    padding: 56px 0 0;
    list-style: none;
}

.estacao {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: 24px;
}

.comanda {
    position: relative;
    align-self: start;
    animation: imprimir 0.7s steps(14, end) both;
}

/* o prendedor que segura a folha no trilho */
.comanda::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    z-index: 1;
    width: 44px;
    height: 32px;
    border-radius: 3px;
    background: var(--trilho);
    transform: translateX(-50%);
}

.estacao-cozinha .comanda {
    animation-delay: 0.45s;
}

.estacao-caixa .comanda {
    animation-delay: 0.9s;
}

.ja-impresso .comanda {
    animation: none;
}

@keyframes imprimir {
    from {
        clip-path: inset(-24px 0 100% 0);
    }

    to {
        clip-path: inset(-24px 0 0 0);
    }
}

/* papel térmico com a borda serrilhada de baixo */
.folha {
    padding: 20px 14px 26px;
    background: var(--papel);
    color: var(--tinta);
    font: 400 0.8rem/1.45 var(--font-cupom);
    font-variant-numeric: tabular-nums;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 95% 100%, 90% calc(100% - 8px), 85% 100%, 80% calc(100% - 8px), 75% 100%, 70% calc(100% - 8px), 65% 100%, 60% calc(100% - 8px), 55% 100%, 50% calc(100% - 8px), 45% 100%, 40% calc(100% - 8px), 35% 100%, 30% calc(100% - 8px), 25% 100%, 20% calc(100% - 8px), 15% 100%, 10% calc(100% - 8px), 5% 100%, 0 calc(100% - 8px));
}

.folha-topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #8d9099;
}

.folha-exemplo {
    color: var(--tinta-suave);
    font-size: 0.72rem;
}

.folha-mesa {
    display: grid;
    gap: 2px;
    padding: 12px 0 10px;
}

.folha-mesa b {
    font-size: 1.35rem;
    line-height: 1.15;
}

.folha-mesa span {
    color: var(--tinta-suave);
}

.folha-itens {
    display: grid;
    gap: 8px;
    padding: 12px 0;
    border-block: 1px dashed #8d9099;
    list-style: none;
}

.folha-itens li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 8px;
}

.folha-itens li b {
    margin-left: auto;
    font-weight: 400;
    white-space: nowrap;
}

.itens-cozinha {
    font-size: 0.9rem;
    font-weight: 700;
}

.folha-situacao {
    margin-top: 12px;
    padding: 6px 8px;
    background: var(--tinta);
    color: var(--papel);
    font-weight: 700;
    text-align: center;
}

.folha-total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0 8px;
    padding-top: 12px;
    font-weight: 700;
}

.folha-total b {
    font-size: 1.35rem;
    white-space: nowrap;
}

.mesas {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-top: 12px;
}

.mesa {
    display: grid;
    gap: 2px;
    padding: 7px 4px;
    border: 1px solid var(--tinta);
    border-radius: 3px;
    text-align: center;
}

.mesa b {
    font-size: 0.9rem;
}

.mesa span {
    font-size: 0.68rem;
    white-space: nowrap;
}

.mesa.is-free {
    border: 1px dashed #8d9099;
    color: var(--tinta-suave);
}

.mesa.is-bill {
    border: 3px double var(--tinta);
    padding: 5px 2px;
    font-weight: 700;
}

.mesa.is-destaque {
    border-color: #c2410c;
    background: #c2410c;
    color: #fff;
}

.beneficio b {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.beneficio span {
    display: block;
    margin-top: 4px;
    color: #ffeade;
    font-size: 0.84rem;
    line-height: 1.45;
}

.chamada {
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.showcase-passe .headline {
    max-width: 22ch;
}

.integrations {
    margin-top: 16px;
    color: #fff;
    font-size: 0.84rem;
}

.integrations span {
    margin-right: 6px;
    color: #ffe3d3;
}

/* ---------- Responsivo ---------- */
/* Telas baixas: o passe encolhe para caber sem rolagem */
@media (min-width: 901px) and (max-height: 880px) {
    .showcase-passe {
        gap: 20px;
        padding-bottom: 24px;
    }

    .passe {
        padding-top: 52px;
    }

    .estacao {
        row-gap: 16px;
    }

    .beneficio span,
    .integrations {
        display: none;
    }

    .chamada {
        padding-top: 20px;
    }

    .showcase-passe .headline {
        font-size: clamp(1.6rem, 2.4vw, 2.25rem);
    }
}

@media (min-width: 901px) and (max-height: 720px) {
    .beneficio,
    .showcase-passe .lede,
    .showcase-passe .eyebrow {
        display: none;
    }

    .folha {
        padding-top: 16px;
        font-size: 0.74rem;
    }

    .mesa {
        padding-block: 3px;
    }

    .access {
        padding-block: 60px 20px;
    }

    .brand,
    .form {
        margin-block: 0 20px;
    }

    .form {
        margin-top: 20px;
    }
}

@media (min-width: 901px) and (max-height: 580px) {
    .passe {
        display: none;
    }

    .showcase-passe {
        justify-content: flex-end;
    }
}

/* Largura média: duas comandas (cozinha e caixa) para nada ficar apertado */
@media (min-width: 901px) and (max-width: 1180px) {
    .passe {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .estacao-salao {
        display: none;
    }
}

@media (max-width: 900px) {
    body {
        height: auto;
        min-height: 100dvh;
        overflow: auto;
    }

    .stage {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        height: auto;
        min-height: 100dvh;
    }

    .showcase {
        display: none;
    }

    .ajustes {
        right: 16px;
        top: 22px;
    }

    /* no celular fica o trilho, na cor da casa */
    .access {
        overflow: visible;
        padding: 88px 20px 32px;
        border-top: 6px solid var(--accent);
    }

    .access-inner {
        margin: 0 auto;
    }
}

@media (max-width: 420px) {
    .brand {
        margin-bottom: 28px;
    }
}

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

    .spinner {
        animation-duration: 2s;
    }
}
