/* ============================================================
   Calculadora de Milhas — /calculadora-de-milhas
   Scoped em .calc-milhas para não conflitar com o tema global.
   O tema já define background #0E0E0E e Montserrat globalmente.
   ============================================================ */

.calc-milhas {
  --cm-surface: #1c1a18;
  --cm-surface-row: #252220;
  --cm-input-bg: #131313;
  --cm-border: #34302c;
  --cm-border-brand: #c0661e;
  --cm-brand: var(--color-primary);
  --cm-brand-300: #fbb477;
  --cm-brand-tint: rgba(245, 134, 52, 0.12);
  --cm-red: #e5564b;
  --cm-red-tint: rgba(229, 86, 75, 0.12);
  --cm-text-100: #f8f8f8;
  --cm-text-300: #cfc9c2;
  --cm-text-500: #9a938b;
  --cm-text-700: #6b655f;
  --cm-btn-ink: #1c1206;
  --cm-shadow-card: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --cm-shadow-glow: 0 10px 30px -8px rgba(245, 134, 52, 0.45);
  --cm-font-display: "Montserrat", system-ui, sans-serif;
  --cm-font-body: "Manrope", system-ui, sans-serif;

  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 140px 20px 192px;
  color: var(--cm-text-100);
  font-family: var(--cm-font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Utilitários ============ */
.calc-milhas .eyebrow {
  font-family: var(--cm-font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3.2px;
  text-transform: uppercase;
  color: var(--cm-brand);
  margin: 0;
}
.calc-milhas .cm-accent { color: var(--cm-brand); }
.calc-milhas .cm-strong { font-family: var(--cm-font-body); font-weight: 700; color: var(--cm-text-100); }

/* ============ FASE 1 — Captura ============ */
.calc-milhas .hero-block {
  border-radius: 22px;
  padding: 40px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: radial-gradient(120% 90% at 50% 100%, rgba(45, 31, 20, 1) 0%, rgba(45, 31, 20, 0) 60%);
}
.calc-milhas .hero-block h1 {
  font-family: var(--cm-font-display);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.1;
  color: var(--cm-text-100);
  margin: 0;
}
.calc-milhas .hero-block .lede {
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.6;
  color: var(--cm-text-300);
  max-width: 1060px;
  margin: 0;
}

.calc-milhas .calc-card {
  margin-top: 8px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--cm-shadow-card);
}
.calc-milhas .money-label {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--cm-text-300);
}
.calc-milhas .money-input {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--cm-input-bg);
  border: 1px solid var(--cm-border);
  border-radius: 10px;
  padding: 14px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.calc-milhas .money-input:focus-within {
  border-color: var(--cm-brand);
  box-shadow: 0 0 0 3px var(--cm-brand-tint);
}
.calc-milhas .money-input .prefix {
  font-family: var(--cm-font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--cm-brand);
}
.calc-milhas .money-input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--cm-font-display);
  font-weight: 700;
  font-size: 32px;
  color: var(--cm-text-100);
}
.calc-milhas .money-input input::placeholder { color: var(--cm-text-700); }

.calc-milhas .hint {
  font-size: 13px;
  color: var(--cm-text-500);
  margin: 0;
}
.calc-milhas .hint.error { color: var(--cm-red); }

.calc-milhas .cm-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  background: var(--cm-brand);
  color: var(--cm-btn-ink);
  font-family: var(--cm-font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 16px 34px;
  border-radius: 999px;
  box-shadow: var(--cm-shadow-glow);
  transition: transform 0.12s ease, filter 0.12s ease;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.calc-milhas .cm-btn:hover { filter: brightness(1.05); transform: translateY(-1px); color: var(--cm-btn-ink); }
.calc-milhas .cm-btn:active { transform: translateY(0); }

.calc-milhas .trust {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.calc-milhas .pill-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--cm-text-300);
}
.calc-milhas .pill-meta .check { color: var(--cm-brand); font-weight: 700; }

/* ============ FASE 3 — Resultado ============ */
.calc-milhas .calc-result {
  display: none;
  flex-direction: column;
  gap: 18px;
}
.calc-milhas .calc-result.open { display: flex; }

.calc-milhas .result-head {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
}

.calc-milhas .step {
  background: var(--cm-surface);
  border: 1px solid var(--cm-border);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--cm-shadow-card);
}
.calc-milhas .step h3 {
  font-family: var(--cm-font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  color: var(--cm-text-100);
  margin: 0;
}
.calc-milhas .step p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--cm-text-300);
  margin: 0;
}
.calc-milhas .step-desc-mobile { display: none; }

.calc-milhas .step-tag {
  display: flex;
  align-items: center;
  gap: 12px;
}
.calc-milhas .step-tag .num {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cm-brand-tint);
  border: 1px solid var(--cm-border-brand);
  border-radius: 10px;
  font-family: var(--cm-font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--cm-brand);
}
.calc-milhas .step-tag .ttl {
  font-family: var(--cm-font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.56px;
  text-transform: uppercase;
  color: var(--cm-brand);
}

/* Breakdown */
.calc-milhas .breakdown {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--cm-border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.calc-milhas .brow {
  background: var(--cm-surface-row);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
}
.calc-milhas .brow .b-main { font-size: 14px; color: var(--cm-text-300); }
.calc-milhas .brow .b-val {
  font-family: var(--cm-font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--cm-text-100);
  text-align: right;
  white-space: nowrap;
}
.calc-milhas .brow.total { background: var(--cm-brand-tint); }
.calc-milhas .brow.total .b-main {
  font-family: var(--cm-font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--cm-brand-300);
}
.calc-milhas .brow.total .b-val {
  font-family: var(--cm-font-display);
  font-weight: 800;
  font-size: 24px;
  color: var(--cm-brand);
}

/* Loss cards */
.calc-milhas .loss {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
}
.calc-milhas .loss-card {
  flex: 1;
  background: var(--cm-red-tint);
  border: 1px solid var(--cm-border);
  border-radius: 16px;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}
.calc-milhas .loss-card .big {
  font-family: var(--cm-font-display);
  font-weight: 800;
  font-size: 60px;
  line-height: 1;
  color: var(--cm-red);
}
.calc-milhas .loss-card .lbl {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1.04px;
  text-transform: uppercase;
  color: var(--cm-text-300);
  line-height: 1.45;
}
.calc-milhas .loss .or {
  font-family: var(--cm-font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--cm-text-700);
}

/* CTA */
.calc-milhas .cta-block {
  border: 1px solid var(--cm-border-brand);
  border-radius: 22px;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  background: linear-gradient(176deg, #2d1f14 9.6%, #1c1a18 89.6%);
  margin-bottom: 64px;
}
.calc-milhas .cta-block .badge {
  background: var(--cm-brand);
  color: var(--cm-btn-ink);
  font-family: var(--cm-font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.54px;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
}
.calc-milhas .cta-block h3 {
  font-family: var(--cm-font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.12;
  color: var(--cm-text-100);
  max-width: 720px;
  margin: 0;
}
.calc-milhas .cta-block p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--cm-text-300);
  max-width: 640px;
  margin: 0;
}
.calc-milhas .cta-block .cm-btn { width: auto; }

/* ============ FASE 2 — Modal overlay ============ */
.cm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.cm-overlay.open { display: flex; }

.cm-dialog {
  position: relative;
  width: 100%;
  max-width: 470px;
  background: #1c1a18;
  border: 1px solid #34302c;
  border-radius: 18px;
  padding: 39px;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  animation: cm-pop 0.22s ease;
  color: #f8f8f8;
  font-family: "Manrope", system-ui, sans-serif;
}
@keyframes cm-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.cm-dialog h2 {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.15;
  color: #f8f8f8;
  margin-bottom: 12px;
}
.cm-dialog .desc {
  font-size: 14px;
  line-height: 1.6;
  color: #cfc9c2;
  margin-bottom: 18px;
}
.cm-dialog .close-x {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: #9a938b;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s ease;
}
.cm-dialog .close-x:hover { color: #f8f8f8; }

.cm-dialog .ready {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #cfc9c2;
  margin-bottom: 16px;
}
.cm-dialog .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(245, 134, 52, 0.6);
  animation: cm-pulse 1.6s infinite;
}
@keyframes cm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 134, 52, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(245, 134, 52, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 134, 52, 0); }
}

.cm-dialog .field { margin-bottom: 14px; }
.cm-dialog .field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cfc9c2;
  margin-bottom: 7px;
}
.cm-dialog .field input {
  width: 100%;
  background: #131313;
  border: 1px solid #34302c;
  border-radius: 10px;
  padding: 13px 15px;
  color: #f8f8f8;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cm-dialog .field input::placeholder { color: #6b655f; }
.cm-dialog .field input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(245, 134, 52, 0.12);
}
.cm-dialog .field input.invalid { border-color: #e5564b; }

.cm-dialog .cm-btn {
  width: 100%;
  border: none;
  cursor: pointer;
  background: var(--color-primary);
  color: #1c1206;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 16px 34px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -8px rgba(245, 134, 52, 0.45);
  transition: transform 0.12s ease, filter 0.12s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.cm-dialog .cm-btn:hover { filter: brightness(1.05); transform: translateY(-1px); color: #1c1206; }

.cm-dialog .privacy {
  font-size: 12px;
  line-height: 1.5;
  color: #9a938b;
  margin-top: 14px;
  text-align: left;
}

/* ============ Mobile ============ */
@media (max-width: 640px) {
  .calc-milhas { padding: 132px 14px 162px; }
  .calc-milhas .calc-card,
  .calc-milhas .step { padding: 22px; }
  .calc-milhas .money-input input { font-size: 26px; }
  .calc-milhas .money-input .prefix { font-size: 22px; }
  .calc-milhas .loss { flex-direction: column; }
  .calc-milhas .loss-card { width: 100%; }
  .calc-milhas .loss-card .big { font-size: 48px; }
  .calc-milhas .cta-block { padding: 32px 22px; }

  /* Parágrafo alternativo do step 1 */
  .calc-milhas .step-desc-desktop { display: none; }
  .calc-milhas .step-desc-mobile { display: block; }

  /* Breakdown — empilha label + valor verticalmente */
  .calc-milhas .brow {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px;
  }
  .calc-milhas .brow .b-val {
    font-size: 16px;
  }
  .calc-milhas .brow.total .b-val {
    font-size: 24px;
  }
}

/* ============ Modal — design exclusivo para smartphones e tablets pequenos (< 728px) ============ */
@media (max-width: 727px) {
  .cm-overlay {
    padding: 12px;
    align-items: center;
    z-index: 1100;
  }

  .cm-dialog {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 22px;
    padding: 32px 22px 28px;
  }

  .cm-dialog h2 {
    font-size: 28px;
    line-height: 1.1;
    margin-bottom: 14px;
  }

  .cm-dialog .privacy {
    text-align: center;
  }
}
