/* =========================================================
   MesaPara3 — Sistema de diseño de la web oficial
   Basado en src/styles/theme.js de la app MesaPara3
   (cabecera y pie azul marino, degradado azul → turquesa → verde)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800&display=swap');

:root {
  /* --- Paleta (idéntica a theme.js) --- */
  --color-primary: #20A4A6;        /* turquesa */
  --color-secondary: #375BA7;      /* azul corporativo */
  --color-bg: #FFFFFF;
  --color-surface: #F8FAFC;        /* blanco azulado */
  --color-text: #123B78;           /* azul intenso */
  --color-text-muted: #3f5d83;     /* azul suave */
  --color-border: #D5E6F2;
  --color-avatar-bg: #E1F5F2;      /* verde agua muy suave */

  --color-bar: #061F3B;            /* barras oscuras (header / footer) */
  --color-on-bar: #FFFFFF;
  --color-on-bar-muted: rgba(255, 255, 255, 0.72);
  --color-azulito: #40D5F1;
  --color-verde: #47AE79;
  --color-turquesaclaro: #46ebc7;
  --color-mint: #EDF8F8;

  --gradient-brand: linear-gradient(90deg, #375BA7 0%, #20A4A6 50%, #44AD74 100%);
  --gradient-critico: linear-gradient(90deg, #375BA7 0%, #1E293B 100%);
  --gradient-disabled: linear-gradient(90deg, #CCCCCC 0%, #AFAFAF 100%);
  --gradient-wash: radial-gradient(circle at 15% 15%, rgba(32,164,166,0.10), transparent 65%),
                   radial-gradient(circle at 85% 25%, rgba(55,91,167,0.09), transparent 60%);

  /* --- Tipografía (la de la app: Roboto) --- */
  --font-display: 'Roboto', system-ui, -apple-system, sans-serif;
  --font-body: 'Roboto', system-ui, -apple-system, sans-serif;

  /* --- Espaciado y forma --- */
  --radius-sm: 8px;                /* igual que BotonGradiente */
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-soft: 0 4px 18px rgba(18, 59, 120, 0.08);
  --shadow-lift: 0 10px 28px rgba(55, 91, 167, 0.22);
  --shadow-bar: 0 8px 24px rgba(6, 31, 59, 0.35);
  --container: 1120px;
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
h1 { font-weight: 800; }

p { margin: 0 0 1em; color: var(--color-text); }
.text-muted { color: var(--color-text-muted); }

/* Texto con degradado de marca (como "buen plan." en la app) */
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Foco visible para teclado */
:focus-visible {
  outline: 3px solid var(--color-azulito);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 88px 0; }
@media (max-width: 720px) { section { padding: 56px 0; } }
@media (max-width: 480px) {
  section { padding: 40px 0; }
  .container { padding: 0 18px; }
}

/* ---------- Motivo de marca: los 3 puntos de la mesa ---------- */
.mesa-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
}
.mesa-mark span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-secondary);
}
.mesa-mark span:nth-child(2) { background: var(--color-primary); }
.mesa-mark span:nth-child(3) { background: var(--color-verde); }
.mesa-mark span:nth-child(n+4) { display: none; } /* por si el HTML aún trae 4 puntos */

.mesa-divider {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 auto 20px;
  width: fit-content;
}
.mesa-divider span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-border);
}
.mesa-divider span.on { background: var(--gradient-brand); }

.brand-logo {
  height: 46px;
  width: 46px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;           /* el logo va sobre círculo blanco, como en la app */
  padding: 2px;
}
.eyebrow-logo { height: 20px; width: auto; }
.cta-logo { height: 110px; width: auto; margin: 0 auto 16px; display: block; }

/* ---------- Header (barra azul marino, como la cabecera de la app) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bar);
  color: var(--color-on-bar);
  border-bottom: 2px solid var(--color-verde);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  color: var(--color-on-bar);
  text-decoration: none;
  transition: opacity .2s ease;
}
.site-header .brand:hover { opacity: .85; }
.brand .num,
.brand-3 { color: var(--color-verde); }  /* el "3" en verde, como en la app */

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.main-nav a {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: .95rem;
  font-weight: 500;
  color: var(--color-on-bar-muted);
  transition: background .18s ease, color .18s ease;
}
.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, 0.10);
  color: var(--color-on-bar);
}
.header-cta { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-on-bar);
  margin: 5px 0;
  border-radius: 2px;
}

@media (max-width: 420px) {
  .header-cta .btn-gradient.btn-sm { display: none; }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--color-bar);
    border-bottom: 2px solid var(--color-verde);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    display: none;
    box-shadow: var(--shadow-bar);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 16px; }
  .nav-toggle { display: block; }
}

/* ---------- Botones (estilo BotonGradiente) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  min-height: 50px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn-gradient {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-lift);
}
.btn-gradient:hover { transform: translateY(-2px); opacity: .92; }
.btn-gradient:active { opacity: .85; transform: none; }  /* como buttonPressed */
.btn-critico {
  background: var(--gradient-critico);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-secondary); }
/* Estado deshabilitado: degradado gris pálido */
.btn[disabled],
.btn.is-disabled {
  background: var(--gradient-disabled);
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}
.btn-sm { padding: 10px 18px; min-height: 42px; font-size: .9rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 18px 36px; font-size: 1.05rem; border-radius: 12px; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 64px;
  background: var(--color-mint);
  position: relative;
  overflow: hidden;
}
/* Panel redondeado claro, como la tarjeta del titular en la app */
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 56px 48px;
}
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; padding: 40px 28px; }
}
@media (max-width: 640px) {
  .hero { padding: 32px 0 32px; }
  .hero .container { padding: 32px 20px; gap: 36px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; text-align: center; }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.hero .lede { font-size: 1.15rem; color: var(--color-text-muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; align-items: center; margin-top: 32px; flex-wrap: wrap; }
.store-note { font-size: .82rem; color: var(--color-text-muted); }

/* Mock de teléfono (sin capturas reales todavía) */
.phone-mock {
  justify-self: center;
  width: 260px;
  max-width: 78vw;
  aspect-ratio: 260/540;
  height: auto;
  border-radius: 40px;
  background: var(--color-bar);
  padding: 12px;
  box-shadow: 0 30px 60px rgba(6, 31, 59, 0.30);
  position: relative;
}
.phone-mock .screen {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  background: var(--color-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone-mock .screen-top {
  padding: 20px 18px 14px;
  background: var(--color-bar);
  border-bottom: 2px solid var(--color-verde);
  color: #fff;
}
.phone-mock .screen-body { padding: 16px; display: grid; gap: 10px; }
.phone-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.plan-card-mock {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--color-border);
}
.plan-card-mock .bar { height: 8px; border-radius: 4px; background: var(--color-border); margin-bottom: 6px; }
.plan-card-mock .bar.w60 { width: 60%; }
.plan-card-mock .bar.w40 { width: 40%; background: var(--gradient-brand); height: 6px; }

/* ---------- Tarjetas / grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-bg, #1e1e2f);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card h3 { color: var(--color-text); }
.card p { color: var(--color-text-muted); }
/* Icono en círculo verde agua, como los avatares de las tarjetas de la app */
.card .icon-dot {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--color-avatar-bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head.left { margin: 0 0 40px; text-align: left; }

/* ---------- Secciones con fondo de color mint ----------*/
.section-tint{
  background: var(--color-mint);
}

/* ---------- Pasos numerados (cómo funciona) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  display: block;
}

/* ---------- Franja CTA (azul marino, como las barras de la app) ---------- */
.cta-band {
  background: var(--color-bar);
  color: #fff;
  border: 2px solid var(--color-verde);
  border-radius: var(--radius-lg);
  padding: 56px;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--color-on-bar-muted); }
@media (max-width: 640px) {
  .cta-band { padding: 36px 24px; border-radius: var(--radius-md); }
  .btn-lg { width: 100%; padding: 16px 24px; font-size: 1rem; }
}

/* Tarjetas que son enlaces (interactivas) */
a.card {
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

/* Efecto hover atractivo solo para las tarjetas que son enlaces */
a.card:hover {
  border-color: var(--primary-color, #375BA7); /* El color de acento que uses */
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-action {
  display: inline-block;
  margin-top: 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-color, #375BA7); /* Color corporativo o de acento */
  transition: transform 0.2s ease;
}

/* Pequeño detalle: la flecha se mueve un poquito a la derecha al pasar el ratón */
a.card:hover .card-action {
  transform: translateX(4px);
}

/* ---------- Formularios ---------- */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 6px;
  color: var(--color-text);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(32, 164, 166, 0.18);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 140px; }
.checkbox-field { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 24px; }
.checkbox-field input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--color-primary); }
.checkbox-field label { font-weight: 400; font-size: .9rem; color: var(--color-text-muted); }
.form-note { font-size: .82rem; color: var(--color-text-muted); margin-top: 10px; }
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-success, .form-error {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 20px;
  display: none;
}
.form-success { background: #ECFDF5; color: #047857; }
.form-error { background: #FEF2F2; color: #B91C1C; }

.field-error {
  display: none;
  margin-top: .35rem;
  font-size: .875rem;
  color: #d93025; /* cámbialo por el rojo de tu paleta */
}

.is-invalid {
  border-color: #d93025;
}

/* ---------- Guía de uso: mock de pantallas ---------- */
.screen-guide {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  max-width: 620px;
  margin: 0 auto 56px;
}
.screen-guide-text { max-width: 320px; padding-top: 4px; }
@media (max-width: 780px) {
  .screen-guide { flex-direction: column !important; align-items: center; text-align: center; gap: 20px; }
  .screen-guide-text { max-width: 100%; text-align: left; }
}
.screen-frame {
  width: 200px;
  height: 400px;
  flex: none;
  margin: 0 auto;
  border-radius: 28px;
  background: var(--color-bar);
  padding: 10px;
}
.screen-frame .inner {
  width: 100%; height: 100%;
  border-radius: 20px;
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  font-size: .8rem;
  text-align: center;
  padding: 12px;
}
@media (max-width: 480px) {
  .screen-frame { width: 160px; height: 320px; }
}

/* ---------- Empresas: lista de sectores ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.chip {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-avatar-bg);
  border: 1px solid var(--color-border);
  font-size: .88rem;
  font-weight: 500;
  color: var(--color-text);
}

/* ---------- Barra de progreso de aportaciones ----------- */
.goal-card {
  background: #fff;
  border: 1px solid rgba(18, 59, 120, 0.1);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 30px rgba(18, 59, 120, 0.08);
}
.goal-progress {
  height: 18px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 24px;
}
.goal-progress-fill {
  height: 100%;
  width: var(--pct, 24%);
  min-width: 18px;                 /* que se vea siempre, aunque el % sea pequeño */
  border-radius: 999px;
  background: linear-gradient(90deg, #20A4A6, #375BA7);
  animation: goal-fill 1.2s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes goal-fill {
  from { width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .goal-progress-fill { animation: none; }
}
.goal-numbers {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #123B78;
}
.goal-note { margin-top: 12px; color: #475569; font-size: .95rem; }
@media (prefers-reduced-motion: reduce) {
  .goal-progress-fill { transition: none; }
}

/* ---------- Insignias (nivel 0 gris → nivel 3 dorado) ---------- */
.badge-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
}
.badge-icon.lvl-1 { background: linear-gradient(135deg, #a2eaf7, #00ca92); color: #00ca92; }
.badge-icon.lvl-2 { background: linear-gradient(135deg, #7ff0f1, #135caf); color: #061f3b; }
.badge-icon.lvl-3 { background: linear-gradient(135deg, #ebd993, #ffe066); color: #f5a300; }

.badge-card { text-align: left; }
.badge-levels { display: flex; gap: 8px; margin-top: 14px; }
.badge-pip { width: 22px; height: 6px; border-radius: 999px; }
.badge-pip.lvl-1 { background: linear-gradient(90deg, #40D5F1, #00ca92); }
.badge-pip.lvl-2 { background: linear-gradient(90deg, #135caf, #061f3b ) }
.badge-pip.lvl-3 { background: linear-gradient(90deg, #ffe066, #f5a300); }

/* ---------- Legal ---------- */
.legal-content h2 { margin-top: 2em; font-size: 1.3rem; }
.legal-content h3 { font-size: 1.05rem; margin-top: 1.6em; }
.legal-content { max-width: 760px; }
.legal-content ul { padding-left: 1.3em; }
.legal-updated { color: var(--color-text-muted); font-size: .88rem; margin-bottom: 40px; }

/* ---------- Footer (barra azul marino, como la barra inferior de la app) ---------- */
.site-footer {
  background: var(--color-bar);
  color: var(--color-on-bar);
  border-top: 2px solid var(--color-verde);
  padding: 64px 0 32px;
}
.site-footer .brand{
  color: var(--color-bg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer .brand { font-size: 1.25rem; }
.site-footer p { color: var(--color-on-bar-muted); }
.footer-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--color-turquesaclaro);
  margin: 0 0 14px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--color-on-bar); font-size: .94rem; }
.footer-grid a:hover { color: var(--color-turquesaclaro); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .84rem;
  color: var(--color-on-bar-muted);
}
.footer-bottom a {
  text-decoration: underline;
  color: var(--color-on-bar);
}
.footer-bottom a:hover { color: var(--color-turquesaclaro); }

/* ---------- Botón "volver arriba" ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-bar);
  background: var(--gradient-brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-bar);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 60;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover { transform: translateY(-2px); opacity: .92; }

@media (max-width: 720px) {
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity .15s ease; }
}

/* ---------- Utilidades ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-bg);
  margin-bottom: 14px;
}
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
/* Subraya los enlaces dentro de párrafos, etiquetas y tarjetas */
.card p a,
.checkbox-field label a {
  text-decoration: underline;
  color: var(--color-secondary);
}