/* Paleta idéntica a la app (Agenda-Personal/client/src/styles.css). */
:root {
  --bg: #0f172a;
  --bg-elev: #1e293b;
  --bg-elev-2: #334155;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --working: #10b981;
  --non-working: #f59e0b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

:root[data-theme='light'] {
  --bg: #f1f5f9;
  --bg-elev: #ffffff;
  --bg-elev-2: #e2e8f0;
  --border: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --working: #059669;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

/* Transición suave de colores SOLO durante el cambio de tema (como en la app). */
.theme-anim, .theme-anim * {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease !important;
}

* { box-sizing: border-box; }

/* scroll-padding-top deja hueco para la cabecera fija: al saltar a #caracteristicas,
   #pro o #precios la sección no queda tapada por el menú. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3, h5 { line-height: 1.2; margin: 0 0 0.5rem; }

a { color: var(--primary); }

/* ---------- Botones ---------- */
.boton {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}
.boton-primario {
  background: var(--primary);
  color: #fff;
}
.boton-primario:hover { background: var(--primary-hover); }
.boton-secundario {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.boton-secundario:hover { background: var(--bg-elev-2); }
.boton-compacto { padding: 0.45rem 0.9rem; }

/* ---------- Cabecera ---------- */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.marca {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.marca-logo { width: 28px; height: 28px; }
.menu {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-left: auto;
}
.menu > a:not(.boton) {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.menu > a:not(.boton):hover { color: var(--text); }

/* Botón hamburguesa: solo visible en móvil (ver media query). */
.menu-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}
.menu-toggle:hover { background: var(--bg-elev-2); }
.menu-toggle svg { width: 18px; height: 18px; }
.cabecera-acciones {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.boton-tema {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}
.boton-tema:hover { background: var(--bg-elev-2); }
.boton-tema svg { width: 18px; height: 18px; }
/* En tema oscuro se ofrece el sol; en claro, la luna. */
.icono-luna { display: none; }
:root[data-theme='light'] .icono-sol { display: none; }
:root[data-theme='light'] .icono-luna { display: block; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) 1.5rem 2rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  margin-bottom: 1rem;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 1.5rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.hero-nota {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 1rem;
}

/* Maqueta de la app (ilustración CSS) */
.mockup {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem;
}
.mock-barra {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}
.mock-punto {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-elev-2);
}
.mock-titulo {
  margin-left: 0.6rem;
  font-size: 0.9rem;
}
.mock-semana {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  padding: 0 0.5rem;
}
.mock-tablero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  padding-top: 0.8rem;
}
.mock-col h5 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.45rem;
}
.mock-nota {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}
.mock-nota .mock-hora {
  display: block;
  font-size: 0.68rem;
  color: var(--primary);
  font-weight: 600;
}
.mock-nota .mock-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}
.t-azul { border-left-color: var(--primary); }
.t-verde { border-left-color: var(--working); }
.t-ambar { border-left-color: var(--non-working); }
.t-rojo { border-left-color: var(--danger); }
.mock-prio::before {
  content: '! ';
  color: var(--danger);
  font-weight: 700;
}
.mock-hecha {
  opacity: 0.55;
  text-decoration: line-through;
}
.mock-aviso {
  position: absolute;
  right: -0.8rem;
  bottom: -1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
}
.mock-aviso svg {
  width: 16px;
  height: 16px;
  color: var(--non-working);
}

/* ---------- Secciones ---------- */
.seccion {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
}
.seccion h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
}
.seccion-sub {
  color: var(--muted);
  text-align: center;
  max-width: 620px;
  margin: 0 auto 2.2rem;
}

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}
.tarjeta {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.tarjeta > svg {
  width: 26px;
  height: 26px;
  color: var(--primary);
  margin-bottom: 0.6rem;
}
.tarjeta h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.tarjeta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Sección Pro ---------- */
.seccion-pro {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 6%, var(--bg));
  max-width: none;
}
.seccion-pro .rejilla,
.seccion-pro .pro-cabecera {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.pro-chip {
  display: inline-block;
  vertical-align: middle;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  margin-left: 0.3rem;
}
.precio-destacado { color: var(--primary); }
.tarjeta-pro > svg { color: var(--working); }

/* ---------- Tabla comparativa ---------- */
.tabla-envoltura {
  overflow-x: auto;
  margin-bottom: 2.5rem;
}
.tabla-comparativa {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 480px;
}
.tabla-comparativa th,
.tabla-comparativa td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-size: 0.92rem;
}
.tabla-comparativa td:first-child,
.tabla-comparativa th:first-child {
  text-align: left;
}
.tabla-comparativa thead th {
  background: var(--bg-elev-2);
  font-size: 0.95rem;
}
.tabla-comparativa tbody tr:last-child td { border-bottom: none; }
.tabla-comparativa .si { color: var(--working); font-weight: 700; }
.tabla-comparativa .no { color: var(--muted); }
.tabla-comparativa .col-pro { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.fila-precio td { font-size: 1rem; }

/* ---------- Planes ---------- */
.planes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  max-width: 760px;
  margin: 0 auto;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.plan-destacado {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.plan-insignia {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
}
.plan h3 { font-size: 1.2rem; }
.plan-precio {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.2rem 0;
}
.plan-precio span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}
.plan-desc {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
}
.plan ul {
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
  flex: 1;
}
.plan li {
  padding-left: 1.4rem;
  position: relative;
  font-size: 0.92rem;
  margin-bottom: 0.45rem;
}
.plan li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--working);
  font-weight: 700;
}
.letra-pequena {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1.8rem;
}

/* ---------- Pie ---------- */
.pie {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.pie-marca {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.pie-nav {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 0.6rem;
}
.pie-nav a {
  color: var(--muted);
  text-decoration: none;
}
.pie-nav a:hover { color: var(--text); }
.pie p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  /* Menú colapsable: aparece la hamburguesa y el menú se despliega debajo. */
  .menu-toggle { display: grid; }
  .cabecera-acciones { margin-left: auto; }
  .menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    margin: 0;
    padding: 0.6rem clamp(1rem, 4vw, 2.5rem) 1rem;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .cabecera.menu-abierto .menu {
    display: flex;
  }
  .menu > a:not(.boton) {
    padding: 0.6rem 0.2rem;
  }
  .menu .boton {
    display: block;
    text-align: center;
  }
  .menu .boton-secundario {
    margin-top: 0.3rem;
  }

  .hero { grid-template-columns: 1fr; }
  .mockup { margin-bottom: 1.5rem; }
  .mock-aviso { right: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .theme-anim, .theme-anim * { transition: none !important; }
}
