/* =====================================================================
   Rango — tokens e componentes (mesma família visual do Zela, paleta
   verde-horta + manga). Usado pelo tablet e pelo painel.
   ===================================================================== */
:root {
  --noite: #0B2B22; --noite-2: #113A2E; --noite-3: #1B4F3F;
  --verde-m: #12875A; --verde-m-esc: #0B6B45; --verde-m-claro: #E3F5EC;
  --verde: #1DB980; --verde-claro: #E3F7EF;
  --vermelho: #E5383B; --vermelho-claro: #FDECEC;
  --amarelo: #FFB020; --azul: #2E8BFF; --azul-claro: #E8F2FF;
  --fundo: #F6F4EC; --superficie: #FFFFFF; --superficie-2: #FBFAF5;
  --texto: #0B2B22; --texto-2: #57695F; --borda: #E5E3D8;
  --sombra: 0 1px 2px rgba(11,43,34,.06), 0 8px 24px rgba(11,43,34,.08);
  --raio: 18px; --raio-p: 12px;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --mola: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #071C16; --superficie: #0D2A21; --superficie-2: #12342A;
    --texto: #E9F3EE; --texto-2: #9BB5A9; --borda: #1E4537;
    --verde-m-claro: #10352A; --verde-claro: #12352A; --vermelho-claro: #3A1A1D; --azul-claro: #14294A;
    --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--fundo); color: var(--texto);
  font: 16px/1.45 var(--fonte); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app { min-height: 100dvh; outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
       stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; }
.suave { color: var(--texto-2); }
.pequeno { font-size: .875rem; }
.centro { text-align: center; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.quebra { white-space: pre-wrap; overflow-wrap: anywhere; }
.oculto { display: none !important; }
.txt-risco { color: var(--vermelho); font-weight: 700; }
small { font-size: .8rem; }
:focus-visible { outline: 3px solid var(--verde-m); outline-offset: 2px; border-radius: 6px; }

/* ---------- telas ---------- */
.tela { padding: 16px 16px calc(110px + env(safe-area-inset-bottom)); animation: tela-entra .35s ease backwards; }
.tela.novo { padding-bottom: 0; }
.tela.centro { min-height: 80dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
@keyframes tela-entra { from { opacity: 0; transform: translateY(8px); } }

.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
          padding: 18px; box-shadow: var(--sombra); margin-bottom: 14px; }
.cartao h2 { display: flex; align-items: center; gap: 8px; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--verde-m); color: #fff; font-weight: 700; text-decoration: none;
  box-shadow: 0 6px 16px rgba(18,135,90,.35); transition: transform .15s var(--mola), box-shadow .2s, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn.grande { width: 100%; min-height: 54px; font-size: 1.05rem; }
.btn.sec { background: var(--superficie-2); color: var(--texto); border: 1px solid var(--borda); box-shadow: none; }
.btn.claro { background: #fff; color: var(--noite); }
.btn.mini { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; white-space: nowrap; }
.btn.carregando { color: transparent; position: relative; pointer-events: none; }
.btn.carregando::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; animation: girar .7s linear infinite; }
.link { background: none; border: 0; padding: 10px 4px; color: var(--verde-m-esc); font-weight: 600; cursor: pointer;
        display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
@media (prefers-color-scheme: dark) { .link { color: var(--verde-m); } }
.icone-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; flex: none;
  border: 1px solid var(--borda); background: var(--superficie); cursor: pointer; text-decoration: none; transition: transform .15s var(--mola); }
.icone-btn:active { transform: scale(.9); }
.icone-btn.primario { background: var(--verde-m); color: #fff; border: 0; }

/* ---------- campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rotulo { font-weight: 600; font-size: .9rem; }
.dica { color: var(--texto-2); font-size: .78rem; }
input:not([type=checkbox]):not([type=range]):not([type=file]), textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--raio-p);
  border: 1.5px solid var(--borda); background: var(--superficie-2); transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
input:focus, textarea:focus { outline: none; border-color: var(--verde-m); box-shadow: 0 0 0 4px rgba(18,135,90,.18); }
input.pin { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-family: var(--mono); }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--verde-m); flex: none; margin-top: 2px; }
.erro { color: var(--vermelho); font-weight: 600; min-height: 1.2em; margin: 8px 0 0; text-align: center; }
.erro:empty { display: none; }
.campo-ico { position: relative; }
.campo-ico > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-2); }
.campo-ico input { padding-left: 44px !important; }

/* ---------- avisos ---------- */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--raio-p);
         background: var(--superficie-2); margin: 10px 0; font-size: .92rem; }
.aviso > .ico { margin-top: 2px; }
.aviso.info { background: var(--azul-claro); }
.aviso.info > .ico { color: var(--azul); }
.aviso.perigo { background: var(--vermelho-claro); color: var(--texto); border: 1px solid rgba(229,56,59,.35); }
.aviso.perigo > .ico { color: var(--vermelho); }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: .75rem;
        font-weight: 700; white-space: nowrap; background: var(--superficie-2); border: 1px solid var(--borda); }
.st-aberto { background: var(--verde-m-claro); color: var(--verde-m-esc); border-color: transparent; }
.st-andamento { background: var(--azul-claro); color: var(--azul); border-color: transparent; }
.st-aguardando { background: #FFF6DB; color: #9A6B00; border-color: transparent; }
.st-concluido { background: var(--verde); color: #fff; border-color: transparent; animation: pulsar 2s ease-in-out infinite; }
.st-fechado { background: var(--verde-claro); color: #12895F; border-color: transparent; }
.st-cancelado { color: var(--texto-2); }
.chip.risco { background: var(--vermelho); color: #fff; border-color: transparent; }
.chip .ico { width: 1em; height: 1em; }
@media (prefers-color-scheme: dark) {
  .st-aberto { color: #FFB27A; } .st-aguardando { background: #3A3010; color: #FFD15C; } .st-fechado { color: #5FE0B0; }
}
@keyframes pulsar { 50% { box-shadow: 0 0 0 6px rgba(29,185,128,.18); } }

/* ---------- mascote ---------- */
.mascote { width: 72px; height: auto; aspect-ratio: 200 / 220; flex: none; overflow: visible; }
.mascote.m-pequeno { width: 54px; }
.mascote.m-media { width: 80px; }
.mascote.m-grande { width: 140px; }
.mascote .m-corpo, .mascote .m-capacete { animation: flutuar 3.2s ease-in-out infinite; transform-origin: 100px 200px; }
.mascote .m-braco { transform-origin: 146px 150px; }
.mascote.humor-oi .m-braco { animation: acenar 1.6s ease-in-out 2; }
.mascote .m-olho { animation: piscar 4.5s infinite; transform-origin: center; transform-box: fill-box; }
.mascote.pular .m-corpo, .mascote.pular .m-capacete { animation: pular .7s var(--mola) 3; }
@keyframes flutuar { 50% { transform: translateY(-4px); } }
@keyframes acenar { 25% { transform: rotate(-18deg); } 75% { transform: rotate(10deg); } }
@keyframes piscar { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes pular { 40% { transform: translateY(-18px) scale(1.04); } }

.fala { display: flex; align-items: center; gap: 12px; margin: 6px 0 16px; }
.balao { position: relative; margin: 0; background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px;
         padding: 12px 14px; font-weight: 600; box-shadow: var(--sombra); animation: balao .5s var(--mola) both .15s; }
.balao::before { content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; background: inherit;
                 border-left: 1px solid var(--borda); border-bottom: 1px solid var(--borda); transform: translateY(-50%) rotate(45deg); }
.fala.compacta .balao { font-size: .9rem; font-weight: 500; }
@keyframes balao { from { opacity: 0; transform: scale(.8) translateX(-10px); } }

/* ---------- entrar ---------- */
.entrar { padding-top: 24px; }
.entrar-hero { text-align: center; display: flex; flex-direction: column; align-items: center; margin-bottom: 18px; }
.marca-tag { color: var(--verde-m-esc); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin: 8px 0 0; }
.marca { font-size: 3.2rem; font-weight: 900; margin: 0; letter-spacing: -.04em;
         background: linear-gradient(120deg, var(--verde-m), #FFB020); -webkit-background-clip: text; background-clip: text; color: transparent; }
.entrar-slogan { color: var(--texto-2); max-width: 22em; }
.segmento { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--superficie-2); border-radius: 14px;
            padding: 4px; margin-bottom: 18px; border: 1px solid var(--borda); }
.segmento:empty { display: none; }
.segmento button { border: 0; background: none; min-height: 42px; border-radius: 11px; font-weight: 700; color: var(--texto-2); cursor: pointer; transition: background .2s, color .2s; }
.segmento button.ativo { background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.entrar-form form { display: flex; flex-direction: column; }
.entrar-form .link { align-self: center; margin-top: 8px; }
.rodape-seg { display: flex; gap: 6px; justify-content: center; align-items: center; color: var(--texto-2); font-size: .8rem; text-align: center; }
.tremer { animation: tremer .45s; }
@keyframes tremer { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.cabeca-simples { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.cabeca-simples h1 { margin: 0; }
.texto-legal ul { padding-left: 1.2em; } .texto-legal li { margin-bottom: 6px; }

/* ---------- folha (bottom sheet) ---------- */
.folha-fundo { position: fixed; inset: 0; background: rgba(5,10,20,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center;
               animation: aparecer .2s ease both; backdrop-filter: blur(2px); }
.folha-fundo.sair { animation: sumir .2s ease both; }
.folha { width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; background: var(--superficie); border-radius: 24px 24px 0 0;
         padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); animation: subir .3s cubic-bezier(.2,.9,.3,1.1) both; }
.folha-fundo.sair .folha { animation: descer .2s ease both; }
.folha-alca { width: 44px; height: 5px; border-radius: 99px; background: var(--borda); margin: 0 auto 14px; }
.folha-titulo { font-size: 1.1rem; }
@keyframes aparecer { from { opacity: 0; } } @keyframes sumir { to { opacity: 0; } }
@keyframes subir { from { transform: translateY(100%); } } @keyframes descer { to { transform: translateY(100%); } }
.lista-itens { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border: 0; border-bottom: 1px solid var(--borda); background: none;
        text-align: left; cursor: pointer; font-weight: 600; }
.item.perigo { color: var(--vermelho); border-bottom: 0; }
.perfil-cab { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--borda); }
.perfil-cab > div:last-child { display: flex; flex-direction: column; }
.dica-ios { display: flex; gap: 10px; padding: 12px 6px; color: var(--texto-2); font-size: .9rem; margin: 0; border-bottom: 1px solid var(--borda); }
.pilha { display: flex; flex-direction: column; gap: 12px; }
.ampliada { width: 100%; border-radius: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top)); z-index: 80; display: flex; flex-direction: column;
          align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; gap: 10px; align-items: center; max-width: 480px; padding: 12px 16px; border-radius: 14px; background: var(--noite); color: #fff;
         box-shadow: 0 12px 30px rgba(0,0,0,.25); font-weight: 600; font-size: .92rem; animation: toast-in .35s var(--mola) both; }
.toast.ok .ico { color: var(--verde); } .toast.erro { background: var(--vermelho); } .toast.info .ico { color: var(--amarelo); }
.toast.sair { animation: toast-out .4s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-16px); } }
.offline { position: sticky; top: 0; z-index: 60; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px 12px;
           background: var(--amarelo); color: var(--noite); font-weight: 700; font-size: .85rem; }

/* ---------- confete ---------- */
.confete { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confete i { position: absolute; top: -20px; left: var(--x); width: 9px; height: 14px; background: var(--c); border-radius: 2px;
             animation: cair var(--t) cubic-bezier(.25,.6,.4,1) var(--d) both; }
.confete i:nth-child(3n) { border-radius: 50%; width: 10px; height: 10px; }
@keyframes cair { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .9; } }
