/* ── TOKENS ─────────────────────────────────── */
:root {
  --navy:  #100D54;
  --gold:  #C9A63F;
  --gold2: #E7C469;
  --white: #ffffff;
  --gray:  rgba(255,255,255,0.76);
}

/* ── RESET ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--white);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
section { position: relative; }
.container {
  width: min(1280px, 100%);
  margin: 0 auto;
}

/* ── SCROLL REVEAL ──────────────────────────── */
.reveal {
  opacity: 0;
  filter: blur(12px); 
  transform: translateY(-12px); 
  transition:
    opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1) 0.5s,
    filter 0.7s cubic-bezier(0.25, 1, 0.5, 1) 0.5s,
    transform 0.7s cubic-bezier(0.25, 1, 0.5, 1) 0.5s;
  will-change: opacity, filter, transform;
}
.reveal.from-left { transform: translateX(-18px); }
.reveal.from-right { transform: translateX(18px); }
.reveal.from-center { transform: scale(0.92); }
.reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: translate(0, 0) scale(1);
}
.d1 { transition-delay: 0.58s; }
.d2 { transition-delay: 0.66s; }
.d3 { transition-delay: 0.74s; }
.d4 { transition-delay: 0.82s; }
.d5 { transition-delay: 0.90s; }
.d6 { transition-delay: 0.98s; }

/* ── HERO ───────────────────────────────────── */
#hero {
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.hero-map-container {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}
.hero-map { width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.hero-nav {
  position: relative; z-index: 10; padding: 2.2rem 5%; display: flex; align-items: center; gap: 0.2rem;
}
.hero-nav .logo-icon { height: 150px; flex-shrink: 0; }
.hero-nav .logo-type { height: 60px; flex-shrink: 0; }
.hero-body {
  position: relative; z-index: 10; flex: 1; display: flex; align-items: center; padding: 6vh 5% 10vh;
}
.hero-text { max-width: 600px; width: 100%; }
.hero-headline {
  font-size: clamp(1.4rem, 2.4vw, 2.5rem);
  line-height: 1.5; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 38px; margin-left: 58px; color: var(--white);
}
.hero-headline .hl { color: var(--gold2); }
.hero-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 220px; height: 56px; border: 1px solid var(--gold2); border-radius: 10px;
  margin-left: 58px; color: var(--gold2); text-transform: uppercase; font-size: 1rem; font-weight: 500;
  transition: all 0.3s ease;
}
.hero-btn:hover { background: var(--gold2); color: var(--navy); }
.hero-flags { position: absolute; right: 5%; bottom: 48px; z-index: 10; display: flex; }
.hero-flags img { width: 80px; height: 80px; margin-left: -15px; object-fit: cover; }
.hero-flags img:first-child { margin-left: 0; }

/* ── S1 ─────────────────────────────────────── */
#s1 { min-height: 110vh; display: flex; align-items: flex-end; overflow: hidden; }
#s1 .bg {
  position: absolute; inset: 0;
  background: url('../images/oficina_ecuador_abogados_andino.webp') center top / cover no-repeat;
}
#s1 .bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,7,44,0.0) 0%, rgba(8,7,44,0.18) 40%, rgba(8,7,44,0.82) 100%);
}
#s1 .tagline { position: relative; z-index: 2; width: 100%; text-align: center; padding: 0 8% 90px; }
#s1 .tagline h2 { font-size: clamp(1.3rem, 1.9vw, 2rem); font-weight: 700; color: var(--gold2); margin-bottom: 18px; }
#s1 .tagline p { max-width: 960px; margin: 0 auto; font-size: 1rem; line-height: 1.5; color: rgba(255,255,255,0.92); }

/* ── S2 ─────────────────────────────────────── */
#s2 {
  background: var(--navy); padding: 80px 7%; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 80px; align-items: center;
}
.s2-logo { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; }
.s2-logo img.main-logo { width: 300px; height: auto; display: block; margin: 0 auto; }
.s2-text p { font-size: 1rem; line-height: 1.5; color: rgba(255,255,255,0.76); margin-bottom: 1.4rem; }

/* ── S3 ─────────────────────────────────────── */
#s3 { background: var(--white); padding: 40px 7%; color: #222; }
#s3 h2 { font-size: clamp(1.6rem, 2.2vw, 2.4rem); font-weight: 700; text-align: center; color: var(--gold2); margin-bottom: 40px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 52px 42px; }
.spec-item { display: flex; flex-direction: column; }
.spec-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 30px; }
.spec-item h3 { font-size: 1.2rem; font-weight: 700; color: var(--gold2); margin-top: 14px; margin-bottom: 6px; }
.spec-item p { font-size: 1rem; line-height: 1.5; color: #5b5b5b; }

/* ── S4 ─────────────────────────────────────── */
#s4 { min-height: 65vh; display: flex; align-items: center; position: relative; overflow: hidden; background: var(--navy); }
#s4 .bg { position: absolute; inset: 0; z-index: 1; }
.asesoria-image-container, .asesoria-img { width: 100%; height: 100%; object-fit: cover; object-position: center bottom; display: block; }
.proceso-wrap { position: relative; z-index: 2; margin-left: auto; padding: 5rem 7%; max-width: 600px; width: 52%; }
.proceso-wrap h2 { font-size: clamp(1.6rem, 2.2vw, 2.4rem); font-weight: 700; color: var(--gold2); margin-bottom: 6px; }
.proceso-wrap .lead { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 2rem; }
.steps { display: flex; flex-direction: column; gap: 1.3rem; }
.step p { font-size: 1rem; line-height: 1.5; color: rgba(255,255,255,0.8); }
.step p strong { color: var(--white); }

/* ── S5 ─────────────────────────────────────── */
#s5 { background: var(--white); padding: 80px 7%; text-align: center; color: #222; }
#s5 h2 { font-size: clamp(1.5rem, 2.1vw, 2.4rem); font-weight: 700; color: var(--gold2); margin-bottom: 1.6rem; }
#s5 p { max-width: 760px; margin: 0 auto; font-size: 1rem; line-height: 1.5; color: #444; }

/* ── S6 & S6-INFO ───────────────────────────── */
#s6 { background: var(--navy); padding: 55px 3.5% 25px; text-align: center; }
#s6 h2 { font-size: clamp(1.6rem, 2.2vw, 2.4rem); font-weight: 700; color: var(--gold2); margin-bottom: 10px; }
#s6 .subtitle { font-size: 1rem; font-weight: 600; color: var(--white); margin-bottom: 56px; }
.lawyers { display: flex; justify-content: center; gap: 80px; flex-wrap: wrap; margin-bottom: 24px; }
.lawyer { text-align: center; }
.lawyer .avatar-wrap { position: relative; display: inline-block; margin-bottom: 14px; }
.lawyer .avatar-wrap img.av { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(201,168,76,0.4); }
.lawyer .avatar-wrap img.flag { position: absolute; bottom: 4px; right: 4px; width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.lawyer h3 { font-size: 1rem; font-weight: 700; color: var(--white); }

#s6-info { background: var(--white); padding: 40px 7% 55px; text-align: center; }
#s6-info h2 { font-size: clamp(1.6rem, 2.2vw, 2.4rem); font-weight: 700; color: var(--gold2); margin-bottom: 10px; }
.contact-form-container {
  max-width: 760px; margin: 0 auto 30px; background: #f8f9fa; padding: 40px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); text-align: left;
}
.contact-form-container h3 { font-size: 1.6rem; font-weight: 700; color: var(--gold2); margin-bottom: 8px; }
.form-instruction { font-size: 1rem; color: #666; margin-bottom: 30px; line-height: 1.5; }
.secure-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: flex; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.form-group input, .form-group textarea {
  width: 100%; padding: 14px 16px; border: 1px solid #dcdcdc; border-radius: 8px;
  font-size: 1rem; color: #333; background: var(--white); transition: all 0.3s ease;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--gold2); box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}
.form-submit-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 56px;
  background: var(--gold2); color: var(--white); border: none; border-radius: 8px;
  font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; margin-top: 10px;
}
.form-submit-btn:hover { background: var(--navy); color: var(--white); }
.contact-address { font-size: 1rem; color: #4a4a4a; margin-bottom: 30px; line-height: 1.5; }
.contact-address strong { color: var(--navy); }
.map-wrap { max-width: 760px; margin: 0 auto 30px; overflow: hidden; }
.contact-map-container { display: block; width: 100%; }
.contact-map { width: 100%; display: block; object-fit: cover; }
.contact-usa { font-size: 1rem; color: #4a4a4a; }
.contact-usa strong { color: var(--navy); }

/* ── FOOTER ─────────────────────────────────── */
#footer {
  background: var(--navy); border-top: 1px solid rgba(201,168,76,0.15); padding: 3.5rem 5% 2.5rem; text-align: center;
}
.footer-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; }
.footer-logo-wrap img.fi { height: 150px; }
#footer p { font-size: 0.8rem; color: rgba(255,255,255,0.35); letter-spacing: 0.04em; }

#scrollTop {
  position: fixed; bottom: 1.8rem; right: 1.8rem; width: 44px; height: 44px; background: var(--gold2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
#scrollTop.show { opacity: 1; pointer-events: all; }
#scrollTop svg { width: 16px; fill: var(--navy); }

/* ── MODAL LEGAL ────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; z-index: 9999; padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-container {
  background-color: #fff; border-radius: 10px; width: 100%; max-width: 680px; max-height: 85vh;
  display: flex; flex-direction: column; transform: translateY(20px); transition: transform 0.3s ease; overflow: hidden; color: #222;
}
.modal-overlay.active .modal-container { transform: translateY(0); }
.modal-header {
  padding: 14px 20px; border-bottom: 1px solid #e8e4de; display: flex; align-items: center;
  justify-content: space-between; background-color: #faf8f5; flex-shrink: 0;
}
.modal-title { font-size: 0.95rem; font-weight: 600; color: #2c2c2c; }
.modal-close { background: none; border: none; font-size: 1.35rem; color: #777; cursor: pointer; }
.modal-tabs {
  display: flex; gap: 4px; background-color: #f4f1ea; border-bottom: 1px solid #e2ddd5; overflow-x: auto; flex-shrink: 0;
}
.tab-btn {
  padding: 10px 16px; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: 0.78rem; font-weight: 600; color: #666; cursor: pointer; white-space: nowrap;
}
.tab-btn.active { color: #100D54; border-bottom-color: #C9A63F; background-color: #fff; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex-grow: 1; text-align: left; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.modal-container .modal-body p, .modal-container .tab-content p,
.modal-container .modal-body li, .modal-container .tab-content li {
  font-size: 0.85rem; line-height: 1.55; color: #4a4a4a; margin-bottom: 12px;
}
.modal-container .tab-content h3 { font-size: 0.95rem; font-weight: 600; color: #100D54; margin-bottom: 10px; }
.modal-container .tab-content h4 { font-size: 0.86rem; font-weight: 600; color: #C9A63F; margin: 16px 0 6px 0; }
.legal-date { font-size: 0.72rem; color: #888; font-style: italic; display: block; margin-bottom: 12px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #e8e4de; text-align: right; background-color: #faf8f5; flex-shrink: 0; }
.btn-accept {
  background-color: #100D54; color: #fff; border: none; padding: 8px 18px;
  border-radius: 5px; cursor: pointer; font-size: 0.8rem; font-weight: 600;
}
body.modal-open { overflow: hidden; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
  .hero-headline { font-size: 1.4rem !important; margin-left: 0 !important; }
  .hero-btn { margin-left: 0 !important; width: 100% !important; }
  #s2 { grid-template-columns: 1fr; gap: 48px; text-align: center; padding: 70px 6%; }
  .spec-grid { grid-template-columns: 1fr; }
  .proceso-wrap { width: 100%; max-width: 100%; padding: 3rem 6%; }
  .lawyers { gap: 40px; }
  .form-row { flex-direction: column; gap: 20px; }
}