/* iFOCUS brand tokens (HANDOFF §1). Yellow is fill only, never text. */
:root {
  --navy: #112D51;
  --blue: #075B9D;
  --ring: #0B6BBF;
  --text: #18334F;
  --text2: #486078;
  --bg: #EAF4FA;
  --yellow: #FFD652;
  --dot: #FFC20E;
  --line: #D9E5EE;
  --white: #fff;
  --danger: #8A1C1C;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 Arial, Helvetica, sans-serif;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.top { background: var(--white); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-weight: 700; font-size: 20px; text-decoration: none; }
.nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--blue); }
main { padding-top: 20px; padding-bottom: 32px; min-height: 60vh; }
h1 { color: var(--navy); font-size: 26px; line-height: 1.2; margin: 0 0 12px; }
h2 { color: var(--navy); font-size: 20px; line-height: 1.25; margin: 24px 0 8px; }
h3 { color: var(--navy); font-size: 17px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--blue); }
.muted { color: var(--text2); }
.small { font-size: 14px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.card.navy { background: var(--navy); color: var(--white); border-color: var(--navy); }
.card.navy h1, .card.navy h2, .card.navy h3 { color: var(--white); }
.card.navy a { color: var(--white); }
.narrow { max-width: 480px; }
.hero { padding: 8px 0 4px; }
.hero p.lead { font-size: 18px; color: var(--text2); }
.btn {
  display: inline-block; border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; min-height: 44px; text-align: center;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--blue); border: 2px solid var(--blue); padding: 10px 18px; }
.btn-danger { background: var(--white); color: var(--danger); border: 2px solid var(--danger); padding: 10px 18px; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
label { display: block; font-weight: 700; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 12px; font: inherit; color: var(--text); border: 1px solid var(--text2); border-radius: 10px; background: var(--white);
}
input.code { font-size: 28px; letter-spacing: 8px; text-align: center; max-width: 240px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 12px 0 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; border-radius: 999px; padding: 2px 10px; }
.badge.req { background: var(--navy); color: var(--white); }
.badge.opt { background: var(--yellow); color: var(--navy); }
.badge.on { background: #DDF1E4; color: #14532D; }
.badge.off { background: #F3E3E3; color: var(--danger); }
.alert { border-radius: 10px; padding: 12px; margin: 0 0 14px; background: #FCEFEF; color: var(--danger); border: 1px solid #E8BDBD; }
.ok { background: #E7F5EC; color: #14532D; border-color: #B7DEC4; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin: 0 0 10px; }
.cols { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cols { grid-template-columns: 1fr 1fr; } }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0 6px 26px; position: relative; }
ul.can li::before { content: "\2713"; position: absolute; left: 0; color: #14532D; font-weight: 700; }
ul.cannot li::before { content: "\2715"; position: absolute; left: 0; color: var(--danger); font-weight: 700; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row form { margin: 0; }
.foot { border-top: 1px solid var(--line); background: var(--white); padding: 16px 0; font-size: 14px; color: var(--text2); }
.foot p { margin: 0 0 6px; }
.disclaimer { color: var(--text); }
.logo { flex: none; }
.signature { font-weight: 700; color: var(--navy); }
@media (max-width: 360px) { h1 { font-size: 23px; } .btn { width: 100%; } }

/* ---- P4: reminders, panels, demo hub ---- */
select { width: 100%; padding: 12px; font: inherit; color: var(--text); border: 1px solid var(--text2); border-radius: 10px; background: var(--white); }
input[type=time] { width: 100%; padding: 12px; font: inherit; color: var(--text); border: 1px solid var(--text2); border-radius: 10px; background: var(--white); }
select:focus-visible, input[type=time]:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.stack { display: grid; gap: 10px; }
.btn-block { display: block; width: 100%; }
.wrap-any { overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }
.card.scroll { padding: 12px 8px; }
.table tbody th { min-width: 84px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.table thead th { border-top: 0; color: var(--text2); font-size: 13px; white-space: nowrap; }
.table tbody th { font-weight: 700; color: var(--navy); }
.stats { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 0 0 14px; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 16px; }
.stat-n { font-size: 34px; font-weight: 700; line-height: 1.1; }
.stat-l { font-weight: 700; margin-top: 4px; }
.stat .muted { color: #C9DAEA; }
.chart { width: 100%; height: auto; max-height: 280px; display: block; }
.chart .bar { fill: var(--ring); }
.chart .axis { stroke: var(--text2); stroke-width: 1; }
.chart .bar-val { fill: var(--navy); font: 700 14px Arial, Helvetica, sans-serif; }
.chart .bar-lbl { fill: var(--text2); font: 13px Arial, Helvetica, sans-serif; }
.qr { max-width: 240px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.qr svg { display: block; width: 100%; height: auto; }
.big-code { font: 700 20px/1 "Courier New", monospace; letter-spacing: 3px; color: var(--navy); }

/* ---- Personalization: /cuenta/perfil ---- */
fieldset.chips { border: 0; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.chips legend { font-weight: 700; color: var(--navy); padding: 0; margin-bottom: 8px; width: 100%; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-block; min-height: 44px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 999px; background: var(--white); color: var(--text); }
.chip input:checked + span { border-color: var(--blue); background: var(--blue); color: var(--white); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }
label[for] { display: block; font-weight: 700; margin: 0 0 4px; color: var(--navy); }
.alert.ok { background: #DDF1E4; color: #14532D; border-color: #B7DFC4; }

/* Language switch with flags in the header */
.lang { display: inline-flex; gap: 6px; white-space: nowrap; }
.lang a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--text2); text-decoration: none; font-weight: 700; font-size: 14px; }
.lang a.on { color: var(--navy); border-color: var(--blue); background: var(--bg); box-shadow: inset 0 0 0 1px var(--blue); }
.lang .flag { flex: none; width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(17, 45, 81, .25); }
.lang .ln-short { display: none; }
@media (max-width: 480px) { .lang a { padding: 4px 8px; gap: 5px; } .lang .ln-full { display: none; } .lang .ln-short { display: inline; } }
#locale { margin-bottom: 18px; }

/* ---- Library, legal pages, connect guide, Mis datos ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notice { background: #FFF6D6; border: 1px solid var(--yellow); border-radius: 10px; padding: 8px 12px; color: var(--navy); font-weight: 700; font-size: 14px; }
.lib-module { margin: 0 0 8px; }
.mod-head { display: flex; align-items: center; gap: 10px; }
.mod-icon { flex: none; color: var(--blue); }
.guide-card { margin: 0; display: flex; flex-direction: column; }
.guide-card p:last-child { margin-bottom: 0; margin-top: auto; }
.cols { margin-bottom: 14px; }
ul.checklist li { padding-left: 0; }
ul.checklist li::before { content: none; }
.callout { border-left: 6px solid var(--dot); }
.callout h2 { margin-top: 0; }
.legal-row, .explore { margin-top: 14px; }
input[readonly] { background: var(--bg); }
.copy-status { align-self: center; }

/* Dashboard segment selector (/socio) */
nav[aria-label="Segmento"] { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
nav[aria-label="Segmento"] .badge { font-size: 14px; padding: 8px 14px; margin: 0; text-decoration: none; }
nav[aria-label="Segmento"] a.badge { background: #E8EEF5; color: var(--navy); }

/* ---- Landing "/" and onboarding choice ---- */
main.bleed { padding: 0; min-height: 0; }
.page-wide .wrap { max-width: 1080px; }
.band { padding: 36px 0; }
.band-white { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band h2 { margin-top: 0; font-size: 24px; }
.band-white + .band-white { border-top: 0; }
.eyebrow { margin: 0 0 6px; color: var(--blue); font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.lead { font-size: 18px; color: var(--text2); }
.lead-strong { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.narrow-text { max-width: 760px; }
.hero { padding: 28px 0 40px; }
.hero h1 { font-size: 32px; line-height: 1.12; }
.hero-grid { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: center; }
.hero-art { position: relative; min-height: 330px; border-radius: 28px; background: linear-gradient(160deg, #fff 0%, #D3E8F6 100%); border: 1px solid var(--line); overflow: hidden; }
.hero-char { position: absolute; bottom: 0; left: 32%; transform: translateX(-50%); height: 74%; width: auto; max-width: 50%; }
.bubble { position: absolute; max-width: 72%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.35; box-shadow: 0 2px 8px rgba(17, 45, 81, .12); }
.bubble-bot { top: 16px; left: 14px; background: var(--white); color: var(--text); border-bottom-left-radius: 4px; display: flex; gap: 8px; align-items: flex-start; }
.bubble-bot .logo { width: 26px; height: 26px; }
.bubble-user { right: 14px; bottom: 28px; max-width: 48%; background: var(--blue); color: var(--white); font-weight: 700; border-bottom-right-radius: 4px; z-index: 1; }
.grid3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.card.feature, .card.way, .card.who { margin: 0; }
.icon-disc { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 50%; background: var(--bg); color: var(--blue); margin-bottom: 10px; }
.rule-pill { display: inline-block; margin: 18px 0 0; padding: 10px 18px; border-radius: 22px; background: var(--yellow); color: var(--navy); font-weight: 700; }
.way { display: flex; flex-direction: column; }
.way h3 .badge { margin-left: 6px; vertical-align: 2px; }
.way-link { margin: auto 0 0; padding-top: 8px; }
.big-steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; grid-template-columns: 1fr; }
.big-steps li { counter-increment: s; position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 14px 72px; display: flex; flex-direction: column; min-height: 72px; justify-content: center; }
.big-steps li::before { content: counter(s); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--white); font-weight: 700; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.big-steps strong { color: var(--navy); }
.big-steps span { color: var(--text2); font-size: 15px; }
.invite-form { margin: 18px 0 0; max-width: 520px; }
.invite-form label { margin-bottom: 8px; }
.invite-row { display: flex; gap: 10px; flex-wrap: wrap; }
.invite-row input { flex: 1 1 180px; width: auto; min-width: 0; }
.who { text-align: left; }
.who-logo { height: 64px; display: flex; align-items: center; margin-bottom: 8px; }
.who-logo img { max-height: 100%; width: auto; max-width: 100%; }
.logo-sbg { height: 40px; }
.logo-corre { height: 60px; }
.who-text { font-weight: 700; font-size: 22px; letter-spacing: .04em; color: var(--navy); }
.sponsor-line { margin: 16px 0 0; color: var(--text2); font-weight: 700; }
.foot-links .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 4px; padding-bottom: 4px; }
.foot-links a { padding: 8px 0; font-weight: 700; }
.choice { margin: 14px 0; }
.choice-card { display: flex; flex-direction: column; gap: 4px; margin: 0; text-decoration: none; color: var(--text); border: 2px solid var(--line); }
.choice-card h2 { margin-top: 0; }
.choice-card .btn { margin-top: auto; align-self: flex-start; }
.choice-card:hover { border-color: var(--blue); }
.choice-card:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
@media (min-width: 640px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .big-steps { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .band { padding: 56px 0; }
  .band h2 { font-size: 28px; }
  .hero { padding: 48px 0 56px; }
  .hero h1 { font-size: 44px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .hero-art { min-height: 420px; }
  .hero-char { left: 50%; max-width: 60%; }
  .bubble-user { max-width: 62%; }
  .big-steps { grid-template-columns: repeat(4, 1fr); }
  .big-steps li { padding: 72px 14px 14px; justify-content: flex-start; }
  .big-steps li::before { left: 14px; top: 14px; transform: none; }
}

/* ---- /chat (web chat pilot) ---- */
.chat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-head h1 { margin: 0; }
.chat-list { display: flex; flex-direction: column; gap: 12px; min-height: 46vh; padding: 8px 0 16px; }
.chat-empty { margin: auto 0; text-align: center; padding: 16px 0; }
.chat-empty h2 { margin-top: 0; }
.chat-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip-btn { min-height: 44px; padding: 10px 16px; border: 2px solid var(--blue); border-radius: 999px; background: var(--white); color: var(--blue); font: inherit; cursor: pointer; }
.chip-btn:hover { background: var(--blue); color: var(--white); }
.chip-btn:focus-visible, .chat-form textarea:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; background: var(--blue); border-color: var(--blue); color: var(--white); }
.msg-bot { align-self: flex-start; }
.msg-error { align-self: stretch; max-width: 100%; background: #FCEFEF; color: var(--danger); border-color: #E8BDBD; }
.msg-who { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; opacity: .75; margin-bottom: 2px; }
.msg-text p { margin: 0 0 8px; }
.msg-text p:last-child, .msg-text ul:last-child { margin-bottom: 0; }
.msg-text ul { margin: 0 0 8px; padding-left: 20px; }
.msg-user .msg-text { white-space: pre-wrap; }
.msg-widget { align-self: stretch; max-width: 100%; box-sizing: border-box; padding: 0; border: 0; background: transparent; }
.widget-frame { display: block; box-sizing: border-box; width: 100%; max-width: 100%; height: 280px; border: 0; background: transparent; color-scheme: normal; }
.msg-typing .dots::before { content: "\2022 \2022 \2022"; letter-spacing: 3px; color: var(--text2); animation: chat-blink 1.2s infinite; }
@keyframes chat-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .msg-typing .dots::before { animation: none; } }
.chat-form { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
.chat-form textarea { flex: 1; min-height: 48px; max-height: 140px; resize: none; padding: 12px; font: inherit; color: var(--text); border: 2px solid var(--line); border-radius: 12px; background: var(--white); }
.chat-form .btn { min-height: 48px; }
.chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chat-foot p { margin: 0; }
@media (max-width: 480px) { .msg { max-width: 94%; } .chat-form .btn { width: auto; } }

/* Landing photos: hero panel photo and consultation band */
.hero-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-art .bubble { z-index: 1; }
.photo-caption { position: absolute; left: 10px; bottom: 10px; z-index: 2; margin: 0; padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, .88); color: var(--text2); font-size: 11px; line-height: 1.4; }
.consult-grid { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: center; }
.consult-photo { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.consult-photo img { display: block; width: 100%; max-width: 100%; height: auto; }
.consult-text { margin: 0; }
@media (min-width: 900px) { .consult-grid { grid-template-columns: 1.1fr .9fr; gap: 48px; } .consult-text { font-size: 20px; } }
