/* ============================================================
   index.css — Quiosque de Avaliação · Refeitório Tia Sônia
   ============================================================ */

/* ---- 1. Variáveis ----------------------------------------- */
:root {
  --azul:         #1a50b8;
  --azul-escuro:  #0e3585;
  --azul-claro:   #e8eef9;
  --amarelo:      #f5c22a;
  --amarelo-claro:#fefbea;
  --texto:        #111827;
  --cinza:        #6b7280;
  --card:         #ffffff;
  --linha:        #e5e9f0;
}

/* ---- 2. Reset & base --------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: linear-gradient(160deg, #edf2fb 0%, #e3ecfa 100%);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- 3. Layout principal ----------------------------------- */
#quiosque {
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}

.wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - max(20px, env(safe-area-inset-left)) - max(20px, env(safe-area-inset-right)));
  max-width: 780px;
  transition: transform .15s ease;
  transform: translate(-50%, -50%);
}

/* ---- 4. Card ---------------------------------------------- */
.card {
  background: var(--card);
  border-radius: 24px;
  padding:
    clamp(20px, 4vw, 36px)
    clamp(16px, 4vw, 32px)
    clamp(18px, 3vw, 28px);
  box-shadow: 0 1px 2px rgba(26, 80, 184, .06), 0 24px 50px rgba(26, 80, 184, .14);
}

/* ---- 5. Cabeçalho ------------------------------------------ */
.topo {
  text-align: center;
  margin-bottom: clamp(16px, 2.8vw, 24px);
}

.logo {
  height: clamp(34px, 5.5vw, 50px);
  width: auto;
  display: block;
  margin: 0 auto;
}


.topo h1 {
  font-size: clamp(17px, 2.8vw, 23px);
  color: var(--azul);
  font-weight: 800;
  line-height: 1.2;
}

.topo p {
  font-size: clamp(12px, 1.5vw, 14px);
  color: var(--cinza);
  margin-top: 5px;
}

/* ---- 6. Grade de métricas ---------------------------------- */
.grade {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 2vw, 14px);
}

@media (min-width: 768px) {
  .grade {
    grid-template-columns: 1fr 1fr;
  }
}

.metrica {
  border: 1.5px solid var(--linha);
  border-radius: 18px;
  padding:
    clamp(14px, 2.5vw, 20px)
    clamp(14px, 2.5vw, 20px)
    clamp(14px, 2vw, 18px);
  background: #fcfdff;
  box-shadow: 0 2px 10px rgba(15, 35, 90, .05);
  transition: border-color .2s, background .2s, box-shadow .2s, transform .2s;
  cursor: pointer;
}

@media (hover: hover) {
  .metrica:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 35, 90, .09);
  }
}

.metrica.preenchida {
  border-color: var(--amarelo);
  background: var(--amarelo-claro);
  box-shadow: 0 6px 18px rgba(245, 194, 42, .18);
}

.metrica .nome {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: clamp(14px, 2vw, 16px);
}

.metrica .ic {
  width: clamp(20px, 2.8vw, 26px);
  height: clamp(20px, 2.8vw, 26px);
  color: var(--azul);
  flex-shrink: 0;
}

.metrica .sub {
  font-size: clamp(12px, 1.5vw, 13px);
  color: var(--cinza);
  margin: 3px 0 clamp(10px, 2vw, 14px) 36px;
}

/* ---- 7. Estrelas ------------------------------------------- */
.estrelas {
  display: flex;
  gap: clamp(8px, 1.8vw, 12px);
  justify-content: center;
  padding: 4px 0;
}

.estrela {
  color: var(--linha);
  cursor: pointer;
  line-height: 1;
  user-select: none;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s, color .12s;
}

.estrela svg {
  width: clamp(30px, 5.6vw, 42px);
  height: clamp(30px, 5.6vw, 42px);
  fill: currentColor;
  transition: filter .15s;
}

.estrela.ativa svg {
  filter: drop-shadow(0 2px 4px currentColor);
}

.estrela.ativa {
  color: var(--amarelo);
}

.estrela:active {
  transform: scale(1.3);
}

.estrela:focus-visible {
  outline: 3px solid var(--azul);
  outline-offset: 2px;
  border-radius: 50%;
}

@media (hover: hover) {
  .estrela:hover {
    transform: scale(1.15);
  }
}

/* ---- 8. Botão enviar --------------------------------------- */
.btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: clamp(16px, 2.5vw, 20px);
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(155deg, var(--azul), var(--azul-escuro));
  margin-top: clamp(14px, 2.5vw, 20px);
  cursor: pointer;
  letter-spacing: .3px;
  box-shadow: 0 10px 22px rgba(26, 80, 184, .28);
  transition: transform .15s, box-shadow .15s, filter .15s;
  min-height: 56px;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(26, 80, 184, .32);
  }
}

.btn:active {
  transform: translateY(1px) scale(.99);
  box-shadow: 0 4px 10px rgba(26, 80, 184, .18);
}

.btn:disabled {
  background: #b0bdd8;
  box-shadow: none;
  cursor: not-allowed;
}

.aviso {
  font-size: clamp(12px, 1.6vw, 14px);
  color: #c62828;
  text-align: center;
  margin-top: 10px;
  min-height: 20px;
}

/* ---- 9. Tela de obrigado ----------------------------------- */
.obrigado {
  text-align: center;
  padding: clamp(32px, 6vw, 52px) 10px;
}

.obrigado .check {
  width: clamp(80px, 12vw, 100px);
  height: clamp(80px, 12vw, 100px);
  border-radius: 50%;
  background: var(--azul-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  animation: pop .4s ease;
}

.obrigado .check svg {
  width: 48%;
  height: 48%;
  stroke: var(--azul);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@keyframes pop {
  0%   { transform: scale(0); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.obrigado h2 {
  color: var(--azul);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
}

.obrigado p {
  color: var(--cinza);
  margin-top: 8px;
  font-size: clamp(14px, 2vw, 17px);
}

/* ---- 10. Responsivo — Portrait tablet ---------------------- */
@media (orientation: portrait) and (min-width: 600px) and (pointer: coarse) {
  .logo        { height: min(54px, 6dvh); }
  .topo h1     { font-size: min(28px, 3.5dvh); }
  .topo p      { font-size: 16px; margin-top: 8px; }
  .topo        { margin-bottom: min(26px, 3dvh); }
  .card        { padding: min(36px, 4dvh) 28px min(30px, 3.5dvh); }
  .grade       { gap: min(14px, 2dvh); }
  .metrica     { padding: min(18px, 2dvh) 16px min(16px, 2dvh); }
  .metrica .nome  { font-size: 17px; }
  .metrica .sub   { font-size: 13px; margin-bottom: min(14px, 2dvh); }
  .estrela     { min-height: 54px; }
  .estrelas    { gap: 8px; }
  .btn         { padding: min(20px, 2.5dvh); font-size: 20px; min-height: min(60px, 7dvh); margin-top: min(20px, 2.5dvh); }
}

/* ---- 11. Responsivo — Landscape tablet --------------------- */
@media (orientation: landscape) and (min-height: 500px) and (pointer: coarse) {
  .grade       { grid-template-columns: 1fr 1fr; }
  .wrap        { max-width: 960px; }
  .topo        { margin-bottom: 10px; }
  .logo        { height: 28px; }
  .topo h1     { font-size: clamp(15px, 2.4vw, 20px); }
  .topo p      { font-size: 12px; margin-top: 3px; }
  .card        { padding: 14px clamp(16px, 3vw, 28px) 12px; }
  .metrica     { padding: 12px 14px; }
  .metrica .sub { margin-bottom: 8px; }
  .btn         { padding: 14px; min-height: 48px; }
}

/* ---- 12. Responsivo — Landscape celular -------------------- */
@media (orientation: landscape) and (max-height: 499px) and (pointer: coarse) {
  .logo        { display: none; }
  .topo h1     { font-size: 16px; margin-top: 0; }
  .topo        { margin-bottom: 8px; }
  .grade       { grid-template-columns: 1fr 1fr; }
  .metrica .sub { display: none; }
  .metrica     { padding: 10px 12px; }
  .card        { padding: 12px 16px 10px; }
}

/* ---- Responsivo — Portrait celular (pequeno) --------------- */
@media (max-width: 500px) and (orientation: portrait) {
  html, body         { overflow: auto; height: auto; }
  #quiosque          { height: auto; min-height: 100dvh; overflow: visible;
                       display: flex; flex-direction: column;
                       align-items: center; justify-content: flex-start;
                       padding: 16px 14px 32px; }
  .wrap              { width: 100%; max-width: 100%; }
  .card              { padding: 16px 14px 14px; border-radius: 18px; }
  .logo              { height: 30px; }
  .topo              { margin-bottom: 10px; }
  .topo h1           { font-size: 15px; }
  .topo p            { font-size: 12px; }
  .refeicao-badge    { font-size: 12px; padding: 4px 10px; margin-top: 6px; }
  .grade             { gap: 8px; }
  .metrica           { padding: 10px 12px; border-radius: 14px; }
  .metrica .nome     { font-size: 13px; }
  .metrica .sub      { font-size: 12px; margin-bottom: 8px; }
  .estrela           { min-width: 44px; min-height: 44px; }
  .estrela svg       { width: 26px; height: 26px; }
  .estrelas          { gap: 8px; }
  .btn               { padding: 13px; font-size: 15px; min-height: 48px; margin-top: 10px; }
}

/* ---- Rótulo de nota (Péssimo … Excelente) ------------------ */
.nota-label {
  text-align: center;
  font-size: clamp(12px, 1.4vw, 13px);
  font-weight: 700;
  letter-spacing: .3px;
  min-height: 16px;
  margin-top: 4px;
  transition: color .15s;
}

/* ---- Tremida (campo sem preenchimento) --------------------- */
@keyframes tremer {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-7px); }
  30%      { transform: translateX(7px); }
  45%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
  75%      { transform: translateX(-3px); }
  90%      { transform: translateX(3px); }
}

.metrica.tremer {
  animation: tremer .45s ease;
  border-color: #c62828 !important;
  background: #fff5f5 !important;
}

/* ---- Efeito brilho (5 estrelas) ---------------------------- */
.estrelas {
  position: relative; /* necessário para as partículas */
}

.estrelas.cinco .estrela {
  animation: brilho-pop .55s ease;
}
.estrelas.cinco .estrela:nth-child(1) { animation-delay:   0ms; }
.estrelas.cinco .estrela:nth-child(2) { animation-delay:  60ms; }
.estrelas.cinco .estrela:nth-child(3) { animation-delay: 120ms; }
.estrelas.cinco .estrela:nth-child(4) { animation-delay: 180ms; }
.estrelas.cinco .estrela:nth-child(5) { animation-delay: 240ms; }

@keyframes brilho-pop {
  0%   { transform: scale(1); filter: none; }
  38%  { transform: scale(1.55); filter: drop-shadow(0 0 10px #f5c22a) brightness(1.25); }
  68%  { transform: scale(1.2);  filter: drop-shadow(0 0 4px #f5c22a); }
  100% { transform: scale(1);   filter: none; }
}

.particula {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particula-voar .7s ease-out forwards;
}

@keyframes particula-voar {
  0%   { transform: translate(-50%, -50%) translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ---- Badge de campanha/tema sazonal ------------------------ */
.tema-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amarelo-claro);
  border: 1.5px solid rgba(0, 0, 0, .06);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: clamp(12px, 1.5vw, 13px);
  font-weight: 700;
  color: var(--azul);
  margin-top: 10px;
  box-shadow: 0 4px 10px rgba(245, 194, 42, .15);
}

/* ---- Badge refeição atual ---------------------------------- */
.refeicao-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--azul-claro);
  border: 1.5px solid rgba(26, 80, 184, .14);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 700;
  color: var(--azul);
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px rgba(26, 80, 184, .08);
}

.refeicao-badge .badge-label { opacity: .55; font-weight: 600; }
.refeicao-badge .sep         { opacity: .3; }

/* ---- Tela de repouso --------------------------------------- */
.repouso {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: linear-gradient(160deg, #f2f5fc 0%, #eaeffb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
}

.repouso.entrando {
  animation: repouso-entrada .8s cubic-bezier(.22,.61,.36,1) forwards;
}

.repouso.saindo {
  animation: repouso-saida .45s ease-in forwards;
}

.repouso-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 194, 42, .22) 0%, transparent 68%);
  pointer-events: none;
}

.repouso-logo {
  height: clamp(60px, 9vw, 100px);
  width: auto;
  position: relative;
  margin-bottom: 32px;
  animation: repouso-pulse 3.5s ease-in-out infinite;
}

.repouso-msg {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(13px, 1.6vw, 17px);
  font-weight: 400;
  color: var(--azul);
  text-align: center;
  padding: 0 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .75;
  position: relative;
  margin-bottom: 14px;
}

.repouso-cta {
  font-size: clamp(12px, 1.4vw, 13px);
  font-weight: 700;
  color: var(--cinza);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  position: relative;
  animation: repouso-piscar 2s ease-in-out infinite;
}

@keyframes repouso-entrada {
  0%   { opacity: 0; transform: scale(0.96) translateY(14px); }
  100% { opacity: 1; transform: scale(1)    translateY(0);    }
}

@keyframes repouso-saida {
  0%   { opacity: 1; transform: scale(1);    }
  100% { opacity: 0; transform: scale(1.04); }
}

@keyframes repouso-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 24px rgba(245,194,42,.2)); }
  50%       { transform: scale(1.05); filter: drop-shadow(0 0 50px rgba(245,194,42,.45)); }
}

@keyframes repouso-piscar {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ---- Utilitário -------------------------------------------- */
.hidden { display: none !important; }

/* ---- Faixa de aniversariantes (rodapé, editada pelo painel) -- */
.ribbon-aniversariantes {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  overflow: hidden;
  padding: 10px 0;
  background: linear-gradient(90deg, var(--amarelo), #ffdf7e);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .1);
}

.ribbon-aniversariantes[hidden] { display: none; }

.ribbon-aniversariantes__track {
  display: inline-block;
  white-space: nowrap;
  /* Porcentagem de padding resolve contra a largura do CONTAINER (regra do
     CSS), então isso empurra o texto pra começar uma tela inteira à
     direita — ou seja, fora da tela — antes de rolar pra dentro. */
  padding-left: 100%;
  animation: ribbon-rolar 22s linear infinite;
  font-weight: 800;
  font-size: clamp(13px, 1.9vw, 17px);
  color: var(--azul-escuro);
}

@keyframes ribbon-rolar {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ---- Acessibilidade: respeita "reduzir movimento" do sistema ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .ribbon-aniversariantes { overflow-x: auto; }
  .ribbon-aniversariantes__track {
    animation: none !important;
    transform: none !important;
    padding-left: 16px !important;
  }
}