:root {
  --bg-main: #050816;
  --bg-section: #0b1020;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --radius-lg: 18px;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.6);
  --transition-fast: 0.18s ease-out;
  --container-width: 1080px;

  /* ✅ añadido: breakpoints coherentes */
  --bp-desktop: 1024px;
  --bp-tablet: 900px;
  --bp-mobile: 560px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #020617 45%, #000 100%);
  color: var(--text-main);
  line-height: 1.5;
}

/* ✅ añadido: imágenes/medios responsive + evitar desbordes */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}
body {
  overflow-x: hidden;
}

/* Layout base */

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.8),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo */

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 28px;
}

.logo-bar {
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(to top, #0ea5e9, #38bdf8);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.bar-1 {
  height: 12px;
  opacity: 0.7;
}
.bar-2 {
  height: 18px;
  opacity: 0.9;
}
.bar-3 {
  height: 24px;
}

.logo-wordmark {
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  gap: 0.1rem;
  font-size: 1rem;
}

.logo-word-mi {
  color: #e5e7eb;
}

.logo-word-cuota {
  background: linear-gradient(to right, #38bdf8, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Nav */

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.nav a:hover {
  color: var(--text-main);
  background: rgba(31, 41, 55, 0.8);
  transform: translateY(-1px);
}

/* Hero */

.hero {
  padding: 4rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-text h1 {
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.hero-subtitle {
  color: var(--text-muted);
  max-width: 32rem;
  margin-bottom: 1.3rem;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.pill {
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.hero-extra {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.hero-extra h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.hero-extra ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Cards */

.card {
  background: radial-gradient(circle at top left, #1f2937 0, #020617 70%);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.3);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at top,
    rgba(56, 189, 248, 0.12),
    transparent 55%
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none; /* no bloquea inputs */
}

.card:hover::before {
  opacity: 1;
}

.card h2,
.card h3 {
  margin-top: 0;
}

/* Calculator */

.calculator-card h2 {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ✅ añadido: inputs no desbordan, mejor en móvil */
input,
textarea {
  width: 100%;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  padding: 0.55rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
}

/* Botones */

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1.5rem;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast);
}

/* ✅ añadido: botones wrap en móvil sin romper layout */
.btn-primary,
.btn-secondary {
  max-width: 100%;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(to right, #38bdf8, #0ea5e9);
  color: #0b1120;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 35px rgba(56, 189, 248, 0.7);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.btn-secondary:hover {
  background: rgba(31, 41, 55, 0.95);
}

/* Resultado */

.result-container {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.6);
  text-align: center;
}

.result-label {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-value {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.result-details {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.error-message {
  margin-top: 0.7rem;
  color: var(--danger);
  font-size: 0.85rem;
}

.hidden {
  display: none;
}

/* Secciones */

.section {
  padding: 3rem 0;
}

.section-alt {
  background: radial-gradient(circle at top, #020617 0, #020617 50%, #000 100%);
}

.section h2 {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 40rem;
  margin-bottom: 1.8rem;
}

/* Cards info */

/* ✅ SUSTITUCIÓN CLAVE:
   - en PC (>= 1024px): SIEMPRE 3 columnas (3 + 3)
   - tablet: 2 columnas
   - móvil: 1 columna
   Esto se aplica a TODOS los grids de "cuadros" que usen .cards-grid
*/
.cards-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* ✅ 3 + 3 en escritorio */
}

/* Tablet */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Móvil */
@media (max-width: 560px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: radial-gradient(circle at top left, #1e293b 0, #020617 65%);
}

/* ✅ Links dentro de cards (para que no parezcan links feos) */
.info-card a {
  color: var(--text-main);
  text-decoration: none;
}

.info-card a:hover {
  text-decoration: underline;
}

/* FAQ */

.faq {
  margin-top: 2rem;
}

.faq-item + .faq-item {
  margin-top: 0.8rem;
}

.faq-item h4 {
  margin: 0 0 0.2rem;
}

/* Contacto */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: flex-start;
}

/* ✅ añadido: formulario/contacto no desborda */
.contact-grid > * {
  min-width: 0;
}

.contact-email a {
  color: var(--accent);
  text-decoration: none;
}

.contact-email a:hover {
  text-decoration: underline;
}

/* Footer */

.footer {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1.3rem 0 1.6rem;
  background: rgba(2, 6, 23, 0.95);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ✅ añadido: evitar desbordes en footer */
.footer-content > * {
  min-width: 0;
}

.footer-links {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text-main);
}

/* Aviso legal / privacidad / sobre */

.legal-body {
  background: radial-gradient(circle at top, #020617 0, #000 70%);
}

.legal-content h1 {
  margin-bottom: 1.2rem;
}

.legal-content h2 {
  margin-top: 1.6rem;
  margin-bottom: 0.4rem;
}

.legal-content p {
  color: var(--text-muted);
  margin: 0.4rem 0;
}

/* ✅ Disclaimer bajo calculadora (AdSense / YMYL) */
.disclaimer {
  margin-top: 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(156, 163, 175, 0.95);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
}

/* ✅ mantenemos tu override específico por si lo usas (no estorba)
   pero ya no es necesario para 3+3 porque .cards-grid ya es 3 columnas */
.cards-grid.guides-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .cards-grid.guides-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Responsive general */
@media (max-width: 840px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: 3rem;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    height: auto;
    padding: 0.7rem 0;
  }

  /* ✅ NAV en móvil: fila scrollable y limpia */
  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .nav a {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
  }

  /* ✅ botones: en móvil mejor en columna si van juntos */
  .section-intro .btn-secondary {
    margin-left: 0 !important;
    margin-top: 0.6rem;
  }
}

@media (max-width: 520px) {
  .cards-grid.guides-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.8rem;
  }
  .card {
    padding: 1.3rem 1.1rem;
  }

  .result-value {
    font-size: 2rem;
  }
}
/* =========================
   RECURSOS (HOME) – NUEVO
   ========================= */

.resources-grid {
  /* ya hereda display:grid y 3+3 por .cards-grid */
}

.resource-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.10), rgba(2, 6, 23, 0.95) 55%);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.resource-card::before {
  content: "";
  position: absolute;
  inset: -55%;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.resource-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 22px 55px rgba(2, 6, 23, 0.75);
}

.resource-card:hover::before {
  opacity: 1;
}

.resource-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.resource-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #7dd3fc;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.12);
  flex: 0 0 auto;
}

.resource-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.resource-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Botón dentro de la card (usa tu .btn-secondary pero ajustamos look) */
.resource-card .btn-secondary {
  margin-top: 0.25rem;
  width: fit-content;
  padding: 0.45rem 1.05rem;
  font-size: 0.86rem;
}

/* Actions bajo el grid */
.resources-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Botón ghost (nuevo) */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-main);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), border-color var(--transition-fast);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  background: rgba(31, 41, 55, 0.75);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.6);
}

.resources-disclaimer {
  margin-top: 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(156, 163, 175, 0.92);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
}

/* Ajustes móviles */
@media (max-width: 560px) {
  .resource-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .resource-card {
    padding: 1.2rem 1.05rem;
  }

  .resources-actions a {
    width: 100%;
    justify-content: center;
  }
}
