/* =============================================================
   Jose Rebollo — hoja de estilos única, sin dependencias.
   Sin frameworks, sin CDN, sin build. Se sube tal cual.
   Orden: 1) variables  2) reset  3) tipografía  4) layout
          5) componentes  6) responsive  7) accesibilidad
   ============================================================= */

/* ---------- 1. VARIABLES ---------- */
:root {
  /* Paleta. Cambia --accent y todo el sitio cambia de color. */
  --accent:        #0d7a6f;
  --accent-strong: #095e55;
  --accent-soft:   #e6f4f2;

  --bg:       #ffffff;
  --bg-alt:   #f5f8f8;
  --ink:      #0e1a1e;
  --ink-soft: #3d4f56;
  --muted:    #5f7178;
  --line:     #e2eaeb;

  --dark-bg:   #0a1417;
  --dark-bg-2: #0f1e22;
  --dark-ink:  #e9f2f1;
  --dark-muted:#9fb4b6;
  --dark-line: #1d3238;

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 1px 2px rgba(14,26,30,.05), 0 8px 24px -12px rgba(14,26,30,.18);
  --shadow-lg: 0 2px 4px rgba(14,26,30,.06), 0 24px 60px -20px rgba(14,26,30,.28);

  --wrap: 1140px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; }

/* ---------- 3. TIPOGRAFÍA ---------- */
h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.9vw, 3.5rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); max-width: 24ch; }
h3 { font-size: 1.16rem; }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9em;
}
.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.22rem); color: var(--ink-soft); }
.lead-narrow { max-width: 62ch; }
.hint { font-size: .85rem; color: var(--muted); margin: .5em 0 0; }
.hint-center { text-align: center; }

/* ---------- 4. LAYOUT ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
/* La cabecera es fija: sin esto, al pulsar un enlace del menú el título
   de la sección queda escondido debajo de ella. */
section[id], main[id] { scroll-margin-top: 84px; }
.wrap-narrow { max-width: 760px; }
.section { padding: clamp(56px, 7vw, 104px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-foot {
  margin-top: 2.4rem; padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft); max-width: 72ch;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 2.4rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 2.4rem; }

/* ---------- 5. COMPONENTES ---------- */

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .78em 1.45em;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent); border-radius: 999px;
  font-weight: 650; font-size: .96rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: none; }
.btn-lg { padding: .95em 1.8em; font-size: 1.02rem; }
.btn-sm { padding: .55em 1.1em; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--ink); border-color: var(--muted); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,20,23,.92);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--dark-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: .6em; text-decoration: none; color: var(--dark-ink); }
.brand-mark {
  display: grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 7px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .84rem;
  letter-spacing: -.02em;
}
.brand-text { font-weight: 500; letter-spacing: -.01em; font-size: 1.06rem; }
.brand-text strong { font-weight: 800; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav > a {
  color: var(--dark-muted); text-decoration: none;
  padding: .5em .8em; border-radius: 8px; font-size: .93rem;
}
.nav > a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav > a.btn { color: #fff; margin-left: 8px; }
.nav > a.btn:hover { color: #fff; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 10px; cursor: pointer;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--dark-ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-mobile { display: none; flex-direction: column; padding: 8px 24px 20px; background: var(--dark-bg); border-bottom: 1px solid var(--dark-line); }
.nav-mobile a { color: var(--dark-ink); text-decoration: none; padding: .8em 0; border-bottom: 1px solid var(--dark-line); }
.nav-mobile a:last-child { border-bottom: 0; color: var(--accent); font-weight: 650; }

/* Hero */
.hero { background: var(--dark-bg); color: var(--dark-ink); padding: clamp(56px, 7vw, 96px) 0 clamp(64px, 8vw, 104px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% 45% 30% -10%;
  background: radial-gradient(closest-side, rgba(13,122,111,.30), transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero .lead { color: #c8dbda; max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.5); color: #fff; }
.hero-note { margin-top: 1.4rem; font-size: .9rem; color: var(--dark-muted); }

/* Tarjeta "terminal" del hero */
.hero-card {
  background: var(--dark-bg-2); border: 1px solid var(--dark-line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.card-head { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--dark-line); background: rgba(255,255,255,.02); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2b4349; }
.card-title { margin-left: 8px; font-family: var(--mono); font-size: .78rem; color: var(--dark-muted); }
.flow { list-style: none; padding: 14px 16px; display: grid; gap: 2px; }
.flow li { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: baseline; padding: 7px 0; font-size: .92rem; color: #cfe0df; border-bottom: 1px dashed rgba(255,255,255,.06); }
.flow li:last-child { border-bottom: 0; }
.flow-time { font-family: var(--mono); font-size: .78rem; color: var(--dark-muted); }
.flow-done { color: #6ee7d5; font-weight: 650; }
.flow-done .flow-time { color: #6ee7d5; }
.card-foot { padding: 12px 16px 16px; margin: 0; font-size: .82rem; color: var(--dark-muted); border-top: 1px solid var(--dark-line); }

/* Franja de compromisos */
.strip { background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.strip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 28px 24px; }
.strip-grid > div { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; border-left: 2px solid var(--accent); }
.strip-grid strong { font-size: .96rem; line-height: 1.3; }
.strip-grid span { font-size: .87rem; color: var(--ink-soft); }

/* Dolores */
.pains { gap: 20px; }
.pain { padding: 24px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); }
.pain h3 { color: var(--ink); }
.pain p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* Servicios */
.svc { display: flex; flex-direction: column; padding: 26px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.svc > p:first-of-type { color: var(--ink-soft); font-size: .97rem; }
.svc ul { list-style: none; margin: .4rem 0 1.2rem; display: grid; gap: .55rem; }
.svc li { position: relative; padding-left: 1.5em; font-size: .94rem; color: var(--ink-soft); }
.svc li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--accent); opacity: .85;
}
.svc-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .87rem; color: var(--muted); }

/* Estimador */
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 2.4rem; align-items: start; }
.calc-controls { display: grid; gap: 22px; padding: 28px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); }
.range-row { display: flex; align-items: center; gap: 16px; }
.range-row output {
  min-width: 62px; text-align: center; padding: .3em .6em;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .92rem; font-weight: 650;
}
input[type="range"] { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: var(--line); outline-offset: 6px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: var(--shadow); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: var(--shadow); cursor: grab; }

.calc-result { padding: 28px; background: var(--dark-bg); color: var(--dark-ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.calc-label { margin: 0; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dark-muted); font-weight: 700; }
.calc-big { margin: .2em 0 .6em; font-size: clamp(2.3rem, 1.6rem + 3vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; color: #6ee7d5; line-height: 1; }
.calc-detail { list-style: none; display: grid; gap: 0; margin: 1.2rem 0; border-top: 1px solid var(--dark-line); }
.calc-detail li { display: flex; justify-content: space-between; gap: 12px; padding: .7em 0; border-bottom: 1px solid var(--dark-line); font-size: .93rem; }
.calc-detail span { color: var(--dark-muted); }
.calc-note { font-size: .82rem; color: var(--dark-muted); margin-bottom: 1.4rem; }
.calc-result .btn { width: 100%; }

/* Proceso */
.steps { list-style: none; counter-reset: s; display: grid; gap: 18px; margin-top: 2.4rem; }
/* El número ocupa las dos filas de la izquierda; título y texto se apilan a su derecha.
   Sin las áreas explícitas, el <p> caería en la columna de 52px y se partiría
   palabra por palabra. */
.steps li {
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-areas: "num titulo" "num texto";
  column-gap: 20px; row-gap: .35rem; align-items: start;
  padding: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.step-n {
  grid-area: num;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 800; font-size: 1.15rem; border: 1px solid rgba(13,122,111,.2);
}
.steps h3 { grid-area: titulo; margin: 0; align-self: center; }
.steps p  { grid-area: texto; margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* Casos */
.case { padding: 24px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); }
.case-tag { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; color: var(--accent-strong); margin-bottom: .8em; }
.case h3 { font-size: 1.05rem; }
.case-body { font-size: .93rem; color: var(--ink-soft); line-height: 1.75; }
.case-meta { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

/* Sección "Quién soy" */
.bio h2 { max-width: 30ch; }
.bio p { color: var(--ink-soft); }
.bio .lead { color: var(--ink); }
.bio-links { display: flex; gap: 18px; margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.bio-links a { font-weight: 650; font-size: .95rem; }

/* FAQ */
details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); margin-bottom: 10px; overflow: hidden;
}
details summary {
  cursor: pointer; padding: 16px 46px 16px 18px; font-weight: 650; position: relative; list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; font-weight: 400; color: var(--accent); line-height: 1;
}
details[open] summary::after { content: "−"; }
details[open] summary { border-bottom: 1px solid var(--line); }
details p { padding: 16px 18px; margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Contacto */
.section-contact { background: var(--bg-alt); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 60px); align-items: start; }
.contact-points { list-style: none; display: grid; gap: .7rem; margin: 1.6rem 0; }
.contact-points li { position: relative; padding-left: 1.7em; font-size: .96rem; color: var(--ink-soft); }
.contact-points li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.contact-alt { font-size: .93rem; color: var(--muted); }

/* Formulario */
.form { padding: clamp(22px, 3vw, 32px); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: .9rem; font-weight: 650; color: var(--ink); }
.req { color: #b4341f; }
.opt { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%; padding: .72em .85em;
  font-family: inherit; font-size: .97rem; color: var(--ink);
  background: var(--bg); border: 1px solid #cfdbdc; border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%235f7178' stroke-width='1.8' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,122,111,.16); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #b4341f; box-shadow: 0 0 0 3px rgba(180,52,31,.12); }
.field-error { font-size: .84rem; color: #b4341f; }

.field-check { margin: 1.4rem 0; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 11px; align-items: start; font-weight: 400; font-size: .89rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--accent); }

/* Honeypot: invisible para personas, presente para bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 1rem 0 0; padding: 0; font-size: .93rem; text-align: center; }
.form-status.is-error { color: #b4341f; font-weight: 650; }
.form-status.is-ok { color: var(--accent-strong); font-weight: 650; }
.form-sent {
  text-align: center; padding: 2rem 1rem;
}
.form-sent h3 { color: var(--accent-strong); }

/* Footer */
.site-footer { background: var(--dark-bg); color: var(--dark-muted); padding: clamp(40px, 5vw, 64px) 0 24px; font-size: .93rem; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; padding-bottom: 32px; }
.footer-brand .brand-text { color: var(--dark-ink); font-size: 1.1rem; }
.footer-brand p { margin-top: .7rem; max-width: 34ch; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 { color: var(--dark-ink); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1em; }
.footer-cols a { display: block; color: var(--dark-muted); text-decoration: none; padding: .28em 0; }
.footer-cols a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 22px; border-top: 1px solid var(--dark-line); font-size: .85rem; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--dark-muted); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* Páginas de texto legal */
.page { padding: clamp(48px, 6vw, 80px) 0; }
.page h1 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem); }
.page h2 { font-size: 1.25rem; margin-top: 2.2rem; max-width: none; }
.page p, .page li { color: var(--ink-soft); font-size: .97rem; }
.page ul, .page ol { padding-left: 1.3em; margin-bottom: 1.1em; display: grid; gap: .4rem; }
.page-note {
  padding: 16px 18px; margin-bottom: 2rem;
  background: #fdfaf1; border: 1px dashed #c9b26a; border-radius: var(--radius-sm);
  font-size: .9rem;
}
.page-updated { font-size: .87rem; color: var(--muted); }

/* ---------- 6. RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero h1 { max-width: 26ch; }
  .calc, .contact-grid { grid-template-columns: 1fr; }
  .strip-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile[data-open="true"] { display: flex; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .strip-grid { grid-template-columns: 1fr; gap: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 1fr; grid-template-areas: "num" "titulo" "texto"; row-gap: 10px; }
  .step-n { width: 42px; height: 42px; font-size: 1rem; }
  .hero-actions .btn { width: 100%; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- 7. ACCESIBILIDAD ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .8em 1.2em; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  .site-header, .hero-card, .form, .site-footer, .nav-mobile { display: none !important; }
  body { color: #000; }
}
