/* assets/css/avaliacao.css */
/* Layout app (clean branco) + navegação por telas + transições + ícones SVG consistentes */

.app{
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  overflow-x: hidden;
}

/* ---------- AppBar (topo) ---------- */
.appbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(238,242,247,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.appbar__left{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.appbar__logo{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--text);
  box-shadow: 0 10px 18px rgba(17,24,39,.06);
  flex: 0 0 auto;
}

.appbar__texts{ min-width: 0; }

.appbar__title{
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: .2px;
}

.appbar__subtitle{
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56vw;
}

/* Lado direito do topo */
.appbar__right{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

/* Saldo */
.walletChip{
  display: grid;
  gap: 6px;
  min-width: 0;
}

.walletChip__label{
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.walletChip__value{
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  letter-spacing: .2px;
  border: 1px solid rgba(0,0,0,.06);
  min-width: 128px;
  text-align: center;
}

/* ---------- Premium / Upsells (UI) ---------- */
/* Só afeta elementos com classes/IDs ux__... */
.ux__chip{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 10px 18px rgba(17,24,39,.06);
  min-width: 0;
  max-width: 100%;
}

.ux__diamond{
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(238,242,247,.92);
  border: 1px solid var(--line);
  color: var(--text);
}

.ux__chipTitle{
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: .2px;
}

.ux__chipSub{
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.ux__btnLink{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid transparent;
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: transform .08s ease, filter .12s ease, box-shadow .14s ease, border-color .14s ease;
}

.ux__btnLink:active{
  transform: translateY(var(--pressY)) scale(var(--pressScale));
}

.ux__btnPrimary{
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 18px rgba(31,162,74,.18);
}

.ux__btnGhost{
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.ux__btnGhost:hover{
  box-shadow: 0 10px 18px rgba(17,24,39,.06);
}

.ux__panel{
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.ux__panelTitle{
  font-weight: 900;
  color: var(--text);
  font-size: 14px;
  margin: 0 0 8px;
}

.ux__panelText{
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ux__btnRow{
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ux__btnRow .ux__btnLink{
  flex: 1 1 160px;
  width: auto;
}

/* ---------- Conteúdo / Views ---------- */
.content{
  position: relative;
  padding: 14px 14px 90px;
}

.view{
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease;
}

.view.is-active{
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.screen{
  max-width: 760px;
  margin: 0 auto;
}

.screen__title{
  margin: 6px 0 12px;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
}

/* cards resumo */
.cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.miniCard{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px;
  box-shadow: 0 10px 18px rgba(17,24,39,.06);
}

.miniCard__label{
  font-size: 12px;
  color: var(--muted);
}

.miniCard__value{
  margin-top: 6px;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}

/* painel clean */
.panelClean{
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.panelClean__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(107,114,128,.25);
}

.panelClean__row:last-child{ border-bottom: none; }

.panelClean__label{
  font-size: 13px;
  color: var(--muted);
}

.panelClean__value{
  font-weight: 900;
  color: var(--text);
}

.panelClean__hint{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- Progresso (avaliacao) ---------- */
.progress{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.progress__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}

.progress__label{
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
}

.progress__pct{
  font-weight: 900;
  color: var(--text);
}

.progress__bar{
  height: 10px;
  border-radius: 999px;
  background: rgba(107,114,128,.18);
  overflow: hidden;
}

.progress__fill{
  height: 100%;
  width: 0%;
  background: var(--green);
  border-radius: 999px;
  transition: width .25s ease;
}

.rules{
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.rules__line{ margin: 6px 0 0; }

/* painel avaliação */
.panel{
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.panel__badge{
  width: fit-content;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(31,162,74,.10);
  border: 1px solid rgba(31,162,74,.20);
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
}

.panel__title{
  margin: 10px 0 12px;
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}

.amount{
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(238,242,247,.60);
  padding: 12px;
}

.amount__label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .4px;
}

.amount__value{
  margin-top: 6px;
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
}

.amount__hint{
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tries{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.tries__count,
.tries__total{
  font-weight: 900;
  color: var(--text);
}

.codebox{
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.codebox__label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .4px;
}

.codebox__code{
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 2px;
}

.helper{
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* inputs do código */
.inputs{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
  justify-items: center;
}

.digit{
  height: 54px;
  width: 100%;
  max-width: 64px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(238,242,247,.60);
  text-align: center;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
  outline: none;
  transition: box-shadow .12s ease, border-color .12s ease, transform .08s ease;
}

.digit:focus{
  box-shadow: var(--ring);
  border-color: var(--ringBorder);
}

.digit.bad{
  border-color: rgba(185,28,28,.55);
  box-shadow: 0 0 0 3px rgba(185,28,28,.10);
}

.btn-rescue{
  background: var(--green);
  border-radius: 12px;
  padding: 14px 14px;
  text-transform: uppercase;
}

.btn-rescue[disabled]{ opacity: .6; cursor: not-allowed; }

/* feedback */
.feedback{
  min-height: 18px;
  text-align: center;
  font-size: 13px;
  margin-top: 10px;
  color: var(--muted);
}

.feedback.is-ok{ color: var(--greenDark); font-weight: 800; }
.feedback.is-bad{ color: #B91C1C; font-weight: 800; }

.footnote{
  text-align: center;
  color: var(--muted);
  margin-top: 12px;
}

/* lista histórico */
.list{
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.item{
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 18px rgba(17,24,39,.06);
}

.item__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.item__title{
  font-weight: 900;
  color: var(--text);
  font-size: 16px;
}

.item__tag{
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(238,242,247,.60);
  color: var(--text);
}

.item__meta{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.empty{
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(107,114,128,.35);
  color: var(--muted);
  background: rgba(238,242,247,.45);
  text-align: center;
}

/* ---------- Tabbar (bottom) ---------- */
.tabbar{
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 10px 12px;
}

.tab{
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 8px;
  display: grid;
  gap: 6px;
  place-items: center;
  cursor: pointer;
  transition: transform .08s ease, background .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.tab:active{
  transform: translateY(var(--pressY)) scale(var(--pressScale));
}

.tab__icon{
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.tab__icon svg{ width: 100%; height: 100%; }

.tab__text{
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active{
  background: rgba(31,162,74,.10);
  border-color: rgba(31,162,74,.18);
  box-shadow: 0 10px 18px rgba(17,24,39,.06);
}

.tab.is-active .tab__icon,
.tab.is-active .tab__text{
  color: var(--text);
}

@keyframes tabPop{
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.tab.is-active .tab__icon{ animation: tabPop .22s ease; }

.tab:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.16);
  border-color: rgba(59,130,246,.35);
}

/* ---------- Responsivo (Mobile) ---------- */
@media (max-width: 520px){
  body{ overflow-x: hidden; }

  .content{ padding-left: 12px; padding-right: 12px; }

  .appbar{
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .appbar__left{
    flex: 1 1 100%;
  }

  .appbar__right{
    flex: 1 1 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .walletChip__label{
    text-align: left;
  }

  .walletChip__value{
    min-width: 0;
    width: 100%;
  }

  /* Diamante: vira cartão empilhado e organizado (sem quebrar) */
  #premiumDiamondChip{
    width: 100%;
    margin-left: 0 !important; /* caso tenha inline */
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Linha do topo do chip: ícone + textos */
  #premiumDiamondChip .ux__diamond{
    width: 38px;
    height: 38px;
  }

  /* O bloco de textos não pode ter min-width forçando largura */
  #premiumDiamondChip > div{
    min-width: 0 !important; /* sobrescreve inline */
  }

  /* Botão sempre dentro do card, sem "voar" para o lado */
  #premiumDiamondChip .ux__btnLink{
    width: 100%;
    white-space: normal;
  }

  /* Área de avaliação: central e clean */
  .panel__badge{
    margin: 0 auto;
  }

  .panel__title{
    text-align: center;
    font-size: 20px;
  }

  .amount{
    text-align: center;
  }

  .codebox{
    text-align: center;
  }

  .codebox__label,
  .codebox__code{
    text-align: center;
  }

  .helper{
    text-align: center;
  }
}

@media (max-width: 380px){
  .digit{ max-width: 58px; }
}
