/* ===================================================================
 * Vulon — Screens.css
 * ===================================================================
 * Estilos compartilhados pelas telas internas (cartao, pix, emprestimo,
 * indicar, pontos, perfil, mais). Convive com app.css (que tem as
 * variaveis e o shell da home).
 *
 * Padrao: max-width 480px, dark theme roxo, scroll vertical natural,
 * bottom-nav fixo. Sem layouts complexos — tudo cards empilhados.
 * =================================================================== */

/* ===================================================================
 * Reset global de aspecto de link em elementos clicaveis (Bootstrap CSS
 * sublinha <a> por default). Vale pra qualquer <a>/<button> usado como
 * navegacao/lista/atalho dentro do app.
 * =================================================================== */
/* Links de navegacao/lista herdam cor do contexto. NAO inclui
   .btn-vulon-primary nem .btn-vulon-outline porque esses botoes
   tem cor propria definida em app.css/auth.css — herdar cor
   inherit deixa texto branco em fundo branco invisivel. */
a.menu-item, a.list-row, a.action-btn, a.nav-item, a.screen-back,
a.screen-action {
  text-decoration: none !important;
  color: inherit;
}
a.menu-item:hover, a.list-row:hover, a.action-btn:hover, a.nav-item:hover,
a.screen-back:hover, a.screen-action:hover {
  text-decoration: none !important;
}
/* Botoes ainda precisam tirar underline em <a>, mas mantem cor propria */
a.btn-vulon-primary, a.btn-vulon-outline { text-decoration: none !important; }

/* ===========================
   APP SHELL (telas internas)
   ===========================
   Mesmo modelo da home (.app-container em app.css): o documento NAO
   rola (body position:fixed via classe .app-shell-screen, adicionada
   por JS no head quando existe .app-screen). Isso mata o scroll-bounce
   do WKWebView iOS e estabiliza o bottom-nav position:fixed (parava
   de "flutuar"/revelar fundo nativo no overscroll). So o .screen-body
   rola. Com isso o conteudo comeca em y=0 (sob a status bar), entao o
   .screen-header SOMA a safe-area no padding (igual a home).

   NOTA: existe um override identico INLINE no head.php (HTML no-store,
   imune ao cache de SW/WKWebView que prendia este screens.css). Manter
   ambos ate o SW v13 ter rotacionado em todos os devices de teste;
   depois o inline pode sair e esta regra basta. */
.app-screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--primary);
  color: var(--white);
  padding-bottom: 110px;
  position: relative;
}

@media (max-width: 480px) {
  .app-screen { max-width: 100%; }
}

/* App-shell ativado por JS (body.app-shell-screen) so onde ha .app-screen */
body.app-shell-screen { position: fixed; inset: 0; width: 100%; overflow: hidden; }
body.app-shell-screen .app-screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
}
body.app-shell-screen .screen-header { flex-shrink: 0; }
body.app-shell-screen .screen-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(96px + var(--sab, env(safe-area-inset-bottom, 0px)));
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  /* COM safe-area: o app-shell remove o contentInset nativo, entao o
     conteudo comeca em y=0 (sob o notch). base 17px + --sat (injetado
     pelo MainViewController iOS via WKUserScript; env() de fallback
     pra web/PWA). Home usa 35+sat; interna 17+sat (menor, por design). */
  padding: calc(17px + var(--sat, env(safe-area-inset-top, 0px))) 20px 14px;
  position: sticky;
  top: 0;
  background: var(--primary);
  z-index: 10;
}
.screen-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  text-decoration: none;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}
.screen-back:hover { background: rgba(255,255,255,0.18); color: #fff; }
.screen-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  flex: 1;
}
.screen-action {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-weight: 600;
}
/* padding-bottom reserva espaco pro bottom-nav fixo + home indicator,
   pra o ultimo conteudo nao ficar escondido atras do menu. */
.screen-body { padding: 8px 20px calc(96px + var(--sab, env(safe-area-inset-bottom, 0px))); }

/* ===========================
   SECTIONS
   =========================== */
.section-title {
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 22px 0 10px;
  font-weight: 600;
}
.section-title:first-child { margin-top: 8px; }

/* ===========================
   CARDS
   =========================== */
.card-soft {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 12px;
}
.card-soft .label {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
  font-weight: 500;
}
.card-soft .value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.card-soft .value.small { font-size: 1.05rem; }
.card-soft .hint {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.kpi-grid .card-soft { margin: 0; }

/* ===========================
   LIST ROWS
   =========================== */
.list-rows {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-decoration: none;
  color: #fff;
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgba(255,255,255,0.04); color: #fff; }
.list-row .lr-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.list-row .lr-icon.credit { background: rgba(39,174,96,0.18); color: #6ee7a8; }
.list-row .lr-icon.debit  { background: rgba(231,76,60,0.18); color: #ff8e85; }
.list-row .lr-icon.info   { background: rgba(155,109,204,0.22); color: #d4b6ff; }
.list-row .lr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-row .lr-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .lr-sub {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.55);
}
.list-row .lr-amount {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.list-row .lr-amount.credit { color: #6ee7a8; }
.list-row .lr-amount.debit  { color: #ffd1cd; }
.list-row .lr-chev {
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ===========================
   ACTIONS GRID (atalhos circulares)
   =========================== */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}
.action-btn {
  background: none;
  border: none;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.action-btn .ab-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid rgba(255,255,255,0.12);
}
.action-btn .ab-label {
  font-size: 0.7rem;
  text-align: center;
  color: rgba(255,255,255,0.85);
  line-height: 1.2;
}
.action-btn:hover .ab-icon { background: rgba(255,255,255,0.16); }
.action-btn:hover { color: #fff; }

/* ===========================
   PROGRESS BAR (niveis)
   =========================== */
.level-progress {
  height: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.level-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-4), var(--primary-6));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ===========================
   CARTAO VISUAL (fac-similar)
   =========================== */
.card-visual {
  position: relative;
  border-radius: 18px;
  padding: 22px 22px 18px;
  background: linear-gradient(135deg, var(--primary-3), var(--primary-1));
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  overflow: hidden;
  margin-bottom: 16px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(255,255,255,0.16), transparent 55%);
  pointer-events: none;
}
.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}
.cv-tier {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  opacity: 0.9;
}
.cv-brand {
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.cv-pan {
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  letter-spacing: 2.5px;
  margin-top: auto;
}
.cv-name {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 6px;
  opacity: 0.92;
}
.cv-chip {
  width: 36px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #c8a64b, #f1d27a);
  margin-bottom: 14px;
}

/* ===========================
   STATUS PILLS
   =========================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.pill-ok      { background: rgba(39,174,96,0.22);  color: #b3f5cd; }
.pill-pending { background: rgba(241,196,15,0.22); color: #ffe69b; }
.pill-block   { background: rgba(231,76,60,0.22);  color: #ff9e94; }

/* ===========================
   DIVIDERS / EMPTY
   =========================== */
.divider-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  margin: 16px 0;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.10);
}
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
}
.empty-state i {
  display: block;
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* ===========================
   FORMS (overrides)
   =========================== */
.input-with-prefix {
  position: relative;
}
.input-with-prefix .prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.95rem;
  pointer-events: none;
}
.input-with-prefix .vulon-input { padding-left: 44px; }

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-4);
  cursor: pointer;
}
.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary-4);
  cursor: pointer;
}

/* ===========================
   FAB / FLOATING SUBMIT
   =========================== */
.floating-cta {
  position: sticky;
  bottom: 16px;
  margin-top: 16px;
  padding: 0 4px;
}

/* ===========================
   STORY / HERO
   =========================== */
.hero-banner {
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary-4));
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.hero-banner h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.hero-banner p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
  line-height: 1.45;
}
.hero-banner .hero-img {
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 140px;
  opacity: 0.92;
  pointer-events: none;
}

/* ===========================
   QR placeholder
   =========================== */
.qr-frame {
  width: 240px;
  height: 240px;
  margin: 12px auto;
  background: #fff;
  border-radius: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.qr-frame i { font-size: 6rem; }

/* ===========================
   TIER VISUAL (pontos)
   =========================== */
.tier-strip {
  display: flex;
  gap: 6px;
  margin: 14px 0 8px;
}
.tier-strip .ts-step {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  border: 1px solid transparent;
}
.tier-strip .ts-step.current {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
.tier-strip .ts-step.done {
  color: rgba(255,255,255,0.85);
}

/* ===========================
   TOAST de pontos ganhos
   =========================== */
.points-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-200%);
  background: linear-gradient(135deg, var(--primary-4), var(--primary-6));
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.points-toast.show { transform: translateX(-50%) translateY(0); }
.points-toast i { font-size: 1.1rem; }
