:root {
  --color-navy: #0A1A3C;
  --color-navy-dark: #071229;
  --color-gold: #C9A24B;
  --color-gold-light: #E8D5A3;
  --color-white: #FFFFFF;
  --color-offwhite: #F7F5F0;
  --color-text: #1C1C1C;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --header-height: 76px;
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: var(--header-height); }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.6;
  background: var(--color-white);
}

h1, h2, h3 { font-family: var(--font-heading); color: var(--color-navy); line-height: 1.2; }
h2 { font-size: 2rem; margin-bottom: 32px; text-align: center; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.text-gold { color: var(--color-gold); }

.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.22s var(--ease-smooth), box-shadow 0.22s var(--ease-smooth), background-color 0.18s var(--ease-smooth);
  will-change: transform;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px) scale(0.96); transition-duration: 0.1s; }

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(201,162,75,0.35); }
  50% { box-shadow: 0 6px 22px rgba(201,162,75,0.7); }
}

.btn-primary {
  background: var(--color-gold); color: var(--color-navy-dark);
  box-shadow: 0 6px 16px rgba(201,162,75,0.35);
  animation: btn-pulse 2.6s ease-in-out infinite;
}
.btn-primary:hover { box-shadow: 0 12px 28px rgba(201,162,75,0.45); animation-play-state: paused; }

.btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #25D366; color: #fff; box-shadow: 0 8px 20px rgba(37,211,102,0.35);
}
.btn-whatsapp:hover { background: #20bd5a; box-shadow: 0 12px 28px rgba(37,211,102,0.5); }
.btn-whatsapp svg { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.35s var(--ease-out-back); }
.btn-whatsapp:hover svg { transform: rotate(-14deg) scale(1.15); }
.btn-whatsapp-outline { background: transparent; color: var(--color-navy); border: 2px solid #25D366; }
.btn-whatsapp-outline:hover { background: rgba(37,211,102,0.08); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--color-navy); height: var(--header-height); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo-img { height: 48px; width: auto; display: block; }
.main-nav { display: flex; gap: 24px; }
.main-nav a { color: var(--color-white); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--color-gold); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--color-white); margin: 5px 0; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .main-nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-height); left: 0; right: 0;
    background: var(--color-navy); padding: 16px 24px; gap: 16px;
  }
}

/* Hero */
.hero { background: var(--color-offwhite); padding: 64px 0; }
.hero-inner { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 2.4rem; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.1rem; margin-bottom: 28px; color: #444; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-carousel {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto;
  aspect-ratio: 16 / 9; background: var(--color-navy);
  border-radius: 12px; overflow: hidden; box-shadow: 0 20px 40px rgba(10,26,60,0.2);
}
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s var(--ease-smooth); overflow: hidden; }
.hero-slide.is-active { opacity: 1; }
.hero-slide-bg {
  position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px);
  object-fit: cover; filter: blur(30px) brightness(0.65); transform: scale(1.1);
}
.hero-slide-fg { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero h1 { font-size: 1.8rem; }
}

/* Services */
.services { padding: 72px 0; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.service-card { background: var(--color-offwhite); border-radius: 12px; padding: 28px; }
.service-icon { display: inline-flex; width: 48px; height: 48px; border-radius: 50%; background: var(--color-navy); color: var(--color-gold); align-items: center; justify-content: center; margin-bottom: 16px; }
.service-icon svg { width: 24px; height: 24px; }
.service-card h3 { font-size: 1.15rem; margin-bottom: 12px; }
.service-card ul { list-style: none; color: #444; font-size: 0.92rem; }
.service-card li { padding-left: 18px; position: relative; margin-bottom: 6px; }
.service-card li::before { content: "•"; color: var(--color-gold); position: absolute; left: 0; font-weight: 700; }

@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

/* About / Team */
.about { padding: 72px 0; }
.about-intro { max-width: 760px; margin: 0 auto 40px; text-align: center; color: #444; font-size: 1.05rem; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.team-card { text-align: center; background: var(--color-offwhite); border-radius: 12px; padding: 28px 20px; }
.team-photo {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px;
  display: block; box-shadow: 0 8px 20px rgba(10,26,60,0.2);
}
.team-avatar {
  display: flex; width: 96px; height: 96px; border-radius: 50%; background: var(--color-navy);
  color: var(--color-gold); align-items: center; justify-content: center; margin: 0 auto 16px;
}
.team-avatar svg { width: 44px; height: 44px; }
.team-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.team-role { color: var(--color-gold); font-weight: 600; font-size: 0.85rem; }

@media (max-width: 900px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .team-grid { grid-template-columns: 1fr; } }

/* Diagnostic banner */
.diagnostic-banner { background: var(--color-navy); color: var(--color-white); padding: 64px 0; text-align: center; }
.diagnostic-banner h2 { color: var(--color-white); }
.diagnostic-inner p { max-width: 640px; margin: 0 auto 28px; font-size: 1.05rem; opacity: 0.9; }

/* Why us */
.why-us { padding: 72px 0; background: var(--color-offwhite); }
.why-us-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.why-us-item { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 10px; padding: 18px 20px; font-weight: 600; color: var(--color-navy); }
.check-icon { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--color-gold); color: var(--color-navy-dark); align-items: center; justify-content: center; flex-shrink: 0; }
.check-icon svg { width: 16px; height: 16px; }

@media (max-width: 860px) { .why-us-grid { grid-template-columns: 1fr; } }

/* Testimonials */
.testimonials { padding: 72px 0; background: var(--color-offwhite); }
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card { position: relative; background: #fff; border-radius: 12px; padding: 28px; }
.testimonial-stars { color: var(--color-gold); font-size: 1.1rem; letter-spacing: 3px; margin-bottom: 12px; }
.testimonial-card p { color: #333; margin-bottom: 12px; font-style: italic; }
.testimonial-card cite { color: var(--color-navy); font-weight: 600; font-size: 0.9rem; font-style: normal; }

@media (max-width: 900px) { .testimonial-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq { padding: 72px 0; }
.faq-item { border-bottom: 1px solid #e2e2e2; }
.faq-question { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: none; border: none; text-align: left; font-size: 1.02rem; font-weight: 600; padding: 18px 0; cursor: pointer; color: var(--color-navy); font-family: var(--font-body); }
.faq-icon { flex-shrink: 0; color: var(--color-gold); font-size: 1.3rem; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-item.is-open .faq-answer { max-height: 300px; }
.faq-answer p { padding-bottom: 18px; color: #444; }

/* Footer */
.site-footer { background: var(--color-navy-dark); color: var(--color-white); padding: 56px 0 24px; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-logo { height: 40px; margin-bottom: 12px; }
.footer-brand p { color: #b9c2d6; font-size: 0.9rem; }
.footer-contact h4, .footer-social h4 { color: var(--color-gold); font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.footer-contact p { margin-bottom: 8px; font-size: 0.9rem; }
.footer-contact a, .social-links a { color: #d7dcea; text-decoration: none; }
.footer-contact a:hover, .social-links a:hover { color: var(--color-gold); }
.social-links { display: flex; flex-direction: column; gap: 8px; }
.footer-bottom { text-align: center; font-size: 0.8rem; color: #8b93a8; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }

@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; text-align: center; } .social-links { align-items: center; } }

/* Welcome intro (top of page) */
.welcome-intro { background: var(--color-navy); color: var(--color-white); padding: 72px 0; text-align: center; }
.welcome-intro-logo { height: 160px; width: auto; margin: 0 auto 24px; display: block; border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,0.35); }
.welcome-intro-name { color: var(--color-gold); font-size: 2.8rem; margin-bottom: 20px; }
.welcome-intro-message { max-width: 700px; margin: 0 auto; font-size: 1.15rem; line-height: 1.7; color: #d7dcea; }

@media (max-width: 600px) {
  .welcome-intro { padding: 56px 0; }
  .welcome-intro-logo { height: 120px; }
  .welcome-intro-name { font-size: 2rem; }
  .welcome-intro-message { font-size: 1rem; }
}

/* Diagnostic modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(7,18,41,0.6); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 200; padding: 24px; }
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.modal-box { background: #fff; border-radius: 12px; padding: 32px; max-width: 420px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #888; line-height: 1; }
.modal-box h3 { margin-bottom: 12px; }
.modal-box p { color: #555; margin-bottom: 20px; font-size: 0.95rem; }
#diagnostic-form label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--color-navy); }
#diagnostic-form input { width: 100%; padding: 10px 12px; margin-bottom: 16px; border: 1px solid #ccc; border-radius: 6px; font-family: var(--font-body); font-size: 1rem; }
#diagnostic-form .btn { width: 100%; }
body.modal-open { overflow: hidden; }

/* Chat widget */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 300; }
@keyframes chat-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.chat-toggle {
  width: 60px; height: 60px; border-radius: 50%; background: var(--color-navy); border: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center;
  transition: transform 0.25s var(--ease-out-back), box-shadow 0.25s var(--ease-smooth);
  animation: chat-float 2.4s ease-in-out infinite;
}
.chat-toggle:hover { transform: scale(1.08); box-shadow: 0 12px 28px rgba(0,0,0,0.35); animation-play-state: paused; }
.chat-toggle:active { transform: scale(0.94); animation-play-state: paused; }
.chat-toggle svg { width: 28px; height: 28px; stroke: var(--color-gold); transition: transform 0.3s var(--ease-out-back); }
.chat-toggle:hover svg { transform: scale(1.1); }
.chat-panel { position: absolute; bottom: 76px; right: 0; width: 320px; max-height: 420px; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.25); display: none; flex-direction: column; overflow: hidden; }
.chat-panel.is-open { display: flex; }
.chat-header { background: var(--color-navy); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.chat-header button { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.chat-body { padding: 16px; overflow-y: auto; flex: 1; }
.chat-message { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 0.9rem; }
.chat-message-bot { background: var(--color-offwhite); color: var(--color-text); }
.chat-message-user { background: var(--color-navy); color: #fff; margin-left: 20%; }
.chat-options { display: flex; flex-direction: column; gap: 8px; }
.chat-option {
  text-align: left; background: #fff; border: 1px solid var(--color-gold); color: var(--color-navy);
  border-radius: 8px; padding: 10px 12px; font-size: 0.88rem; cursor: pointer; font-family: var(--font-body);
  transition: background-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth);
}
.chat-option:hover { background: var(--color-gold-light); transform: translateX(3px); }
.chat-option:active { transform: translateX(3px) scale(0.98); }
.chat-handoff { display: block; width: 100%; margin-top: 12px; text-align: center; }
.chat-back { display: block; margin-top: 10px; background: none; border: none; color: var(--color-navy); text-decoration: underline; cursor: pointer; font-size: 0.85rem; }

@media (max-width: 480px) { .chat-panel { width: calc(100vw - 32px); right: -8px; } }

/* Wizard de diagnóstico */
.modal-box--wizard { max-width: 520px; }
.diag-progress { font-size: 0.8rem; font-weight: 600; color: var(--color-gold); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.diag-title { font-size: 1.25rem; margin-bottom: 18px; }
.diag-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.diag-option { text-align: left; background: #fff; border: 1px solid var(--color-gold); color: var(--color-navy); border-radius: 8px; padding: 12px 14px; font-size: 0.95rem; cursor: pointer; font-family: var(--font-body); transition: background-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-smooth); }
.diag-option:hover { background: var(--color-gold-light); transform: translateX(3px); }
.diag-option.is-selected { background: var(--color-navy); color: #fff; }
.diag-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.diag-back { background: none; border: none; color: var(--color-navy); text-decoration: underline; cursor: pointer; font-size: 0.9rem; font-family: var(--font-body); }
.diag-contact label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: var(--color-navy); }
.diag-contact input { width: 100%; padding: 10px 12px; margin-bottom: 14px; border: 1px solid #ccc; border-radius: 6px; font-family: var(--font-body); font-size: 1rem; }
.diag-error { color: #c0392b; font-size: 0.88rem; margin-bottom: 12px; }
.diag-loading { text-align: center; padding: 32px 0; }
.diag-spinner { width: 44px; height: 44px; margin: 0 auto 18px; border: 4px solid var(--color-gold-light); border-top-color: var(--color-gold); border-radius: 50%; animation: diag-spin 0.9s linear infinite; }
@keyframes diag-spin { to { transform: rotate(360deg); } }
.diag-result { background: var(--color-offwhite); border-radius: 10px; padding: 18px; font-size: 0.95rem; color: #333; line-height: 1.6; max-height: 320px; overflow-y: auto; }
.diag-result strong { color: var(--color-navy); }
.diag-confirm { font-size: 0.92rem; color: var(--color-navy); background: var(--color-offwhite); border-radius: 8px; padding: 10px 12px; margin: 14px 0 6px; }
.diag-aviso { font-size: 0.78rem; color: #777; margin: 8px 0 18px; }
.diag-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.diag-send, .diag-pdf { width: 100%; }
.diag-pdf:disabled { opacity: 0.6; cursor: default; }
.diag-cta { background: var(--color-navy); color: #fff; border-radius: 10px; padding: 20px; text-align: center; }
.diag-cta h4 { color: var(--color-gold); font-family: var(--font-body); margin-bottom: 8px; }
.diag-cta p { font-size: 0.9rem; opacity: 0.9; margin-bottom: 14px; }
