/* ============================================================
   DB Mortgage Solutions — stylesheet
   Minimal, editorial, finance-grade.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --navy-900: #081d3a;
  --navy-800: #0b2545;
  --navy-700: #143661;

  --gold-500: #c8a96a;
  --gold-600: #b18f4a;

  --cream-50: #fbf9f5;
  --cream-100: #f5f1e9;
  --cream-200: #ece6d8;

  --ink-900: #0f1421;
  --ink-700: #2a3142;
  --ink-500: #5a6478;
  --ink-300: #9aa3b5;

  --line: rgba(11, 37, 69, 0.12);
  --line-strong: rgba(11, 37, 69, 0.22);

  --shadow-sm: 0 1px 2px rgba(8, 29, 58, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(8, 29, 58, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(8, 29, 58, 0.28);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --font-serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --container: 1180px;
  --pad: clamp(20px, 4vw, 40px);

  /* Header sizing in viewport units so it always scales with the device.
     Clamped so it never gets absurdly tall or too short. */
  --header-h: clamp(56px, 10vh, 86px);
  /* Amount reserved for the iOS status bar / notch on devices that report it.
     Falls back to 0 on everything else. */
  --safe-top: env(safe-area-inset-top, 0px);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Add the notch offset so in-page anchors don't hide under the header. */
  scroll-padding-top: calc(var(--header-h) + var(--safe-top));
  overflow-x: hidden;
}
body {
  margin: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: var(--navy-800); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold-600); }
ul { list-style: none; padding: 0; margin: 0; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--navy-800); color: var(--cream-50); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); font-weight: 500; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.25rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; color: var(--ink-900); }

p { margin: 0 0 1em; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin: 0 0 1rem;
}

.accent {
  color: var(--gold-600);
  font-style: italic;
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.95em 1.6em;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--navy-800);
  color: var(--cream-50);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--navy-900);
  color: var(--gold-500);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--navy-800);
  color: var(--cream-50);
  border-color: var(--navy-800);
}
.btn-full { width: 100%; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100vw;
  max-width: 100%;
  /* Extend the cream backdrop up under the iOS status bar / notch so no
     "bar" shows above the nav on phones. */
  padding-top: var(--safe-top);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: rgba(237, 235, 232, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  background: rgba(237, 235, 232, 0.95);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  height: var(--header-h);
  flex-wrap: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--navy-800);
  min-width: 0;
  flex: 0 1 auto;
}
.brand:hover { color: var(--navy-800); }

/* Main brand image used in the header */
.brand-logo {
  height: 66px;
  width: auto;
  display: block;
  flex-shrink: 0;
  /* Blend the JPG's near-white background into the cream page bg.
     Pixels of the navy DB stay dark; the surrounding light-grey fades into the page. */
  mix-blend-mode: multiply;
  transition: transform .25s var(--ease);
}
.brand:hover .brand-logo { transform: scale(1.03); }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-tagline {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer monogram (SVG, used on the dark navy footer background) */
.brand-mark {
  display: inline-flex;
  width: 42px; height: 42px;
  color: var(--navy-800);
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-link {
  position: relative;
  padding: 0.55rem 1rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink-700);
  border-radius: 999px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 1rem; right: 1rem;
  bottom: 0.35rem;
  height: 1px;
  background: var(--gold-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav-link:hover { color: var(--navy-900); }
.nav-link.active { color: var(--navy-900); }
.nav-link.active::after { transform: scaleX(1); }

.nav-link.nav-cta {
  background: var(--navy-800);
  color: var(--cream-50);
  padding: 0.6rem 1.25rem;
  margin-left: 0.5rem;
}
.nav-link.nav-cta::after { display: none; }
.nav-link.nav-cta:hover {
  background: var(--navy-900);
  color: var(--gold-500);
}
.nav-link.nav-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: #128c7e;
}
.nav-link.nav-whatsapp:hover {
  color: #0f6d62;
}

.whatsapp-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Hamburger */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: var(--navy-800);
  transition: transform .3s var(--ease), opacity .3s var(--ease), top .3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(80px, 14vh, 160px) 0 clamp(80px, 12vh, 140px);
  overflow: hidden;
  isolation: isolate;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 880px;
}
.hero-title {
  margin: 0.6rem 0 1.2rem;
}
.hero-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-500);
  max-width: 620px;
  margin: 0 0 2.5rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 4rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  max-width: 640px;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 0.3rem; }
.stat-num {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* Decorative background mark */
.hero-decor {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -8%;
  transform: translateY(-50%);
  width: 640px; height: 640px;
  max-width: 60vw; max-height: 60vw;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(200, 169, 106, 0.18), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(11, 37, 69, 0.08), transparent 65%);
  filter: blur(2px);
  pointer-events: none;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: clamp(80px, 12vh, 140px) 0;
  position: relative;
}
.section-alt { background: var(--cream-100); }

.section-head {
  max-width: 760px;
  margin: 0 auto 4rem;
  text-align: center;
}
.section-head .eyebrow { margin-bottom: 0.8rem; }
.section-title { margin-bottom: 1rem; }
.section-lead {
  font-size: 1.1rem;
  color: var(--ink-500);
  margin: 0;
}

/* ---------- About / Features ---------- */
.about-profile {
  margin: 2rem auto 0;
}

.about-profile-image {
  width: min(100%, 340px);
  height: auto;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.feature {
  background: var(--cream-50);
  padding: 2.25rem 2rem;
  transition: background .3s var(--ease), transform .3s var(--ease);
  position: relative;
}
.feature:hover { background: #fff; }
.feature-num {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-600);
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}
.feature h3 { margin-bottom: 0.5rem; }
.feature p { margin: 0; color: var(--ink-500); font-size: 0.97rem; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  text-align: center;
  padding: 2.25rem 1.75rem;
  min-height: 290px;
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  outline: none;
  cursor: default;
  transition: transform .35s var(--ease),
              border-color .35s var(--ease),
              box-shadow .35s var(--ease),
              background .35s var(--ease);
}
.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 0.6rem;
  color: var(--gold-600);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color .35s var(--ease),
              border-color .35s var(--ease),
              transform .35s var(--ease),
              background .35s var(--ease);
}
.service-icon svg { width: 26px; height: 26px; }

.service-card:hover .service-icon,
.service-card:focus-visible .service-icon {
  color: #fff;
  background: var(--navy-800);
  border-color: var(--navy-800);
  transform: scale(1.06);
}

.service-title {
  margin: 0;
  font-size: 1.2rem;
}

.service-tagline {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--gold-600);
  transition: opacity .3s var(--ease), max-height .3s var(--ease);
  max-height: 2.4em;
  overflow: hidden;
}

.service-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-500);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .45s var(--ease),
              opacity .35s var(--ease) .05s;
}

/* Hover / focus: swap tagline for full description */
.service-card:hover .service-tagline,
.service-card:focus-visible .service-tagline {
  opacity: 0;
  max-height: 0;
}
.service-card:hover .service-desc,
.service-card:focus-visible .service-desc {
  max-height: 240px;
  opacity: 1;
}

/* Touch devices: no hover, so always show the description */
@media (hover: none) {
  .service-tagline { display: none; }
  .service-desc {
    max-height: none;
    opacity: 1;
    overflow: visible;
  }
}

/* ---------- Lifestyle band ---------- */
.section-lifestyle {
  padding-bottom: clamp(60px, 8vh, 100px);
}
.section-lifestyle .section-head {
  margin-bottom: 3.5rem;
}

.lifestyle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--line);
}
.lifestyle-figure {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--cream-100);
  position: relative;
}
.lifestyle-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 29, 58, 0) 55%, rgba(8, 29, 58, 0.18) 100%);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity .5s var(--ease);
}
.lifestyle-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.92) contrast(1.02);
  transition: transform .9s var(--ease), filter .6s var(--ease);
}
.lifestyle-figure:hover img,
.lifestyle-figure:focus-within img {
  transform: scale(1.04);
  filter: saturate(1.05);
}
.lifestyle-figure:hover::after,
.lifestyle-figure:focus-within::after {
  opacity: 0.4;
}

@media (max-width: 900px) {
  .lifestyle-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .lifestyle-figure { aspect-ratio: 16 / 10; }
}

/* ---------- Partners ---------- */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  /* Isolate the whole grid into its own stacking context. Without this,
     iOS Safari tries to composite the `mix-blend-mode: multiply` logos
     against the header's `backdrop-filter` blur layer during scroll —
     which produces flickering / inverted / disappearing logos on iPhone. */
  isolation: isolate;
}
.partner-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  /* Contain the blend-mode inside the rounded card so it can't leak past
     the border-radius during the hover transform (another iOS quirk). */
  overflow: hidden;
  isolation: isolate;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.partner-card:hover {
  border-color: var(--gold-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.partner-logo {
  max-width: 100%;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Gracefully blends any white/light backgrounds in the source images
     into the white card so the logos sit flush. */
  mix-blend-mode: multiply;
  filter: saturate(1.05);
  transition: transform .3s var(--ease);
  /* Promote each logo to its own GPU compositing layer. This stops iOS
     Safari from re-flowing the blend-mode pixels every scroll frame. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.partner-card:hover .partner-logo { transform: translateZ(0) scale(1.04); }

/* Belt-and-braces: on touch devices (which is every iPhone) the hover
   scale never fires anyway, so drop the `will-change` promotion once the
   logo has settled to keep memory use sane. */
@media (hover: none) {
  .partner-logo { will-change: auto; }
}

.partners-extra {
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: center;
}

.partners-extra-image {
  width: min(100%, 460px);
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.partners-note {
  text-align: center;
  color: var(--ink-500);
  font-size: 0.95rem;
  margin: 2rem 0 0;
}
.partners-note a {
  color: var(--gold-600);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact-intro .section-title { text-align: left; }
.contact-intro .section-lead { text-align: left; }
.contact-list {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
}
.contact-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.contact-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.contact-list a, .contact-list span:not(.contact-label) {
  color: var(--ink-900);
  font-size: 1rem;
}
.contact-list a:hover { color: var(--gold-600); }
.contact-whatsapp {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.contact-form {
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 1.1rem;
}

/* Google Form (or other) iframe embed variant — remove the inner padding /
   grid gap so the iframe fills the card edge-to-edge and stays responsive. */
.contact-form-embed {
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: #fff;
}
.contact-embed {
  display: block;
  width: 100%;
  height: 782px;
  border: 0;
  border-radius: inherit;
  background: transparent;
}
@media (max-width: 540px) {
  .contact-embed { height: 920px; }
}
@media (max-width: 380px) {
  .contact-embed { height: 1040px; }
}
.field { display: grid; gap: 0.4rem; }
.field label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
}
.field .optional {
  font-size: 0.75rem;
  color: var(--ink-300);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  color: var(--ink-900);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy-800);
  box-shadow: 0 0 0 4px rgba(11, 37, 69, 0.08);
}
.field textarea { resize: vertical; min-height: 110px; }

.form-status {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  min-height: 1.4em;
}
.form-status.success { color: #1d6b3a; }
.form-status.error   { color: #a3361f; }

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 840px;
  margin: 0 auto;
  display: grid;
  gap: 0.85rem;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink-900);
  padding: 1rem 1.25rem;
  position: relative;
  padding-right: 2.8rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.35rem;
  color: var(--gold-600);
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 0 1.25rem 1.15rem;
  color: var(--ink-500);
}
.faq-item ul {
  margin: 0 1.25rem 1.15rem 2.4rem;
  padding: 0;
  list-style: disc;
  color: var(--ink-500);
}

/* ============================================================
   CALCULATOR
   ============================================================ */
.calc {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}

/* ---- Inputs side ---- */
.calc-inputs {
  display: grid;
  gap: 1.75rem;
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
}

.calc-field { display: grid; gap: 0.65rem; }

.calc-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.calc-field-head label {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
}
.calc-field-head .optional {
  font-size: 0.72rem;
  color: var(--ink-300);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 400;
}

.calc-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  min-width: 0;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.calc-input-wrap:focus-within {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 4px rgba(11, 37, 69, 0.08);
}
.calc-input-wrap input {
  width: 8ch;
  max-width: 100%;
  text-align: right;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  padding: 0;
  -moz-appearance: textfield;
}
.calc-input-wrap input::-webkit-outer-spin-button,
.calc-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-prefix,
.calc-suffix {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.04em;
}

/* Range slider */
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--cream-200);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 0.3rem 0 0;
}
.calc-range::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--cream-200);
  border-radius: 999px;
}
.calc-range::-moz-range-track {
  height: 4px;
  background: var(--cream-200);
  border-radius: 999px;
}
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  margin-top: -8px;
  background: var(--navy-800);
  border: 3px solid var(--cream-50);
  border-radius: 50%;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-strong);
  cursor: grab;
  transition: transform .15s var(--ease), background .2s var(--ease);
}
.calc-range::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--navy-800);
  border: 3px solid var(--cream-50);
  border-radius: 50%;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-strong);
  cursor: grab;
  transition: transform .15s var(--ease), background .2s var(--ease);
}
.calc-range:hover::-webkit-slider-thumb { transform: scale(1.08); background: var(--navy-900); }
.calc-range:hover::-moz-range-thumb    { transform: scale(1.08); background: var(--navy-900); }
.calc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(11,37,69,0.18); }
.calc-range:focus-visible::-moz-range-thumb    { box-shadow: 0 0 0 4px rgba(11,37,69,0.18); }

.calc-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--ink-300);
  text-transform: uppercase;
}

/* ---- Results side ---- */
.calc-results {
  background: var(--navy-800);
  color: var(--cream-100);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.calc-results-label {
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-500);
}
.calc-monthly {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.calc-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  margin-bottom: 0.75rem;
}
.calc-bar-principal {
  display: block;
  background: var(--gold-500);
  transition: width .5s var(--ease);
}
.calc-bar-interest {
  display: block;
  background: rgba(255,255,255,0.25);
  transition: width .5s var(--ease);
}
.calc-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
  margin: 0 0 1.75rem;
  letter-spacing: 0.04em;
}
.calc-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}
.dot-principal { background: var(--gold-500); }
.dot-interest  { background: rgba(255,255,255,0.45); }

.calc-breakdown {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.75rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.calc-breakdown > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.calc-breakdown dt {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.04em;
  margin: 0;
}
.calc-breakdown dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.calc-cta {
  background: var(--gold-500);
  color: var(--navy-900);
  margin-top: 0.25rem;
}
.calc-cta:hover {
  background: var(--gold-600);
  color: var(--navy-900);
}
.calc-disclaimer {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.55;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy-900);
  color: var(--cream-200);
  padding: 4rem 0 2.5rem;
}
.site-footer a { color: var(--cream-200); }
.site-footer a:hover { color: var(--gold-500); }
.footer-inner {
  display: grid;
  gap: 2rem;
  text-align: center;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.footer-brand p {
  margin: 0;
  color: var(--cream-200);
  opacity: 0.8;
  font-size: 0.95rem;
}
.footer-mark { width: 52px; height: 52px; color: var(--gold-500); }
.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.93rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-copy {
  margin: 0;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-200);
  opacity: 0.6;
}
.footer-reg {
  margin: 0;
  font-size: 0.82rem;
  color: var(--cream-200);
  opacity: 0.75;
  line-height: 1.6;
}

/* ============================================================
   REVEAL ANIMATIONS (intersection observer)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .calc { grid-template-columns: 1fr; }
  .calc-results { position: static; }
}

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

/* Hamburger / mobile nav — kicks in early because the nav has 7 items */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav-menu {
    position: fixed;
    top: calc(var(--header-h) + var(--safe-top));
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem var(--pad) calc(2rem + env(safe-area-inset-bottom, 0px));
    background: var(--cream-50);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-120%);
    transition: transform .35s var(--ease);
    max-height: calc(100dvh - var(--header-h) - var(--safe-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .nav-menu.open { transform: translateY(0); }
  .nav-link {
    padding: 1rem 0.25rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: 1.05rem;
  }
  .nav-link::after { display: none; }
  .nav-link.nav-cta {
    margin: 1rem 0 0;
    border-radius: 999px;
    text-align: center;
  }
  .nav-link.nav-whatsapp {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .brand-logo { height: 53px; }
  .brand-name { font-size: 1.05rem; }
  .brand-tagline { display: none; }
  .brand-mark { width: 38px; height: 38px; }

  .hero { padding-top: 60px; }
  .hero-actions { width: 100%; }
  .btn { flex: 1 1 auto; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .hero-decor { opacity: 0.6; }

  .contact-list li { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (max-width: 460px) {
  .hero-stats { grid-template-columns: 1fr; }
}

/* Very small phones (iPhone SE and similar). Shrink brand + tighten padding so
   the header can never overflow, and stack narrow inputs cleanly. */
@media (max-width: 400px) {
  :root { --pad: 16px; }

  .brand-logo { height: 44px; }
  .brand-name { font-size: 0.98rem; letter-spacing: -0.015em; }

  h1 { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .hero { padding-top: 40px; }
  .hero-sub { font-size: 1rem; }

  .btn { padding: 0.85em 1.2em; font-size: 0.88rem; }

  .calc-field-head {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .calc-input-wrap input { width: 7ch; }

  .footer-nav { gap: 0.9rem 1.25rem; font-size: 0.88rem; }
}

/* ============================================================
   SITE EDITOR
   ============================================================ */

.editor-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  display: none !important;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--navy-800);
  color: var(--cream-50);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.editor-fab:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--navy-900);
  color: var(--cream-50);
}
.editor-fab svg { width: 18px; height: 18px; }

.editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 100vw);
  background: var(--cream-50);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  transform: translateX(105%);
  transition: transform .35s var(--ease);
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
}
.editor-panel.open { transform: translateX(0); }

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.editor-header h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 0;
}
.editor-close {
  font-size: 28px;
  line-height: 1;
  color: var(--ink-500);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.editor-close:hover { background: var(--cream-100); color: var(--ink-900); }

.editor-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--cream-100);
}
.editor-tab {
  flex: 1;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: 0.02em;
  border-bottom: 2px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.editor-tab:hover { color: var(--ink-900); background: var(--cream-50); }
.editor-tab.active {
  color: var(--navy-800);
  border-bottom-color: var(--gold-500);
  background: var(--cream-50);
}

.editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}
.editor-tab-panel { display: none; }
.editor-tab-panel.active { display: block; animation: editorFade .25s var(--ease); }
@keyframes editorFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.editor-tab-panel h3 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-500);
  margin: 0 0 12px;
}
.editor-tab-panel h3:not(:first-child) { margin-top: 28px; }
.editor-tab-panel p {
  font-size: 13px;
  color: var(--ink-500);
  margin: 0 0 1em;
  line-height: 1.55;
}
.editor-tab-panel code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--cream-100);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.editor-row:last-child { border-bottom: 0; }
.editor-row > span {
  font-size: 14px;
  color: var(--ink-700);
}
.editor-row.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.editor-row .muted { color: var(--ink-300); font-size: 12px; font-weight: 500; }

.editor-row input[type="color"] {
  width: 52px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 2px;
  cursor: pointer;
}
.editor-row input[type="text"],
.editor-row input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--cream-50);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--ink-900);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.editor-row input[type="text"]:focus,
.editor-row input[type="password"]:focus {
  outline: none;
  border-color: var(--gold-500);
  background: #fff;
}
.editor-row input[type="range"] {
  flex: 0 0 170px;
  accent-color: var(--gold-500);
}
.editor-row select {
  flex: 0 0 220px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--cream-50);
  font-size: 14px;
  color: var(--ink-900);
  cursor: pointer;
}

.editor-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}
.preset {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
  cursor: pointer;
  transition: transform .15s var(--ease), border-color .15s var(--ease);
  padding: 0;
}
.preset:hover { transform: translateY(-2px); border-color: var(--gold-500); }
.preset > span { display: block; width: 100%; height: 100%; }

.editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--navy-800);
  color: var(--cream-50);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--navy-800);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
  margin: 6px 8px 0 0;
}
.editor-btn:hover { background: var(--navy-900); color: var(--cream-50); }
.editor-btn.ghost {
  background: transparent;
  color: var(--navy-800);
  border-color: var(--line);
}
.editor-btn.ghost:hover {
  background: var(--cream-100);
  color: var(--ink-900);
}
.editor-btn.primary {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}
.editor-btn.primary:hover {
  background: var(--gold-600);
  color: var(--cream-50);
  border-color: var(--gold-600);
}

.editor-upload { display: flex; flex-wrap: wrap; }

.editor-note {
  font-size: 12px;
  color: var(--ink-500);
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 14px;
  line-height: 1.55;
}

.editor-status {
  font-size: 13px;
  padding: 0;
  margin: 12px 0 0;
  min-height: 22px;
  line-height: 1.4;
  color: var(--ink-500);
  transition: color .15s var(--ease);
}
.editor-status.success {
  color: #1e6a36;
  font-weight: 500;
}
.editor-status.error {
  color: #9a2828;
  font-weight: 500;
}

/* ---------- Content edit mode ---------- */
.editor-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.editor-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.editor-switch-track {
  position: absolute;
  inset: 0;
  background: var(--cream-200);
  border-radius: 999px;
  transition: background .2s var(--ease);
}
.editor-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.editor-switch input:checked ~ .editor-switch-track {
  background: var(--gold-500);
}
.editor-switch input:checked ~ .editor-switch-track::after {
  transform: translateX(20px);
}

body.edit-mode [data-edit-id] {
  outline: 1px dashed transparent;
  outline-offset: 4px;
  border-radius: 4px;
  transition: outline-color .15s var(--ease), background-color .15s var(--ease);
  cursor: text;
}
body.edit-mode [data-edit-id]:hover {
  outline-color: rgba(200, 169, 106, 0.55);
  background-color: rgba(200, 169, 106, 0.06);
}
body.edit-mode [data-edit-id]:focus {
  outline: 1px solid var(--gold-500);
  outline-offset: 4px;
  background-color: rgba(200, 169, 106, 0.10);
}

body.edit-mode [data-edit-added="true"]::before {
  content: "added";
  position: absolute;
  margin-top: -1.4em;
  margin-left: -0.6em;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-600);
  background: var(--cream-50);
  padding: 1px 6px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  pointer-events: none;
}
body.edit-mode [data-edit-added="true"] { position: relative; }

[data-edit-id].is-edit-deleted { display: none !important; }
body.edit-mode [data-edit-id].is-edit-deleted {
  display: block !important;
  opacity: 0.35;
  text-decoration: line-through;
  outline-color: rgba(154, 40, 40, 0.55) !important;
}

.edit-toolbar {
  position: absolute;
  z-index: 95;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.edit-toolbar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
body:not(.edit-mode) .edit-toolbar { display: none; }

.edit-toolbar-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  background: #c8362b;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: background .15s var(--ease), transform .1s var(--ease);
}
.edit-toolbar-btn:hover {
  background: #a4271e;
  transform: scale(1.06);
}
.edit-toolbar-btn:active { transform: scale(0.95); }

@media (max-width: 480px) {
  .editor-panel { width: 100vw; }
  .editor-fab {
    right: 16px;
    bottom: 16px;
    padding: 11px 14px;
  }
  .editor-fab span { display: none; }
  .editor-row select { flex: 0 0 160px; }
  .editor-row input[type="range"] { flex: 0 0 140px; }
}
