/**
 * Estilos calculadora.autoapunte.com
 *
 * Paleta coherente con autoapunte.com (--primary #00C68E, fondo emerald-50 sutil,
 * blanco en cards, negro mate de texto) y con landing.autoapunte.com.
 * Inter para cuerpo, Poppins para titulares (mismo patrón que la otra landing).
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700;800&display=swap');

:root {
  --primary: #00C68E;
  --primary-dark: #009970;
  --primary-glow: rgba(0, 198, 142, 0.12);
  --primary-soft: #E6FFF6;

  --bg: #FFFFFF;
  --bg-alt: #F8FDFB;
  --bg-tint: #ECFDF5;

  --text: #0F172A;
  --text-sec: #475569;
  --text-mut: #94A3B8;

  --border: #E2E8F0;
  --border-soft: #F1F5F9;
  --card: #FFFFFF;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* El atributo HTML 'hidden' debe ganar a cualquier display especifico del componente.
   Sin esto, .modal o .info-modal (que son display:flex) aparecen visibles al cargar. */
[hidden] {
  display: none !important;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- NAV --- */

.nav {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.nav-cta {
  padding: 9px 18px;
  background: var(--primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 198, 142, 0.3);
}

/* --- HERO --- */

.hero {
  padding: 72px 0 56px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 100%);
}

.hero-pre {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  max-width: 720px;
  margin: 0 auto 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary-dark);
}

.hero-sub {
  font-size: 17px;
  color: var(--text-sec);
  max-width: 580px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  background: var(--primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  transition: all 0.25s;
  box-shadow: 0 4px 20px rgba(0, 198, 142, 0.3);
}

.hero-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0, 198, 142, 0.4);
}

/* --- CALCULADORA --- */

.calc {
  padding: 48px 0 72px;
}

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 22px;
}

.field label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.field .opt {
  font-weight: 400;
  color: var(--text-mut);
  font-size: 13px;
}

.field .hint {
  font-size: 13px;
  color: var(--text-sec);
  margin-top: 6px;
  line-height: 1.5;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-suffix {
  position: relative;
}

.input-suffix .suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-mut);
  pointer-events: none;
}

.input-suffix input {
  padding-right: 48px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(0, 198, 142, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  background: var(--bg);
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-secondary:hover {
  background: var(--primary-soft);
  text-decoration: none;
}

/* --- RESULTADO --- */

.result-card {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.5s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-title {
  font-size: 22px;
  text-align: center;
  margin-bottom: 28px;
  color: var(--text);
}

.result-row {
  margin-bottom: 24px;
}

.result-row.dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-block {
  background: var(--bg-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}

.result-block-real {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.result-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sec);
  font-weight: 600;
  margin-bottom: 8px;
}

.result-big {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.result-block-real .result-big {
  color: var(--primary-dark);
}

.result-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mut);
  margin-left: 2px;
}

.result-small {
  font-size: 14px;
  color: var(--text-sec);
}

.result-aclaracion {
  text-align: center;
  font-size: 13px;
  color: var(--text-sec);
  font-style: italic;
  padding: 12px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}

.result-explainer {
  text-align: center;
  font-size: 14px;
  color: var(--text-sec);
  margin-bottom: 28px;
  line-height: 1.6;
}

.result-cta {
  text-align: center;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}

.result-cta .btn-primary {
  width: auto;
  padding: 14px 40px;
}

.cta-foot {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-sec);
}

/* --- MODAL POP-UP --- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: scaleIn 0.25s ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: var(--text-mut);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-pre {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary-dark);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.modal-card h2 {
  font-size: 24px;
  margin-bottom: 14px;
  line-height: 1.25;
}

.modal-card h2 strong {
  color: var(--primary-dark);
}

.modal-sub {
  font-size: 14px;
  color: var(--text-sec);
  margin-bottom: 22px;
  line-height: 1.6;
}

#popup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#popup-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

#popup-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-foot {
  font-size: 12px;
  color: var(--text-mut);
  text-align: center;
  margin-top: 14px;
}

.modal-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

/* --- GRACIAS --- */

.gracias {
  padding: 72px 0;
  background: linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 100%);
  min-height: 60vh;
}

.gracias-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.gracias-pre {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--primary-dark);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.gracias-card h1 {
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 18px;
}

.gracias-sub {
  font-size: 17px;
  color: var(--text-sec);
  margin-bottom: 32px;
  line-height: 1.6;
}

.gracias-sub strong {
  color: var(--text);
}

.gracias-quote {
  font-size: 14px;
  color: var(--text-mut);
  margin-bottom: 20px;
}

.gracias-opciones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.opcion {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.opcion h3 {
  font-size: 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.opcion p {
  font-size: 14px;
  color: var(--text-sec);
  margin-bottom: 18px;
  flex-grow: 1;
  line-height: 1.55;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--bg-tint);
  color: var(--primary-dark);
  border: 1px solid var(--primary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.info-icon:hover {
  background: var(--primary-soft);
}

.gracias-help {
  font-size: 14px;
  color: var(--text-sec);
}

/* Info modal (tooltip de los 7 días) */

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.info-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.info-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 26px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

.info-card h4 {
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--text);
}

.info-card p {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.55;
}

/* --- FOOTER --- */

.foot {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  background: var(--bg-alt);
}

.foot p {
  font-size: 13px;
  color: var(--text-mut);
  text-align: center;
}

/* --- RESPONSIVE --- */

@media (max-width: 720px) {
  .container { padding: 0 18px; }

  .calc-card { padding: 24px 20px; }

  .grid-2 { grid-template-columns: 1fr; gap: 0; }
  .grid-2 .field { margin-bottom: 18px; }

  .result-card { padding: 24px 20px; }
  .result-row.dual { grid-template-columns: 1fr; }

  .gracias-card { padding: 32px 22px; }
  .gracias-opciones { grid-template-columns: 1fr; }

  .modal-card { padding: 28px 22px; }
  .modal-card h2 { font-size: 20px; }

  .hero { padding: 56px 0 40px; }
}
