/*
 * Tu Casa Smart - Modern Design System
 * Strictly zero emojis. Icons use inline SVG only.
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-primary-light: #ecfdf5;
  --color-accent: #0f172a;
  --color-accent-hover: #1e293b;
  --color-ink: #0b1120;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --radius-sm: 0.625rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, 0.22);
}

/* Theme tokens per campaign line */
body[data-campaign-line="ahorro-energia"] {
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-primary-light: #ecfdf5;
  --color-accent: #0f172a;
  --color-accent-hover: #1e293b;
}

body[data-campaign-line="confort-facil"] {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-accent: #d97706;
  --color-accent-hover: #b45309;
}

body[data-campaign-line="accesibilidad-adultos-mayores"] {
  --color-primary: #0f766e;
  --color-primary-dark: #115e59;
  --color-primary-light: #f0fdfa;
  --color-accent: #b45309;
  --color-accent-hover: #92400e;
  --color-text-muted: #475569;
  font-size: 1.125rem; /* 18px base for senior readability */
  line-height: 1.7;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--color-text-main);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--color-text-main); letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* Section scaffolding */
.section { padding: 5.5rem 0; }
.section-dark { background: var(--color-ink); color: #cbd5e1; }
.section-dark h2, .section-dark h3 { color: #ffffff; }
.section-white { background: var(--color-surface); }
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.2; margin-bottom: 0.875rem; }
.section-head p { font-size: 1.0625rem; color: var(--color-text-muted); }
.section-dark .section-head p { color: #94a3b8; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.section-dark .eyebrow { color: #6ee7b7; }
body[data-campaign-line="confort-facil"] .section-dark .eyebrow { color: #93c5fd; }
body[data-campaign-line="accesibilidad-adultos-mayores"] .section-dark .eyebrow { color: #5eead4; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8125rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 8px 20px -8px var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-accent { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-md); }
.btn-accent:hover { background: var(--color-accent-hover); }
.btn-outline { background: transparent; color: var(--color-text-main); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-text-main); }
.btn-ghost-light { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.2); }
.btn-lg { padding: 1rem 1.875rem; font-size: 1rem; }
.btn-sm { padding: 0.625rem 1rem; font-size: 0.8125rem; }
.btn-block { width: 100%; white-space: normal; }
body[data-campaign-line="accesibilidad-adultos-mayores"] .btn { font-size: 1.0625rem; padding: 1rem 1.75rem; }

/* Header */
.header-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 1rem; }
.logo-area { display: flex; align-items: center; gap: 0.625rem; font-family: var(--font-display); font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--color-ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.logo-area small { font-family: var(--font-body); font-weight: 500; font-size: 0.8125rem; color: var(--color-text-muted); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; font-size: 0.9375rem; font-weight: 500; color: var(--color-text-muted); }
.nav-links a:hover { color: var(--color-text-main); }

/* Hero */
.hero-section {
  position: relative;
  padding: 4.5rem 0 5rem;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--color-primary-light), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--color-bg) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3.5rem; align-items: center; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--color-surface);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-light); }
.hero-headline { font-size: clamp(2.25rem, 4vw + 0.5rem, 3.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 1.25rem; }
.hero-headline .highlight { color: var(--color-primary); }
.hero-subtitle { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--color-text-muted); max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.875rem; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2.75rem; padding-top: 1.75rem; border-top: 1px solid var(--color-border); max-width: 560px; }
.metric-value { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--color-text-main); letter-spacing: -0.02em; }
.metric-label { font-size: 0.8125rem; color: var(--color-text-muted); line-height: 1.4; }

.hero-visual { position: relative; }
.hero-visual::before {
  content: ""; position: absolute; inset: 8% -6% -6% 8%;
  background: var(--color-primary); opacity: 0.12; border-radius: var(--radius-lg); filter: blur(40px); z-index: 0;
}
.hero-visual-frame {
  position: relative; z-index: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 4.4;
}
.hero-visual-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-floating-card {
  position: absolute; z-index: 2;
  left: 1.25rem; right: 1.25rem; bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.875rem;
  background: rgba(11, 17, 32, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
}
.floating-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: var(--color-primary); display: flex; align-items: center; justify-content: center; }
.floating-title { font-weight: 700; font-size: 0.9375rem; line-height: 1.3; }
.floating-sub { font-size: 0.8125rem; color: #cbd5e1; }
.floating-tag { margin-left: auto; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.25rem 0.5rem; border-radius: 6px; background: rgba(255,255,255,0.12); white-space: nowrap; }

/* Bento grid */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.bento-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bento-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.bento-card h3 { font-size: 1.1875rem; margin: 1.25rem 0 0.625rem; line-height: 1.3; }
.bento-card p { color: var(--color-text-muted); font-size: 0.9688rem; }
.icon-squircle { width: 48px; height: 48px; border-radius: 14px; background: var(--color-primary-light); color: var(--color-primary); display: flex; align-items: center; justify-content: center; }
.bento-card.problem .icon-squircle { background: #fef2f2; color: #dc2626; }

.section-dark .bento-card { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
.section-dark .bento-card p { color: #94a3b8; }
.section-dark .icon-squircle { background: rgba(255,255,255,0.08); color: #ffffff; }
.bento-card.wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; padding: 0; overflow: hidden; }
.bento-card.wide .bento-body { padding: 2.25rem; }
.bento-card.wide img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; }
.bento-number { font-family: var(--font-display); font-size: 2.75rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; line-height: 1; }

/* Packages */
.cards-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; align-items: stretch; }
.package-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.75rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}
.package-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.package-card.featured { border: 2px solid var(--color-primary); box-shadow: var(--shadow-lg); }
.package-img-wrapper { position: relative; aspect-ratio: 16 / 11; border-radius: calc(var(--radius-lg) - 0.5rem); overflow: hidden; background: var(--color-ink); }
.package-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.package-card:hover .package-img-wrapper img { transform: scale(1.04); }
.package-circuits {
  position: absolute; top: 0.75rem; left: 0.75rem;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(255,255,255,0.92); color: var(--color-text-main);
  padding: 0.3125rem 0.625rem; border-radius: 999px;
}
.package-badge-tag {
  position: absolute; top: 0.75rem; right: 0.75rem;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--color-primary); color: #fff;
  padding: 0.3125rem 0.625rem; border-radius: 999px;
}
.package-body { padding: 1.25rem 0.75rem 0; display: flex; flex-direction: column; flex: 1; }
.package-body h3 { font-size: 1.125rem; line-height: 1.3; }
.package-tagline { font-size: 0.875rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.package-price { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 1rem; line-height: 1.1; }
.package-price span { font-size: 0.875rem; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0; }
.package-subprice { font-size: 0.8125rem; color: var(--color-primary-dark); font-weight: 600; margin-top: 0.25rem; }
.package-features { list-style: none; margin: 1.25rem 0 1.5rem; display: flex; flex-direction: column; gap: 0.625rem; font-size: 0.875rem; color: #334155; flex: 1; }
.package-features li { display: flex; align-items: flex-start; gap: 0.5rem; }
.package-features svg { flex: 0 0 auto; color: var(--color-primary); margin-top: 2px; }
body[data-campaign-line="accesibilidad-adultos-mayores"] .package-features { font-size: 1rem; }

/* Consultation split */
.consultation-split { display: grid; grid-template-columns: 1fr 1.05fr; gap: 3rem; align-items: start; }
.consultation-photo { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 16 / 11; margin-bottom: 2rem; }
.consultation-photo img { width: 100%; height: 100%; object-fit: cover; }
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.steps-list li { display: flex; gap: 1rem; align-items: flex-start; }
.step-number {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  background: var(--color-ink); color: #fff;
  font-family: var(--font-display); font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.steps-list h3 { font-size: 1.0625rem; margin-bottom: 0.25rem; }
.steps-list p { color: var(--color-text-muted); font-size: 0.9375rem; }

.form-section-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
  position: sticky; top: 96px;
}
.form-section-wrapper h2 { font-size: 1.625rem; line-height: 1.25; margin-bottom: 0.5rem; }
.form-intro { color: var(--color-text-muted); font-size: 0.9375rem; margin-bottom: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.375rem; text-align: left; }
.form-label { font-size: 0.8125rem; font-weight: 600; color: #334155; }
body[data-campaign-line="accesibilidad-adultos-mayores"] .form-label { font-size: 1rem; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.8125rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text-main);
  background: #f8fafc;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--color-primary); background: #fff;
  box-shadow: 0 0 0 4px var(--color-primary-light);
}
.form-error-feedback { display: none; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 600; font-size: 0.875rem; }
.form-footnote { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1rem; font-size: 0.8125rem; color: var(--color-text-muted); }

/* FAQ */
.faq-accordion { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; transition: box-shadow 0.2s ease; }
.faq-item.active { box-shadow: var(--shadow-md); }
.faq-trigger {
  width: 100%; padding: 1.25rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; color: var(--color-text-main); text-align: left;
}
.faq-content { display: none; padding: 0 1.5rem 1.375rem; color: var(--color-text-muted); font-size: 0.9688rem; line-height: 1.7; }
.faq-item.active .faq-content { display: block; }
.faq-icon { flex: 0 0 auto; transition: transform 0.2s ease; }
.faq-item.active .faq-icon { transform: rotate(180deg); }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 3.5rem;
  background: var(--color-ink);
  color: #cbd5e1;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center;
}
.cta-band::after { content: ""; position: absolute; right: -10%; top: -40%; width: 60%; height: 180%; background: radial-gradient(closest-side, var(--color-primary), transparent); opacity: 0.35; }
.cta-band h2 { color: #fff; font-size: clamp(1.625rem, 2.6vw, 2.25rem); line-height: 1.2; margin-bottom: 0.75rem; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band .hero-actions { justify-content: flex-end; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(11, 17, 32, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-container {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  padding: 2.25rem; position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px); transition: transform 0.25s ease;
}
.modal-overlay.open .modal-container { transform: translateY(0); }
.modal-container h2 { font-size: 1.5rem; margin-bottom: 0.5rem; padding-right: 2rem; }
.modal-close-btn { position: absolute; top: 1rem; right: 1rem; background: #f1f5f9; border: none; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--color-text-main); }

/* Sticky mobile CTA */
.sticky-mobile-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  display: none; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.sticky-mobile-cta .btn { white-space: normal; }

/* Footer */
.footer { margin-top: auto; background: var(--color-ink); color: #94a3b8; padding: 3.5rem 0 2.5rem; font-size: 0.875rem; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; }
.footer .logo-area { color: #fff; margin-bottom: 0.75rem; }
.footer .logo-mark { background: var(--color-primary); }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a:hover { color: #fff; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.8125rem; }

/* Campaign hub helpers */
.cards-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.75rem; display: flex; flex-direction: column; }
.card-thumb { margin: -1.75rem -1.75rem 1.25rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 900px) { .cards-grid-3 { grid-template-columns: 1fr; } }
.hub-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.hub-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.hub-card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.hub-card-body .btn { margin-top: auto; }

/* Responsive */
@media (max-width: 1080px) {
  .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 900px) {
  .hero-grid, .consultation-split, .cta-band { grid-template-columns: 1fr; }
  .hero-visual-frame { aspect-ratio: 16 / 11; }
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .bento-card.wide { grid-column: span 2; }
  .form-section-wrapper { position: static; }
  .cta-band .hero-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .section { padding: 4rem 0; }
  .hero-section { padding: 2.5rem 0 3.5rem; }
  .bento-grid, .cards-grid-4, .form-row { grid-template-columns: 1fr; }
  .bento-card.wide { grid-column: span 1; grid-template-columns: 1fr; }
  .hero-metrics { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .metric-value { font-size: 1.25rem; }
  .hero-actions .btn { width: 100%; white-space: normal; }
  .header-nav .btn { display: none; }
  .sticky-mobile-cta { display: flex; }
  body { padding-bottom: 5rem; }
  .form-section-wrapper, .modal-container, .cta-band { padding: 1.5rem; }
  .floating-tag { display: none; }
  /* Keep the status card from covering the hero photo on small screens */
  .hero-floating-card { position: relative; left: auto; right: auto; bottom: auto; margin: -1.75rem 0.75rem 0; }
  .sticky-mobile-cta .btn { font-size: 0.875rem; padding: 0.75rem 1rem; }
}
