:root {
  color-scheme: light;
  --paper: #f7f3eb;
  --paper-deep: #eee8dd;
  --surface: #fffdf8;
  --ink: #131310;
  --muted: #77746d;
  --line: #dcd6cc;
  --accent: #131310;
  --accent-halo: #13131020;
  --intro-accent: #e8e4da;
  --intro-pattern: #ffffff0e;
  --heading: #191a19;
  --support: #4d514f;
  --field-bg: #f8f7f3;
  --field-border: #a6aaa7;
  --placeholder: #58615d;
  --radius: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.contact-check { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
::selection { background: #c8c5bc; color: #171411; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.site-shell { max-width: 1740px; min-height: 100vh; margin: auto; }
.topbar { height: 89px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(25px, 4vw, 72px); border-bottom: 1px solid var(--line); }
.wordmark { color: var(--ink); font-size: 34px; line-height: 1; font-weight: 780; letter-spacing: -.09em; text-decoration: none; padding-right: 8px; }
.wordmark span { color: var(--accent); }
.topbar-note { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.edition { color: #aaa298; font-weight: 600; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px var(--accent-halo); }

.layout { display: grid; grid-template-columns: minmax(325px, 41%) minmax(0, 1fr); min-height: calc(100vh - 141px); background: var(--surface); }
.intro-panel { position: sticky; top: 0; align-self: start; min-height: max(690px, calc(100vh - 89px)); background: #151815; color: #f5f1e9; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px, 4vw, 70px); }
.intro-top, .intro-bottom { position: relative; z-index: 1; }
.eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .17em; }
.eyebrow.light { color: var(--intro-accent); }
.intro-panel h1 { max-width: 700px; margin: 38px 0 26px; font-size: clamp(38px, 3.7vw, 60px); line-height: 1.07; letter-spacing: -.065em; font-weight: 600; }
.intro-panel h1 em, .step h2 i { font-family: Georgia, Cambria, serif; font-weight: 400; letter-spacing: -.045em; }
.intro-panel h1 em { color: var(--intro-accent); }
.intro-panel p { color: #d2d3cd; line-height: 1.65; max-width: 440px; font-size: 15px; }
.intro-bottom { max-width: 480px; }
.intro-line { display: flex; align-items: center; gap: 22px; border-top: 1px solid #ffffff30; padding: 12px 11px; color: #c7c8c2; font-size: 13px; }
.intro-line.current { background: #ffffff17; border-left: 3px solid var(--intro-accent); padding-left: 8px; color: #fffdf8; font-weight: 750; }
.intro-line.current::after { content: "←"; margin-left: auto; color: var(--intro-accent); }
.intro-line.done { color: #ecece8; }
.line-number { font-size: 12px; color: var(--intro-accent); font-weight: 700; }
.panel-footnote { border-top: 1px solid #ffffff2a; display: flex; justify-content: space-between; margin-top: 19px; padding-top: 18px; color: #b5c1c1; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.panel-footnote span { color: var(--intro-accent); font-size: 23px; line-height: .6; }

.workspace { width: min(850px, 100%); margin: 0 auto; padding: 42px clamp(25px, 4.7vw, 86px) 90px; background: var(--surface); }
.preview-notice { display: flex; align-items: flex-start; gap: 15px; background: #eeeae3; border: 1px solid #d9d3ca; border-radius: 17px; padding: 16px 18px; margin-bottom: 46px; }
.preview-symbol { font-size: 21px; line-height: 1.1; color: var(--accent); }
.preview-notice div { display: flex; flex-direction: column; gap: 4px; }
.preview-notice strong { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.preview-notice span:last-child { color: #6e6860; font-size: 12px; line-height: 1.5; }
.progress-block { margin-bottom: 52px; }
.progress-heading { display: flex; justify-content: space-between; gap: 15px; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--support); }
.progress-track { position: relative; height: 3px; background: #e0d8cc; margin: 14px 0 13px; overflow: hidden; }
.progress-track span { display: block; width: 20%; height: 100%; background: var(--accent); transition: width .35s ease; }
.step-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; color: #69726f; font-size: 10px; font-weight: 650; }
.step-list li.current { color: var(--heading); font-weight: 800; }
.step-list li.done { color: #435f59; }
.step-list li:not(:first-child) { text-align: center; }
.step-list li:last-child { text-align: right; }

.section-kicker { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.mini-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #e9e7e1; color: #292925; font-size: 12px; letter-spacing: 0; }
.step h2 { font-size: clamp(42px, 4.15vw, 70px); line-height: 1.08; letter-spacing: -.07em; margin: 27px 0 16px; font-weight: 650; color: var(--heading); }
.step h2 i { color: #484842; }
.lead { max-width: 640px; line-height: 1.68; color: var(--support); margin: 0 0 34px; font-size: 15px; }

.branch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 34px 0 38px; }
.branch-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 249px; padding: 23px; border: 1px solid #ddd5c9; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 6px 24px #3d2b1e06; transition: transform .2s, border-color .2s, box-shadow .2s; }
.branch-card:hover { transform: translateY(-3px); border-color: #c2a591; box-shadow: 0 14px 35px #3d2b1e13; }
.branch-card[aria-pressed="true"] { border: 2px solid var(--accent); padding: 22px; box-shadow: 0 0 0 3px var(--accent-halo); }
.branch-icon { display: grid; place-items: center; border-radius: 14px; width: 42px; height: 42px; font-size: 25px; }
.brand-spark { display: inline-block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; vertical-align: -.12em; }
.health-icon { background: #dfebf8; color: #285e95; }
.agency-icon { background: #eae8e3; color: #151512; }
.branch-title { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: #102d4d; margin-top: 23px; letter-spacing: -.04em; }
.branch-card[data-choose-brand="agency"] .branch-title { color: #171915; }
.branch-title span { font-size: 18px; color: #a19286; }
.branch-description { font-size: 13px; color: #6e6a62; line-height: 1.55; margin-top: 9px; }
.branch-foot { font-size: 9px; letter-spacing: .12em; color: #9a8b7e; font-weight: 800; margin-top: auto; padding-top: 20px; }
.editorial-note { display: flex; gap: 25px; align-items: flex-start; padding: 23px 0; border-top: 1px solid var(--line); }
.editorial-note span { font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.editorial-note p { color: #767168; font-size: 13px; line-height: 1.6; margin: 0; }

.form-card { background: transparent; border: 0; border-top: 1px solid #cbd2d1; border-radius: 0; padding: 27px 0 20px; margin-bottom: 13px; box-shadow: none; }
.form-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; padding: 0; margin-bottom: 24px; font-size: 11px; font-weight: 800; letter-spacing: .13em; color: var(--accent); }
.form-card-heading span:last-child { color: var(--support); text-align: right; font-size: 10px; }
.field { min-width: 0; margin-bottom: 23px; }
.field:last-child, .field-row:last-child .field { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-size: 13px; font-weight: 750; line-height: 1.4; margin-bottom: 9px; color: var(--heading); }
.field label b { color: var(--accent); }
.field input, .field select, .field textarea { display: block; width: 100%; appearance: none; color: var(--heading); background: var(--field-bg); border: 0; border-bottom: 2px solid var(--field-border); border-radius: 5px 5px 0 0; padding: 14px 15px; min-height: 49px; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field select { appearance: auto; }
.field textarea { resize: vertical; line-height: 1.55; min-height: 105px; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-halo); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #bf4d3a; }
.field small { display: block; margin-top: 9px; font-size: 12px; line-height: 1.5; color: var(--support); }
.field input[type="file"] { cursor: pointer; padding: 10px; }
.field input[type="file"]::file-selector-button { border: 1px solid var(--field-border); border-radius: 5px; background: var(--surface); color: var(--heading); padding: 8px 11px; margin-right: 12px; font-weight: 700; cursor: pointer; }
.file-selection { margin: 12px 0 0; color: var(--support); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

.form-error { padding: 13px 16px; margin-top: 20px; border: 1px solid #d8a493; border-radius: 12px; background: #fff0e9; color: #97402a; font-size: 13px; }
.form-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 34px; border-top: 1px solid var(--line); padding-top: 22px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: none; font-size: 12px; font-weight: 750; white-space: nowrap; border-radius: 12px; padding: 15px 19px; min-height: 50px; }
.button-next { background: var(--accent); color: white; margin-left: auto; min-width: 146px; }
.button-next:hover, .button-dark:hover { filter: brightness(.84); }
.button-back { background: transparent; border: 1px solid #c9c1b8; color: #4b463f; }
.button-back:hover { background: #ece5db; }
.button-dark { background: var(--accent); color: #fff; }
.save-state { font-size: 11px; color: var(--support); display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.save-state::before { content: ""; width: 6px; height: 6px; background: #70947b; border-radius: 50%; }
.button-back:not([hidden]) + .save-state { margin-left: 0; }
.button-next + .save-state { margin-left: auto; }

.review-content { display: grid; gap: 16px; }
.review-card { border: 1px solid #e1d9ce; border-radius: 20px; background: var(--surface); padding: 25px; }
.review-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 15px; margin-bottom: 16px; border-bottom: 1px solid #e8e2da; }
.review-card h3 { font-size: 17px; margin: 0; letter-spacing: -.025em; }
.review-card-head button { background: none; border: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 11px; font-weight: 700; }
.review-rows { display: grid; gap: 14px; margin: 0; }
.review-row dt { font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .09em; color: var(--support); }
.review-row dd { margin: 5px 0 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.review-empty { font-size: 13px; color: #969087; }
.finish-panel { display: flex; align-items: flex-start; gap: 20px; margin: 23px 0 25px; padding: 27px; color: #efeee7; background: #1c201d; border-radius: 20px; }
.finish-star { font-size: 30px; color: var(--intro-accent); line-height: 1; }
.finish-panel h3 { margin: 0 0 7px; font-size: 17px; }
.finish-panel p { margin: 0; font-size: 12px; line-height: 1.6; color: #c7c7c0; }
.review-actions { display: flex; align-items: center; gap: 21px; flex-wrap: wrap; }
.submission-status { margin: 24px 0; padding: 22px; border: 1px solid #a8bcac; border-radius: 12px; background: #eff7ee; color: #1b593b; font-size: 15px; line-height: 1.6; }
.submit-consent { display: flex; align-items: flex-start; gap: 12px; max-width: 650px; margin: 25px 0 18px; font-size: 13px; line-height: 1.5; color: var(--support); }
.submit-consent input { width: 19px; height: 19px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.submit-consent a, .privacy-summary a { color: var(--accent); font-weight: 750; text-underline-offset: 3px; }
.privacy-summary { margin: -13px 0 30px; padding: 18px 21px; background: #edf1ef; border-left: 3px solid var(--accent); color: var(--heading); font-size: 12px; line-height: 1.65; }
.privacy-summary strong { display: block; font-size: 13px; margin-bottom: 5px; }
.privacy-summary p { margin: 0; }
.text-button { background: none; border: none; padding: 10px; color: var(--accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); padding: 18px clamp(25px, 4vw, 72px); font-size: 10px; color: #827b73; letter-spacing: .12em; font-weight: 700; }
.site-footer a { color: inherit; text-underline-offset: 3px; }
.privacy-page { max-width: 860px; margin: 0 auto; padding: 62px 24px 95px; }
.privacy-page h1 { font-size: clamp(44px, 6vw, 76px); letter-spacing: -.07em; line-height: 1.05; margin: 20px 0 8px; }
.privacy-date { color: #696e6a; font-size: 13px; margin: 0 0 44px; }
.privacy-page section { border-top: 1px solid var(--line); padding: 23px 0 25px; }
.privacy-page h2 { font-size: 21px; letter-spacing: -.035em; margin: 0 0 13px; }
.privacy-page p { font-size: 15px; line-height: 1.7; color: #424a47; margin: 0 0 13px; }
.privacy-page p:last-child { margin-bottom: 0; }
.privacy-page a { color: #285e95; overflow-wrap: anywhere; text-underline-offset: 3px; }

[data-brand="salud"] { --accent: #285e95; --accent-halo: #285e9527; --intro-accent: #a9cef2; --intro-pattern: #78b5ef20; --heading: #172e41; --support: #3b5366; --field-bg: #f2f6f9; --field-border: #8ba4b8; --placeholder: #516779; }
[data-brand="salud"] .intro-panel { background: #102d4d; }
[data-brand="salud"] .intro-panel p { color: #d3e1ed; }
[data-brand="salud"] .step h2 i { color: #235786; }
[data-brand="salud"] .mini-icon { color: #285e95; background: #deebf8; }
[data-brand="salud"] .preview-notice { background: #e6eef7; border-color: #c8dbed; }

/* The route chooser is a direct entry; the working steps retain their existing layout. */
body.welcome-screen .layout { display: block; background: var(--paper); }
body.welcome-screen .intro-panel, body.welcome-screen .progress-block { display: none; }
body.welcome-screen .workspace { width: min(100%, 1080px); padding: 48px clamp(25px, 5vw, 70px) 82px; background: var(--paper); }
body.welcome-screen .preview-notice { max-width: 700px; margin-bottom: 48px; }
.welcome-kicker { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 17px; }
body.welcome-screen .step h2 { max-width: 820px; margin: 36px 0 15px; font-size: clamp(40px, 5vw, 64px); line-height: 1.07; }
body.welcome-screen .lead { max-width: 690px; margin-bottom: 0; }
body.welcome-screen .branch-grid { gap: 18px; margin: 36px 0 0; }
body.welcome-screen .branch-card { min-height: 220px; padding: 26px; border-radius: 9px; background: #fffdf8; }
body.welcome-screen .branch-card[aria-pressed="true"] { padding: 25px; }
body.welcome-screen .branch-title { font-size: clamp(20px, 2vw, 24px); margin-top: 26px; }
body.welcome-screen .branch-description { color: #4d555a; font-size: 14px; }
body.welcome-screen .branch-card[data-choose-brand="salud"] { border-color: #9bb4c9; }
body.welcome-screen .branch-card[data-choose-brand="agency"] { border-color: #bcb6ad; }
body.welcome-screen .branch-card[aria-pressed="true"] { border-color: var(--accent); }
body.welcome-screen .form-nav { margin-top: 34px; }

@media (min-width: 1400px) {
  .workspace { padding-top: 56px; }
  .intro-panel h1 { margin-top: 76px; }
}
@media (max-width: 1150px) {
  .layout { grid-template-columns: minmax(310px, 35%) minmax(0, 1fr); }
  .intro-panel { padding: 37px 30px; }
  .intro-panel h1 { font-size: clamp(38px, 4vw, 54px); }
  .workspace { padding: 32px 34px 70px; }
}
@media (max-width: 800px) {
  .topbar { height: 75px; padding: 0 22px; }
  .layout { display: block; }
  .intro-panel { position: relative; height: auto; min-height: 0; padding: 50px 27px 38px; }
  .intro-panel h1 { margin: 22px 0 14px; max-width: 580px; font-size: clamp(37px, 8vw, 54px); }
  .intro-panel p { max-width: 520px; font-size: 14px; margin-bottom: 28px; }
  .intro-bottom { display: none; }
  .intro-panel::after { right: -16px; top: 39%; }
  .workspace { max-width: 750px; padding: 28px 25px 65px; }
  .preview-notice { margin-bottom: 38px; }
  .progress-block { margin-bottom: 48px; }
}
@media (max-width: 560px) {
  .wordmark { font-size: 29px; }
  .topbar-note { font-size: 0; gap: 0; }
  .topbar-note .pulse-dot { width: 8px; height: 8px; }
  .topbar-note .edition { display: none; }
  .intro-panel { padding: 39px 22px 30px; }
  .intro-panel h1 { font-size: clamp(37px, 9vw, 48px); }
  .intro-panel p { font-size: 13px; }
  .workspace { padding: 22px 17px 52px; }
  .preview-notice { padding: 13px; gap: 10px; margin-bottom: 32px; }
  .preview-notice span:last-child { font-size: 11px; }
  .progress-block { margin-bottom: 38px; }
  .step-list { font-size: 9px; }
  .step h2 { font-size: clamp(39px, 10.1vw, 51px); margin-top: 20px; }
  .lead { font-size: 13px; margin-bottom: 25px; }
  .branch-grid, .field-row { grid-template-columns: 1fr; gap: 12px; }
  .branch-card { min-height: 170px; padding: 19px; }
  .branch-card[aria-pressed="true"] { padding: 18px; }
  .branch-title { margin-top: 13px; }
  .branch-foot { padding-top: 14px; }
  .field-row .field { margin-bottom: 12px; }
  .form-card { padding: 24px 0 14px; border-radius: 0; }
  .form-card-heading { margin-bottom: 21px; }
  .form-nav { flex-wrap: wrap; gap: 10px; }
  .save-state { order: -1; width: 100%; margin: 0 !important; }
  .form-nav .button { flex: 1; padding: 13px; }
  .form-nav .button-back[hidden] + .save-state + .button-next { flex: none; width: 100%; }
  .site-footer { padding: 18px 21px; font-size: 9px; }
  .site-footer { flex-wrap: wrap; }
}

@media (max-width: 800px) {
  body.welcome-screen .workspace { max-width: 750px; padding: 30px 25px 65px; }
  body.welcome-screen .preview-notice { margin-bottom: 35px; }
  body.welcome-screen .step h2 { font-size: clamp(39px, 8vw, 56px); margin-top: 29px; }
}
@media (max-width: 560px) {
  body.welcome-screen .workspace { padding: 23px 19px 52px; }
  body.welcome-screen .step h2 { font-size: clamp(36px, 10vw, 48px); }
  body.welcome-screen .branch-grid { gap: 12px; margin-top: 27px; }
  body.welcome-screen .branch-card { min-height: 160px; padding: 20px; }
  body.welcome-screen .branch-card[aria-pressed="true"] { padding: 19px; }
  body.welcome-screen .branch-title { margin-top: 14px; font-size: 20px; }
  body.welcome-screen .branch-description { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
