@font-face { font-family: "Spectral"; src: url("spectral-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Spectral"; src: url("spectral-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Karla"; src: url("karla-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Karla"; src: url("karla-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --wine: #7a1f3d;
  --wine-deep: #5a1229;
  --wine-pale: #f6e7ec;
  --cream: #fdf8f3;
  --stone: #f1e9df;
  --slate: #2f3a45;
  --slate-2: #4f5b66;
  --sage: #5f8a68;
  --sage-pale: #e5efe6;
  --line: #e4d9cc;
  --serif: "Spectral", Georgia, serif;
  --sans: "Karla", "Segoe UI", Arial, sans-serif;
  --max: 1200px;
  --r: 14px;
}
* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--sans); font-size: 1.07rem; line-height: 1.68; color: var(--slate); background: var(--cream); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wine); }
a:hover { color: var(--wine-deep); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: #1f262d; line-height: 1.16; margin: 0 0 .55em; }
h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.8rem); }
h2 { font-size: clamp(1.65rem, 1.25rem + 1.5vw, 2.35rem); }
h3 { font-size: 1.28rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.jump { position: absolute; left: 1rem; top: -4rem; z-index: 99; background: var(--wine); color: #fff; padding: .5rem 1rem; border-radius: var(--r); }
.jump:focus { top: 1rem; }
.over { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sage); display: block; margin-bottom: .7rem; }

/* Barra superior */
.bar { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.bar-in { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #1f262d; }
.brand svg { width: 40px; height: 40px; }
.brand span { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; }
.nav-toggle { display: none; align-items: center; gap: .4rem; border: 1px solid var(--slate); background: transparent; border-radius: 999px; padding: .45rem 1rem; font: 700 .9rem var(--sans); color: var(--slate); cursor: pointer; }
.nav-toggle svg { width: 18px; height: 18px; }
.links { display: flex; align-items: center; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.links a { display: block; padding: .45rem .8rem; border-radius: 999px; text-decoration: none; color: var(--slate); font-weight: 700; font-size: .93rem; }
.links a:hover { background: var(--stone); color: var(--slate); }
.links a[aria-current="page"] { background: var(--wine-pale); color: var(--wine); }
.links .pill { background: var(--wine); color: #fff; margin-left: .4rem; }
.links .pill:hover { background: var(--wine-deep); color: #fff; }
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-box { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--cream); border-bottom: 1px solid var(--line); padding: .6rem 16px 1.2rem; }
  .nav-box.shown { display: block; }
  .links { flex-direction: column; align-items: stretch; }
  .links .pill { margin: .5rem 0 0; text-align: center; }
}

/* Botones */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.5rem; border-radius: 999px; background: var(--wine); color: #fff; border: 2px solid var(--wine); font: 700 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--wine-deep); border-color: var(--wine-deep); color: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: transparent; color: var(--wine); }
.btn.ghost:hover { background: var(--wine-pale); color: var(--wine-deep); }
.btn.sage { background: var(--sage); border-color: var(--sage); }

/* Apertura */
.opening { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem); text-align: center; }
.opening h1 { max-width: 52rem; margin-inline: auto; }
.opening .intro { max-width: 44rem; margin: 0 auto 1.8rem; font-size: 1.18rem; color: var(--slate-2); }
.opening .actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 3rem; text-align: left; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.2rem; }
.stats b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--wine); line-height: 1.1; }
.stats span { font-size: .9rem; color: var(--slate-2); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } }
.opening-photo { margin: 3rem 0 0; border-radius: var(--r); overflow: hidden; position: relative; }
.opening-photo img { width: 100%; max-height: 420px; object-fit: cover; }
.opening-photo figcaption { position: absolute; left: 1rem; bottom: 1rem; right: 1rem; max-width: 34rem; background: rgba(253,248,243,.95); padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; text-align: left; }

/* Diseño con índice lateral */
.study { display: grid; grid-template-columns: 250px 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); padding: clamp(2rem, 5vw, 4rem) 0; }
.toc { position: sticky; top: 92px; align-self: start; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; }
.toc h2 { font-size: 1.05rem; margin-bottom: .6rem; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.toc li { counter-increment: t; }
.toc ol a { display: flex; gap: .55rem; padding: .35rem .3rem; text-decoration: none; color: var(--slate); font-size: .93rem; border-radius: 8px; }
.toc ol a::before { content: counter(t); font-family: var(--serif); color: var(--wine); font-weight: 600; min-width: 1rem; }
.toc ol a:hover, .toc ol a.on { background: var(--wine-pale); color: var(--wine); }
.toc .btn { width: 100%; justify-content: center; margin-top: 1rem; padding: .7rem 1rem; font-size: .92rem; }
@media (max-width: 960px) { .study { grid-template-columns: 1fr; } .toc { position: static; } }

.chapter { padding-bottom: clamp(2.5rem, 5vw, 3.5rem); margin-bottom: clamp(2.5rem, 5vw, 3.5rem); border-bottom: 1px solid var(--line); }
.chapter:last-child { border-bottom: 0; margin-bottom: 0; }
.chapter > header p { font-size: 1.12rem; color: var(--slate-2); max-width: 44rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.pair.r { grid-template-columns: 1.2fr .8fr; }
@media (max-width: 760px) { .pair, .pair.r { grid-template-columns: 1fr; } }
.photo { border-radius: var(--r); overflow: hidden; margin: 0; }
.photo + .cap, figure .cap { font-size: .86rem; color: var(--slate-2); margin-top: .6rem; }

.terms { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; list-style: none; padding: 0; margin: 1.6rem 0 0; }
.terms li { background: var(--stone); border-radius: var(--r); padding: 1rem; }
.terms b { display: block; font-family: var(--serif); font-size: 1.12rem; color: var(--wine); }
.terms span { font-size: .93rem; }
@media (max-width: 860px) { .terms { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .terms { grid-template-columns: 1fr; } }

/* Flujos de caja */
.flows { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.3rem 1.3rem 1rem; }
.flows-chart { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; padding: 0 .3rem; }
.flows-col { display: grid; grid-template-rows: 200px 90px; }
.flows-col .up { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; border-bottom: 2px solid var(--slate); }
.flows-col .down { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.flows-col i { display: block; width: 70%; max-width: 54px; }
.flows-col .out { background: var(--wine); height: 70px; border-radius: 0 0 6px 6px; }
.flows-col .cp { background: var(--sage); height: 16px; border-radius: 6px 6px 0 0; }
.flows-col .nm { background: #c9b79c; height: 150px; border-radius: 6px 6px 0 0; }
.flows-col .cp + .nm, .flows-col .nm + .cp { border-radius: 0; }
.flows-col small { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.flows-years { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; text-align: center; font-size: .82rem; color: var(--slate-2); padding-top: .4rem; }
.flows-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .86rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.flows-legend li { display: flex; align-items: center; gap: .4rem; }
.flows-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.flow-notes { list-style: none; padding: 0; margin: 0; }
.flow-notes li { padding: .7rem 0 .7rem 1rem; border-left: 4px solid var(--line); margin-bottom: .6rem; }
.flow-notes li.a { border-color: var(--wine); }
.flow-notes li.b { border-color: var(--sage); }
.flow-notes li.c { border-color: #c9b79c; }

/* Tablas */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); background: #fff; margin: 1.2rem 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 600px; }
.tbl.narrow { min-width: 340px; }
.tbl caption { caption-side: bottom; text-align: left; padding: .8rem 1rem; font-size: .84rem; color: var(--slate-2); background: var(--stone); }
.tbl th, .tbl td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { background: var(--slate); color: #fff; font-weight: 700; font-size: .9rem; }
.tbl tbody th { font-weight: 700; color: #1f262d; }
.tbl .num td { font-variant-numeric: tabular-nums; }
.tbl tr.base { background: var(--sage-pale); }

/* Casos */
.case { background: var(--wine-pale); border-radius: var(--r); padding: 1.3rem 1.4rem; margin: 1.3rem 0; }
.case .over { color: var(--wine); margin-bottom: .4rem; }
.case p:last-child { margin-bottom: 0; }
.case .eq { font-family: var(--serif); font-size: 1.05rem; background: #fff; border-radius: 8px; padding: .6rem .8rem; overflow-wrap: anywhere; }

/* Riesgos */
.risk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.risk-grid article { background: #fff; border-radius: var(--r); border: 1px solid var(--line); padding: 1.2rem; border-top: 5px solid var(--wine); }
.risk-grid h3 { font-size: 1.12rem; margin-bottom: .35rem; }
.risk-grid p { margin: 0; font-size: .95rem; }
@media (max-width: 860px) { .risk-grid { grid-template-columns: 1fr; } }
.ladder { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
.ladder li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: baseline; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem 1rem; }
.ladder b { font-family: var(--serif); font-size: 1.1rem; color: var(--sage); }
.ladder li.low b { color: var(--wine); }

/* Lectura del folleto */
.reading { list-style: none; padding: 0; margin: 0; counter-reset: rd; }
.reading li { counter-increment: rd; position: relative; padding: 0 0 1.2rem 3rem; }
.reading li::before { content: counter(rd); position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--slate); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-weight: 600; }
.reading b { display: block; color: #1f262d; }

/* Glosario */
.gloss { display: grid; grid-template-columns: repeat(2, 1fr); gap: .2rem 2.5rem; margin: 0; }
.gloss div { padding: .9rem 0; border-bottom: 1px dashed var(--line); }
.gloss dt { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: #1f262d; }
.gloss dd { margin: .2rem 0 0; font-size: .97rem; }
@media (max-width: 700px) { .gloss { grid-template-columns: 1fr; } }

/* Preguntas */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .7rem; }
.faq summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "▾"; color: var(--wine); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details > div { padding: 0 1.2rem 1.1rem; }
.faq details > div p { margin: 0; }

/* Inscripción */
.enrol { background: var(--slate); color: #d9e0e6; padding: clamp(3rem, 7vw, 5.5rem) 0; }
.enrol h2, .enrol h3 { color: #fff; }
.enrol .over { color: #a9cdb0; }
.enrol-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(2rem, 5vw, 4rem); }
.sessions { list-style: none; padding: 0; margin: 1.6rem 0; display: grid; gap: .8rem; }
.sessions li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; background: rgba(255,255,255,.06); border-radius: var(--r); padding: 1rem; }
.sessions .no { font-family: var(--serif); font-size: 1.9rem; color: #f0b7c8; line-height: 1; }
.sessions .no small { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #a9b6c1; }
.sessions b { display: block; color: #fff; }
@media (max-width: 860px) { .enrol-grid { grid-template-columns: 1fr; } }
.card-form { background: var(--cream); color: var(--slate); border-radius: var(--r); padding: clamp(1.3rem, 3vw, 2.1rem); }
.card-form h3 { color: #1f262d; font-size: 1.55rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 540px) { .duo { grid-template-columns: 1fr; } }
.inp { margin-bottom: 1rem; }
.inp label { display: block; font-weight: 700; font-size: .93rem; margin-bottom: .3rem; }
.inp input, .inp textarea { width: 100%; font: inherit; padding: .75rem .95rem; border: 1px solid #cbbfae; border-radius: 10px; background: #fff; color: var(--slate); }
.inp input:focus, .inp textarea:focus { border-color: var(--wine); outline: 3px solid var(--wine-pale); }
.inp textarea { min-height: 150px; resize: vertical; }
.inp small { display: block; font-size: .82rem; color: var(--slate-2); margin-top: .25rem; }
.mand { color: var(--wine); }
.agree { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; margin-bottom: .85rem; }
.agree input { width: 18px; height: 18px; flex: none; margin-top: .25rem; accent-color: var(--wine); }
.fine { font-size: .84rem; color: var(--slate-2); }
.rgpd { margin-top: 1.4rem; background: #fff; border-radius: 10px; padding: .9rem 1rem; font-size: .82rem; }
.rgpd strong.t { display: block; font-family: var(--serif); font-size: .98rem; margin-bottom: .4rem; color: #1f262d; }
.rgpd dl { margin: 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: .3rem .8rem; }
.rgpd dt { font-weight: 700; color: #1f262d; }
.rgpd dd { margin: 0; }

/* Páginas internas */
.top { padding: clamp(2.6rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); background: var(--stone); }
.top h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); max-width: 50rem; }
.top p { max-width: 44rem; font-size: 1.12rem; color: var(--slate-2); margin: 0; }
.path { font-size: .86rem; margin-bottom: 1rem; color: var(--slate-2); }
.stamp { display: inline-block; margin-top: 1rem !important; font-size: .85rem !important; background: #fff; border-radius: 999px; padding: .2rem .8rem; }
.inner { padding: clamp(2.6rem, 6vw, 4.5rem) 0; }
.doc { max-width: 47rem; }
.doc h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin-bottom: .4rem; }
.hint { background: var(--sage-pale); border-radius: var(--r); padding: 1rem 1.2rem; margin-bottom: 1.6rem; }
.hint p:last-child { margin: 0; }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; list-style: none; padding: 0; margin: 1.2rem 0; }
.cards2 li { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.2rem; }
.cards2 b { display: block; font-family: var(--serif); font-size: 1.1rem; color: var(--wine); margin-bottom: .2rem; }
@media (max-width: 640px) { .cards2 { grid-template-columns: 1fr; } }
.reach { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.reach li { display: flex; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.reach svg { width: 22px; height: 22px; flex: none; color: var(--wine); margin-top: .2rem; }
.reach b { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-2); }
.centered { text-align: center; max-width: 40rem; margin-inline: auto; }
.giant { font-family: var(--serif); font-size: clamp(4.5rem, 12vw, 8rem); line-height: 1; color: var(--wine); margin: 0 0 .4rem; }
.row-btns { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.6rem; }

/* Pie */
.foot { background: #1f262d; color: #b8c2cb; padding: 3.4rem 0 1.6rem; font-size: .94rem; }
.foot a { color: #fff; }
.foot a:hover { color: #f0b7c8; }
.foot .brand { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.4rem; }
.foot h2 { font-family: var(--sans); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: #8796a3; margin-bottom: .9rem; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.foot-reach li { display: flex; gap: .5rem; align-items: flex-start; }
.foot-reach svg { width: 17px; height: 17px; flex: none; margin-top: .3rem; color: #f0b7c8; }
.textbtn { background: none; border: 0; padding: 0; font: inherit; color: #fff; text-decoration: underline; cursor: pointer; }
.textbtn:hover { color: #f0b7c8; }
.foot-note { margin: 2.4rem 0 1.2rem; padding: 1rem 1.2rem; background: rgba(255,255,255,.05); border-radius: var(--r); font-size: .86rem; }
.foot-note p { margin: 0; }
.foot-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .82rem; color: #8796a3; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr; } }

/* Cookies */
.ck { position: fixed; left: 16px; bottom: 16px; z-index: 70; width: min(420px, calc(100% - 32px)); background: #fff; border-radius: var(--r); box-shadow: 0 24px 50px -20px rgba(31,38,45,.45); border: 1px solid var(--line); padding: 1.2rem; font-size: .92rem; }
.ck h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.ck-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .8rem; }
.ck-btns button { font: 700 .9rem var(--sans); padding: .6rem .8rem; border-radius: 999px; border: 1.5px solid var(--slate); background: #fff; color: var(--slate); cursor: pointer; }
.ck-btns button:hover { background: var(--stone); }
.ck-btns .main { background: var(--wine); border-color: var(--wine); color: #fff; }
.ck-btns .main:hover { background: var(--wine-deep); }
.ck-btns .full { grid-column: 1 / -1; }
.ck-panel { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .8rem; }
.ck-line { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; }
.ck-line b { display: block; }
.ck-line span, .ck-line label { font-size: .86rem; color: var(--slate-2); }
.ck-line input { width: 19px; height: 19px; flex: none; accent-color: var(--wine); margin-top: .2rem; }

/* Evita desbordes horizontales en rejillas */
.study > *, .pair > *, .enrol-grid > *, .foot-grid > * { min-width: 0; }
@media (max-width: 480px) { .flows-col small { font-size: .7rem; } .flows-chart { gap: .3rem; } }
