/* ===================== NutreMais — Paciente (Design System "Linho Claro") ===================== */
:root {
    --bg: #f1ece3;
    --bg2: #f9f5ee;
    --panel: #ffffff;
    --panelBd: #e7ddcf;
    --line: #ebe3d6;
    --text: #261d12;
    --dim: #6e6253;
    --faint: #9c907f;
    --accent: #1f9a63;
    --accentInk: #ffffff;
    --accentSoft: rgba(31,154,99,.14);
    --accentDeep: #16734a;
    --danger: #c0392b;
    --radius: 20px;
    --shadow: 0 12px 30px rgba(60,45,25,.10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Hanken Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* marca (losango verde) — espelha o desktop */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-logo { width: 36px; height: 36px; background: url('../nutremais-mark.png') center/contain no-repeat; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-logo > i { display: none; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.brand-sub { font-size: 9.5px; font-weight: 700; color: var(--faint); letter-spacing: .16em; text-transform: uppercase; margin-top: 5px; }

/* ---------- Boot / loading ---------- */
.boot {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: radial-gradient(120% 95% at 50% 0%, #f8f2e8 0%, #efe7d9 58%, #e7dcc8 100%);
    color: var(--text);
}
.boot-logo { width: 72px; height: 72px; background: url('../nutremais-mark.png') center/contain no-repeat; display: flex; align-items: center; justify-content: center; }
.boot-diamond { display: none; }
.boot-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.boot-sub { font-size: 10px; font-weight: 700; color: var(--faint); letter-spacing: .16em; text-transform: uppercase; }
.boot-spinner {
    width: 32px; height: 32px; margin-top: 10px;
    border: 3px solid rgba(38,29,18,.14);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Shared screen layout (mobile-first) ---------- */
.screen {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero {
    background: radial-gradient(130% 100% at 50% 0%, #f8f2e8 0%, #efe7d9 60%, #e7dcc8 100%);
    color: var(--text);
    padding: 36px 24px 52px;
    border-bottom: 1px solid var(--line);
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    position: relative;
}
.hero h1 { font-size: 26px; font-weight: 800; margin-top: 24px; }
.hero p { margin-top: 8px; color: var(--dim); font-size: 15px; font-weight: 500; }

.bed-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--panel);
    border: 1px solid var(--panelBd);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: var(--dim);
    margin-top: 18px;
}
.bed-pill .bed-code { font-family: 'JetBrains Mono'; color: var(--text); }

.body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-float { margin-top: -36px; }

/* ---------- Form ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }

.input {
    width: 100%;
    padding: 15px 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    background: var(--bg2);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accentSoft); }

.otp-input {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 14px;
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    padding-left: 14px;
}

.btn {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .08s, opacity .15s, background .15s;
    font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accentInk); box-shadow: 0 8px 18px var(--accentSoft); }
.btn-primary:hover { background: var(--accentDeep); }
.btn-primary:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--accent); box-shadow: none; }
.btn-ghost:disabled { opacity: .55; cursor: default; }
.btn-danger { background: var(--danger); color: #fff; box-shadow: none; }
.btn-danger:hover { filter: brightness(.94); }
.btn-danger:disabled { opacity: .6; cursor: default; }

.panel {
    background: var(--panel);
    border: 1px solid var(--panelBd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.panel h2 { font-size: 20px; font-weight: 800; }
.panel .sub { color: var(--dim); font-size: 14px; font-weight: 500; margin-top: -8px; }

.alert {
    background: #fbeceb;
    color: var(--danger);
    border: 1px solid #f0cfca;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
}
.muted-link { color: var(--dim); font-size: 14px; font-weight: 600; text-align: center; background: none; border: 0; cursor: pointer; font-family: inherit; }

/* ---------- Menu ---------- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px;
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.topbar .bed { font-size: 13px; color: var(--dim); font-weight: 700; display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 1px solid var(--panelBd); padding: 6px 12px; border-radius: 999px; }
.topbar .bed .bed-code { font-family: 'JetBrains Mono'; color: var(--text); }

.menu-head { padding: 22px 24px 6px; }
.menu-head h1 { font-size: 23px; font-weight: 800; }
.menu-head p { color: var(--dim); margin-top: 5px; font-size: 14px; font-weight: 500; }

.dish-list { padding: 16px 24px 110px; display: flex; flex-direction: column; gap: 16px; }

.dish {
    background: var(--panel);
    border: 1px solid var(--panelBd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.dish-photo {
    height: 150px;
    background:
        repeating-linear-gradient(45deg, rgba(38,29,18,.05) 0 8px, rgba(38,29,18,.015) 8px 16px),
        linear-gradient(135deg, #efe7d9, #e7dcc8);
    display: flex; align-items: center; justify-content: center;
}
.dish-photo .ph { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--panelBd); background: var(--bg2); display: flex; align-items: center; justify-content: center; }
.dish-photo .ph > i { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); transform: rotate(45deg); display: block; opacity: .5; }
.dish-photo img { width: 100%; height: 100%; object-fit: cover; }
.dish-info { padding: 16px 18px; display: flex; flex-direction: column; gap: 11px; }
.dish-info h3 { font-size: 18px; font-weight: 800; }
.dish-info .desc { color: var(--dim); font-size: 14px; font-weight: 500; line-height: 1.45; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
    background: var(--bg2);
    border: 1px solid var(--line);
    color: var(--dim);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
}

/* meta: tempo de preparo + consistência */
.dish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dish-meta .prep { font-size: 13px; font-weight: 700; color: var(--dim); }
.cons-badge {
    font-size: 12px; font-weight: 700; color: var(--dim);
    background: var(--bg2); border: 1px solid var(--line);
    padding: 4px 10px; border-radius: 999px;
}

/* alérgenos: "Contém …" em âmbar discreto (atenção, não alarme) */
.contains { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.contains-label {
    font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--faint);
}
.contains-badge {
    font-size: 12px; font-weight: 700; color: #8a5a16;
    background: #fdf0d8; border: 1px solid #ecd3a0;
    padding: 4px 10px; border-radius: 8px;
}

.dish .btn { margin-top: 4px; }

.center-state {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; color: var(--dim); padding: 60px 24px; text-align: center; font-weight: 600;
}
.center-state .spinner {
    width: 34px; height: 34px;
    border: 3px solid var(--line); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .8s linear infinite;
}
.center-state .ph-big { width: 64px; height: 64px; border-radius: 18px; background: var(--panel); border: 1px solid var(--panelBd); display: flex; align-items: center; justify-content: center; }
.center-state .ph-big > i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); transform: rotate(45deg); display: block; opacity: .5; }

/* ---------- Confirmation ---------- */
.confirm {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 32px 28px; gap: 14px;
}
.check {
    width: 96px; height: 96px; border-radius: 50%;
    background: var(--accentSoft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 50px; font-weight: 800; margin-bottom: 6px;
    animation: pop .4s ease;
}
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.1); } 100% { transform: scale(1); } }
.confirm h1 { font-size: 24px; font-weight: 800; }
.confirm p { color: var(--dim); font-size: 15px; font-weight: 500; line-height: 1.5; }
.confirm .order-card {
    background: var(--panel); border: 1px solid var(--panelBd); border-radius: 16px; box-shadow: var(--shadow);
    padding: 18px 20px; width: 100%; margin-top: 8px;
    display: flex; justify-content: space-between; align-items: center;
}
.confirm .order-card .name { font-weight: 800; }
.confirm .badge {
    background: #fdf0d8; color: #8a5a16; border: 1px solid #ecd3a0; font-weight: 800;
    font-size: 12px; padding: 5px 12px; border-radius: 999px;
}
.confirm .actions { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.check.check-cancel { background: #fbe3e0; color: #b23b2e; }

/* ---------- Live order timeline ---------- */
.timeline {
    list-style: none; margin: 18px 0 4px; padding: 0; width: 100%;
    display: flex; flex-direction: column; gap: 0;
}
.tl-step {
    position: relative; display: flex; align-items: center; gap: 14px;
    padding: 0 0 22px 0; text-align: left;
}
.tl-step:last-child { padding-bottom: 0; }
/* linha vertical conectando os passos */
.tl-step:not(:last-child)::before {
    content: ""; position: absolute; left: 10px; top: 22px; bottom: 0;
    width: 2px; background: var(--line);
}
.tl-step.done:not(:last-child)::before { background: var(--accent); }
.tl-dot {
    width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; z-index: 1;
    border: 2px solid var(--line); background: var(--bg2); transition: all .25s ease;
}
.tl-label { font-size: 14px; font-weight: 600; color: var(--dim); }
.tl-step.done .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl-step.done .tl-label { color: var(--text); }
.tl-step.current .tl-dot {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accentSoft); animation: tlpulse 1.6s ease-in-out infinite;
}
.tl-step.current .tl-label { color: var(--text); font-weight: 800; }
@keyframes tlpulse { 0%,100% { box-shadow: 0 0 0 4px var(--accentSoft); } 50% { box-shadow: 0 0 0 8px var(--accentSoft); } }
.hub-state { color: var(--dim); font-size: 12px; opacity: .8; margin-top: 4px; }

/* ---------- Cancelar pedido (confirmação) ---------- */
.cancel-confirm {
    display: flex; flex-direction: column; gap: 10px; width: 100%;
    padding: 14px 16px; border-radius: 14px;
    background: #fbeceb; border: 1px solid #f0cfca;
}
.cancel-confirm > span { font-size: 14px; font-weight: 700; color: var(--danger); text-align: center; }
.cancel-confirm-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- "Pedido em andamento" banner (cardápio) ---------- */
.track-banner {
    display: flex; align-items: center; gap: 12px; width: 100%;
    margin: 14px 0 2px; padding: 13px 16px; cursor: pointer;
    background: var(--accentSoft); border: 1px solid var(--accent); border-radius: 14px;
    font-family: inherit; text-align: left; color: var(--text);
}
.track-banner .track-pulse {
    width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; background: var(--accent);
    box-shadow: 0 0 0 0 var(--accentSoft); animation: tlpulse 1.6s ease-in-out infinite;
}
.track-banner .track-text { flex: 1; font-size: 13px; font-weight: 600; color: var(--dim); display: flex; flex-direction: column; gap: 2px; }
.track-banner .track-text strong { color: var(--text); font-size: 14px; font-weight: 800; }
.track-banner .track-go { font-size: 13px; font-weight: 800; color: var(--accentDeep); flex: 0 0 auto; }

/* ---------- Blazor error UI ---------- */
#blazor-error-ui {
    color-scheme: light only;
    background: #fdf0d8;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 0.8rem 1.4rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-weight: 600;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
