/* ===================================================================
   oab-anuidade — "Minha Anuidade"
   Design system OAB-PR (mesmos tokens do oab-portal). Sem framework de UI.
   =================================================================== */

:root {
  --azul-classico: #001E5F;
  --azul-digital:  #556EFF;
  --azul-confianca:#37AAE1;
  --azul-vibrante: #3CDCFF;
  --branco: #FFFFFF;
  --cinza-100: #F5F7FA;
  --cinza-200: #E8ECF1;
  --cinza-300: #CBD2DC;
  --cinza-400: #8E99A8;
  --cinza-500: #5A6577;
  --cinza-600: #3A4354;
  --verde: #16A34A;
  --verde-bg: #E7F6EC;
  --ambar: #F59E0B;

  --font-livvic: 'Livvic', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,30,95,.06);
  --shadow-md: 0 4px 14px rgba(0,30,95,.08);
  --shadow-lg: 0 10px 34px rgba(0,30,95,.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-livvic);
  background: var(--cinza-100);
  color: var(--cinza-600);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* === Container (mobile-first, igual aos mockups) === */
.anu-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 140px;
}

/* === Estados (loading / login) === */
.anu-state {
  min-height: 70vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 14px; color: var(--cinza-500);
}
.anu-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--cinza-200); border-top-color: var(--azul-digital);
  animation: anu-spin .8s linear infinite;
}
@keyframes anu-spin { to { transform: rotate(360deg); } }
.anu-hidden { display: none !important; }

/* === Hero / card da anuidade === */
.anu-hero {
  position: relative;
  background: linear-gradient(150deg, #001A52 0%, #002A7A 55%, #0A327F 100%);
  border-radius: var(--radius-xl);
  padding: 26px 24px 22px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.anu-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(60,220,255,.18), transparent 70%);
}
.anu-hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.anu-hero-label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 600; }
.anu-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,.18); color: #FFD27A;
  font-size: .78rem; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.anu-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ambar); }
.anu-badge-ok { background: rgba(22,163,74,.18); color: #86EFAC; }
.anu-badge-ok::before { background: var(--verde); }
.anu-valor { margin-top: 8px; display: flex; align-items: baseline; gap: 3px; }
.anu-valor .cifrao { font-size: 1.2rem; font-weight: 600; opacity: .85; }
.anu-valor .reais  { font-size: 2.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.anu-valor .centavos { font-size: 1.2rem; font-weight: 700; opacity: .85; }
.anu-parcela-hint { color: rgba(255,255,255,.6); font-size: .9rem; margin-top: 4px; }

.anu-meta {
  display: flex; margin-top: 18px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md); overflow: hidden;
}
.anu-meta-item { flex: 1; padding: 14px 16px; }
.anu-meta-item + .anu-meta-item { border-left: 1px solid rgba(255,255,255,.12); }
.anu-meta-val { font-weight: 700; font-size: 1rem; }
.anu-meta-lbl { font-size: .76rem; color: rgba(255,255,255,.55); margin-top: 2px; }

.anu-progress { margin-top: 16px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.15); overflow: hidden; }
.anu-progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--azul-vibrante), var(--azul-confianca)); width: 8%; transition: width .6s ease; }
.anu-progress-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: .8rem; color: rgba(255,255,255,.6); }

/* === Secoes === */
.anu-section-head { display: flex; justify-content: space-between; align-items: center; margin: 26px 2px 12px; }
.anu-section-title { font-size: 1.15rem; font-weight: 700; color: var(--azul-classico); }
.anu-section-link { font-size: .82rem; color: var(--azul-digital); font-weight: 600; background: var(--cinza-200); padding: 6px 12px; border-radius: 999px; }

/* === Grade de meios de pagamento === */
.anu-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.anu-method {
  position: relative; background: #fff; border: 1.5px solid var(--cinza-200);
  border-radius: var(--radius-lg); padding: 18px 14px; text-align: center;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.anu-method:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.anu-method.sel { border-color: var(--azul-digital); box-shadow: 0 0 0 3px rgba(85,110,255,.15); }
.anu-method-ico { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.anu-method-ico.pix { background: #DCFCE7; color: #0F9D58; }
.anu-method-ico.card { background: #EEF2FF; color: var(--azul-digital); }
.anu-method-ico.apple { background: #F1F1F4; color: #111; }
.anu-method-ico.google { background: #EAF1FF; color: #4285F4; }
.anu-method-nome { font-weight: 700; color: var(--azul-classico); }
.anu-method-desc { font-size: .78rem; color: var(--cinza-400); margin-top: 2px; }
.anu-method-check { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--azul-digital); color: #fff; display: none; align-items: center; justify-content: center; font-size: .8rem; }
.anu-method.sel .anu-method-check { display: flex; }

/* === Opcoes de parcelamento === */
.anu-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.anu-plan {
  position: relative; background: #fff; border: 1.5px solid var(--cinza-200);
  border-radius: var(--radius-lg); padding: 22px 8px 16px; text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.anu-plan.sel { border-color: var(--azul-digital); box-shadow: 0 0 0 3px rgba(85,110,255,.15); }
.anu-plan-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: .62rem; font-weight: 700; letter-spacing: .05em; color: #fff; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.anu-plan-tag.rec { background: var(--azul-digital); }
.anu-plan-tag.pop { background: var(--verde); }
.anu-plan-nome { font-weight: 700; color: var(--azul-classico); }
.anu-plan-valor { color: var(--azul-digital); font-weight: 800; margin-top: 6px; font-size: 1.05rem; }
.anu-plan-sub { margin-top: 8px; font-size: .72rem; font-weight: 600; color: var(--verde); background: var(--verde-bg); padding: 4px 6px; border-radius: 8px; }

/* === Demonstrativo === */
.anu-demo { border-top: 1px solid var(--cinza-200); margin-top: 22px; }
.anu-demo-body { display: none; padding: 6px 2px 0; }
.anu-demo-body.open { display: block; }
.anu-demo-row { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px dashed var(--cinza-200); font-size: .9rem; }
.anu-demo-row span:last-child { font-weight: 600; color: var(--azul-classico); }

/* === Cards promocionais === */
.anu-promo { display: flex; gap: 14px; align-items: center; border-radius: var(--radius-lg); padding: 16px; margin-top: 12px; }
.anu-promo.ambar { background: #FEF6E4; border: 1px solid #F6E2B8; }
.anu-promo.verde { background: var(--verde-bg); border: 1px solid #BBE7C9; }
.anu-promo-ico { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.anu-promo.ambar .anu-promo-ico { background: #FBD78B; }
.anu-promo.verde .anu-promo-ico { background: #A7E3BA; }
.anu-promo-tit { font-weight: 700; color: var(--azul-classico); display: flex; align-items: center; gap: 8px; }
.anu-promo-desc { font-size: .82rem; color: var(--cinza-500); margin-top: 2px; }
.anu-promo-new { font-size: .58rem; font-weight: 800; color: #fff; background: var(--verde); padding: 2px 6px; border-radius: 6px; letter-spacing: .05em; }

/* === Footer fixo (total + pagar) === */
.anu-footer {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-top: 1px solid var(--cinza-200);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
.anu-footer-inner { max-width: 480px; margin: 0 auto; }
.anu-total-lbl { text-align: center; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cinza-400); }
.anu-total-val { text-align: center; font-size: 1.7rem; font-weight: 800; color: var(--azul-classico); margin: 2px 0 12px; }
.anu-btn-pagar {
  width: 100%; padding: 16px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--azul-digital), #7C5CFF);
  color: #fff; font-size: 1.05rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(85,110,255,.35); transition: transform .2s, box-shadow .2s;
}
.anu-btn-pagar:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(85,110,255,.45); }
.anu-btn-pagar:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* === Modal de resultado (Pix / boleto) === */
.anu-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-end; justify-content: center; background: rgba(0,20,60,.45); }
.anu-modal.open { display: flex; }
.anu-modal-card { background: #fff; width: 100%; max-width: 480px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 24px 22px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.anu-modal-tit { font-size: 1.2rem; font-weight: 800; color: var(--azul-classico); margin-bottom: 4px; }
.anu-modal-sub { color: var(--cinza-500); font-size: .9rem; margin-bottom: 18px; }
.anu-qr { width: 200px; height: 200px; margin: 0 auto 16px; border-radius: 14px; background: var(--cinza-100); display: flex; align-items: center; justify-content: center; border: 1px dashed var(--cinza-300); padding: 8px; }
.anu-qr img { width: 100%; height: 100%; object-fit: contain; }
.anu-copia { display: flex; gap: 8px; }
.anu-copia input { flex: 1; padding: 12px; border: 1px solid var(--cinza-200); border-radius: 10px; font-size: .8rem; background: var(--cinza-100); color: var(--cinza-600); }
.anu-copia button { padding: 0 16px; border-radius: 10px; background: var(--azul-classico); color: #fff; font-weight: 600; }
.anu-pix-status { margin-top: 16px; font-weight: 600; color: var(--ambar); }
.anu-pix-status.ok { color: var(--verde); }
.anu-modal-close { margin-top: 16px; color: var(--cinza-400); font-size: .9rem; text-decoration: underline; }

.anu-demo-note { background: #FEF6E4; border: 1px solid #F6E2B8; color: #8A6D1B; font-size: .8rem; padding: 10px 12px; border-radius: 10px; margin-top: 16px; text-align: left; }

/* Toast */
.anu-toast { position: fixed; bottom: 160px; left: 50%; transform: translateX(-50%); background: var(--azul-classico); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: .9rem; z-index: 300; opacity: 0; transition: opacity .25s; pointer-events: none; }
.anu-toast.show { opacity: 1; }

/* === Tela de login (2 modos) === */
.anu-login-card { background: #fff; border-radius: var(--radius-xl); padding: 28px 24px; box-shadow: var(--shadow-lg); margin-top: 24px; }
.anu-login-head { text-align: center; margin-bottom: 20px; }
.anu-login-ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; background: linear-gradient(135deg, var(--azul-digital), #7C5CFF); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.anu-login-head h2 { color: var(--azul-classico); font-size: 1.3rem; font-weight: 800; }
.anu-login-head p { color: var(--cinza-500); font-size: .88rem; margin-top: 4px; }
.anu-login-ou { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--cinza-400); font-size: .8rem; }
.anu-login-ou::before, .anu-login-ou::after { content: ""; flex: 1; height: 1px; background: var(--cinza-200); }
.anu-fld-label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--azul-classico); margin: 12px 2px 6px; }
.anu-fld { width: 100%; padding: 13px 15px; border: 1.5px solid var(--cinza-200); border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem; background: var(--cinza-100); color: var(--cinza-600); outline: none; transition: border-color .2s, box-shadow .2s; }
.anu-fld:focus { border-color: var(--azul-digital); background: #fff; box-shadow: 0 0 0 3px rgba(85,110,255,.12); }
select.anu-fld { cursor: pointer; -webkit-appearance: none; appearance: none; }
.anu-fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-turnstile { display: flex; justify-content: center; margin: 14px 0; }
.anu-login-erro { color: #ef4444; font-size: .84rem; min-height: 18px; text-align: center; margin: 4px 0; }
#anu-login-form .anu-btn-pagar { margin-top: 8px; }
#anu-dev-btn { display: block; margin: 16px auto 0; }

/* === Ajustes: 3 meios (Pix/Cartão/Boleto) e plano à vista/parcelado === */
.anu-methods-3 { grid-template-columns: repeat(3, 1fr); }
.anu-methods-3 .anu-method { padding: 14px 8px; }
.anu-methods-3 .anu-method-ico { width: 44px; height: 44px; font-size: 1.2rem; margin-bottom: 8px; }
.anu-method-desc { font-size: .74rem; }
.anu-method-ico.boleto { background: #FEF3C7; color: #B45309; font-weight: 800; }
.anu-plans-2 { grid-template-columns: 1fr 1fr; }
.anu-parcelas-sel { margin-top: 12px; }
