/* ═══════════════════════════════════════════
   SMS PROFIT CALCULATOR — styles.css
   ─────────────────────────────────────────
   Tabla de contenido:
   1. Variables & Reset
   2. Tipografía base
   3. Layout helpers
   4. Navbar
   5. Hero
   6. Sección genérica
   7. Cards de calculadora
   8. Contador de caracteres
   9. Resultados y ROI
   10. Beneficios
   11. Plantillas SMS
   12. Formulario cotización
   13. Footer
   14. Utilidades / botones
   15. Responsive
═══════════════════════════════════════════ */

/* ── 1. Variables & Reset ─────────────────── */
:root {
  --primary:    #2563eb;
  --primary-dk: #1d4ed8;
  --primary-lt: #eff6ff;
  --accent:     #10b981;
  --accent-dk:  #059669;
  --warn:       #f59e0b;
  --danger:     #ef4444;
  --text:       #1e293b;
  --text-muted: #64748b;
  --border:     #e2e8f0;
  --bg:         #f8fafc;
  --white:      #ffffff;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 2. Tipografía ────────────────────────── */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem);   line-height: 1.3; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: .95rem; font-weight: 600; }
p  { color: var(--text-muted); }

/* ── 3. Layout helpers ────────────────────── */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--white);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header p {
  font-size: 1.05rem;
  margin-top: .5rem;
}

/* ── 4. Navbar ────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.5px;
}

.logo span { color: var(--primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--primary); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

/* ── 5. Hero ──────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 60%, #f0fdf4 100%);
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

.badge {
  display: inline-block;
  background: var(--primary-lt);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 100px;
  margin-bottom: 1rem;
  border: 1px solid #bfdbfe;
}

.hero-text h1 {
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-sub {
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 2rem;
}

.hero-ctas {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat strong {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat span {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Phone mockup */
.phone-mockup {
  width: 240px;
  background: #1e293b;
  border-radius: 28px;
  padding: 2rem 1rem 1.5rem;
  box-shadow: var(--shadow-lg), 0 0 0 6px #334155;
  position: relative;
}

.phone-notch {
  width: 60px;
  height: 10px;
  background: #334155;
  border-radius: 10px;
  margin: 0 auto 1rem;
}

.phone-screen {
  background: #f1f5f9;
  border-radius: 16px;
  padding: 1rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.sms-bubble {
  background: var(--white);
  border-radius: 12px 12px 12px 2px;
  padding: .75rem;
  font-size: .82rem;
  line-height: 1.4;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sms-meta {
  font-size: .7rem;
  color: var(--accent);
  font-weight: 600;
  text-align: right;
}

/* ── 6. Cards calculadora ─────────────────── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card-wide {
  grid-column: 1 / -1; /* ocupa todo el ancho */
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.card-icon { font-size: 1.3rem; }
.card-header h3 { margin: 0; font-size: 1rem; }

.card-body {
  padding: 1.5rem;
}

/* ── 7. Textarea y campos ─────────────────── */
label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}

textarea,
input[type="number"],
input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

textarea { resize: vertical; }

textarea:focus,
input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

textarea.over-limit { border-color: var(--danger); }

.input-group { margin-bottom: 1.1rem; }

/* ── 8. Contador de caracteres ────────────── */
.char-stats {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 .75rem;
}

.char-stat {
  flex: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .6rem .5rem;
  text-align: center;
  border: 1px solid var(--border);
}

.char-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.char-num.warn { color: var(--warn); }
.char-num.danger { color: var(--danger); }

.char-label {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Barra de progreso */
.progress-bar-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width .3s ease, background .3s ease;
  width: 0%;
}

.progress-bar.warn   { background: var(--warn); }
.progress-bar.danger { background: var(--danger); }

/* Recomendación */
.recommendation {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  font-size: .88rem;
  color: #166534;
  transition: all .3s ease;
}

.recommendation.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.recommendation.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ── 9. Resultados costo y ROI ────────────── */
.results-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: .5rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 1rem;
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child { border-bottom: none; }
.result-row span { color: var(--text-muted); }
.result-row strong { color: var(--text); font-size: 1rem; }

.result-highlight {
  background: var(--primary-lt);
}

.result-highlight span { color: var(--primary); font-weight: 600; }
.result-highlight strong { color: var(--primary); font-size: 1.1rem; }

/* ROI */
.roi-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.roi-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.roi-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.roi-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  transition: transform var(--transition);
}

.roi-card:hover { transform: translateY(-2px); }

.roi-card-accent {
  background: var(--primary);
  border-color: var(--primary);
}

.roi-card-accent .roi-label { color: rgba(255,255,255,.8); }
.roi-card-accent .roi-value { color: var(--white); }

.roi-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .4rem;
}

.roi-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

/* Botones de acción */
.calc-action {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── 10. Beneficios ───────────────────────── */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.benefit-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.benefit-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.benefit-icon {
  font-size: 2rem;
  margin-bottom: .75rem;
}

.benefit-card h3 { margin-bottom: .4rem; }
.benefit-card p strong { color: var(--primary); }

/* ── 11. Plantillas SMS ───────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.template-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow var(--transition);
}

.template-card:hover { box-shadow: var(--shadow-md); }

.template-tag {
  display: inline-block;
  background: var(--primary-lt);
  color: var(--primary);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: .2rem .6rem;
  border-radius: 100px;
  align-self: flex-start;
}

.template-text {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
  background: var(--bg);
  padding: .75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.template-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.template-chars {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-use-template {
  font-size: .8rem;
  padding: .35rem .85rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-use-template:hover { background: var(--primary-dk); }

/* ── 12. Formulario cotización ────────────── */
.form-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 3rem;
  align-items: start;
}

.form-info h2 { margin-bottom: .75rem; }
.form-info p  { margin-bottom: 1.5rem; }

.form-perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.form-perks li {
  font-size: .95rem;
  color: var(--text);
  font-weight: 500;
}

.quote-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.req { color: var(--danger); }
.optional { color: var(--text-muted); font-weight: 400; font-size: .8rem; }

.field-error {
  display: block;
  font-size: .78rem;
  color: var(--danger);
  margin-top: .25rem;
  min-height: 1em;
}

.form-footer { margin-top: 1.25rem; }

.btn-full { width: 100%; }

.form-disclaimer {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .6rem;
}

.form-success {
  text-align: center;
  padding: 2rem;
}

.form-success .success-icon { font-size: 3rem; margin-bottom: .5rem; }
.form-success h3 { font-size: 1.3rem; margin-bottom: .4rem; color: var(--accent-dk); }
.form-success p { color: var(--text-muted); }

/* ── 13. Footer ───────────────────────────── */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #1e293b;
}

.footer-brand p { margin-top: .6rem; font-size: .9rem; max-width: 280px; }
.footer-brand .logo { color: var(--white); font-size: 1.2rem; }
.footer-brand .logo span { color: #60a5fa; }

.footer-links {
  display: flex;
  gap: 3rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul a { color: #94a3b8; font-size: .9rem; transition: color var(--transition); }
.footer-col ul a:hover { color: var(--white); text-decoration: none; }

.footer-bottom {
  padding: 1.25rem 0;
}

.footer-bottom p {
  font-size: .82rem;
  text-align: center;
  color: #475569;
}

/* ── 14. Botones ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dk);
  border-color: var(--primary-dk);
  text-decoration: none;
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  text-decoration: none;
  color: var(--text);
}

.btn-lg {
  padding: .85rem 2rem;
  font-size: 1rem;
}

/* ── 15. Responsive ───────────────────────── */
@media (max-width: 900px) {
  /* Calculadora */
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .card-wide { grid-column: auto; }

  /* ROI inputs */
  .roi-inputs { grid-template-columns: 1fr; }
  .roi-results { grid-template-columns: repeat(2, 1fr); }

  /* Beneficios */
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }

  /* Plantillas */
  .templates-grid { grid-template-columns: 1fr; }

  /* Formulario */
  .form-wrapper { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* Hero */
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 1.5rem; }
}

@media (max-width: 600px) {
  /* Nav */
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: .5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .navbar { position: sticky; }

  /* Hero stats */
  .hero-stats { gap: 1rem; }
  .stat strong { font-size: 1.3rem; }

  /* Char stats */
  .char-stats { gap: .5rem; }
  .char-num { font-size: 1.3rem; }

  /* ROI */
  .roi-results { grid-template-columns: 1fr 1fr; }

  /* Beneficios */
  .benefits-grid { grid-template-columns: 1fr; }

  /* Secciones */
  .section { padding: 3rem 0; }
  .hero { padding: 3rem 0 2.5rem; }

  /* Botones hero */
  .hero-ctas { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .calc-action .btn { width: auto; }
}
