:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #18314d;
  background: #f4f7fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --navy: #102f52;
  --navy-strong: #0c2745;
  --blue-soft: #eaf1f8;
  --gold: #c7a052;
  --muted: #65768a;
  --border: #e3eaf1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .68; }
.portal-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 24px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(360px, .87fr); gap: clamp(40px, 7vw, 96px); align-items: center; }
.welcome { padding: 4px 0; }
.portal-brand { width: fit-content; margin-bottom: clamp(42px, 6vw, 72px); padding: 12px 16px 10px; border-radius: 12px; background: var(--navy); }
.portal-brand img { display: block; width: 190px; height: auto; max-height: 54px; object-fit: contain; object-position: left center; }
.brand-caption { display: block; margin: 8px 0 0 2px; color: rgba(255,255,255,.82); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.eyebrow, .access-kicker { margin: 0 0 14px; color: #9b772f; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.welcome-copy h1 { margin: 0; max-width: 640px; color: var(--navy-strong); font-size: clamp(40px, 5.2vw, 64px); font-weight: 700; letter-spacing: -.045em; line-height: 1.04; }
.intro { max-width: 590px; margin: 22px 0 30px; color: #5d7086; font-size: 17px; line-height: 1.65; }
.benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.benefit { min-width: 0; min-height: 142px; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; padding: 17px 15px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.8); }
.benefit-icon, .unavailable-icon { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--navy); }
.benefit-icon svg, .unavailable-icon svg { width: 22px; height: 22px; }
.benefit strong { display: block; margin-bottom: 5px; color: #1b3552; font-size: 13px; line-height: 1.3; }
.benefit small { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.privacy-note { display: flex; align-items: flex-start; gap: 9px; margin: 22px 0 0; color: #63758a; font-size: 12px; line-height: 1.5; }
.privacy-dot { display: inline-grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #e6f1eb; color: #30714f; font-size: 12px; font-weight: 800; }
.access-card, .account-card { padding: clamp(26px, 3.4vw, 42px); border: 1px solid #e4eaf0; border-radius: 22px; background: #fff; box-shadow: 0 18px 48px rgba(21, 47, 76, .08); }
.access-heading h2, .account-heading h2 { margin: 0 0 10px; color: var(--navy-strong); font-size: clamp(25px, 3vw, 32px); letter-spacing: -.025em; line-height: 1.15; }
.access-heading p, .step-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.access-form { display: grid; gap: 10px; margin-top: 28px; }
.access-form label { margin-top: 3px; color: #263e58; font-size: 13px; font-weight: 700; }
.access-form input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid #cbd6e1; border-radius: 11px; outline: none; background: #fff; color: #152b44; font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease; }
.access-form input::placeholder { color: #9aa8b7; }
.access-form input:focus-visible, button:focus-visible { outline: 3px solid rgba(199,160,82,.55); outline-offset: 3px; }
.access-form input:focus { border-color: #5078a0; box-shadow: 0 0 0 3px rgba(16,47,82,.08); }
.field-help { color: #78899a; font-size: 11px; line-height: 1.45; }
.primary, .secondary { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 18px; border: 0; border-radius: 11px; font-size: 14px; font-weight: 700; }
.primary { margin-top: 8px; background: var(--navy); color: #fff; box-shadow: 0 6px 14px rgba(16,47,82,.15); }
.primary:hover:not(:disabled) { background: #19436c; }
.primary span { font-size: 19px; font-weight: 400; }
.secondary { border: 1px solid #dce5ed; background: #f5f8fb; color: #294764; }
.secondary:hover:not(:disabled) { background: #ebf1f6; }
.password-note { margin: 4px 0 0; color: #77879a; font-size: 12px; text-align: center; }
.back-link { justify-self: start; margin: -4px 0 10px; padding: 5px 0; border: 0; background: transparent; color: #456783; font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--navy-strong); }
.access-form h3, .unavailable h3 { margin: 0; color: var(--navy-strong); font-size: 20px; letter-spacing: -.02em; }
.step-copy { margin-top: -4px; }
#otp { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .3em; }
.unavailable { margin-top: 27px; padding: 20px; border: 1px solid #e2eaf2; border-radius: 15px; background: #f7f9fc; }
.unavailable-icon { margin-bottom: 13px; }
.unavailable h3 { font-size: 18px; }
.unavailable p { margin: 8px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.unavailable .secondary { min-height: 42px; font-size: 13px; }
.notice { min-height: 18px; margin: 14px 0 0; color: #52677d; font-size: 12px; line-height: 1.5; }
.notice.error { color: #9e3434; }
.card-foot { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px; padding-top: 17px; border-top: 1px solid #edf1f5; color: #8391a1; font-size: 11px; }
.card-foot span { color: #7391ad; font-size: 17px; }
.account-card { margin-top: 24px; }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-heading .eyebrow { margin-bottom: 7px; }
.account-heading .secondary { min-height: 42px; }
.tabs { display: flex; gap: 8px; margin: 24px 0 12px; border-bottom: 1px solid var(--border); }
.tabs button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 9px 9px 0 0; background: transparent; color: #64758a; font-weight: 650; }
.tabs button[aria-current="page"] { border-bottom: 2px solid var(--gold); color: var(--navy); }
.records { display: grid; gap: 10px; }
.record { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 14px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 12px; }
.record strong { color: #173250; font-size: 15px; }
.record span { color: #5d6f83; font-size: 13px; }
.record .record-meta { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 7px 16px; }
.empty { padding: 22px 16px; border: 1px dashed #ccd5df; border-radius: 12px; color: #64748b; font-size: 14px; text-align: center; }
footer { padding: 28px 12px 8px; color: #8794a3; font-size: 11px; line-height: 1.5; text-align: center; }
@media (max-width: 900px) {
  .portal-shell { width: min(100% - 36px, 650px); padding-top: 30px; }
  .portal-grid { grid-template-columns: 1fr; gap: 28px; }
  .portal-brand { margin-bottom: 32px; }
  .welcome-copy h1 { font-size: clamp(39px, 8vw, 54px); }
  .intro { margin: 16px 0 21px; font-size: 15px; }
  .benefits { grid-template-columns: 1fr; gap: 8px; }
  .benefit { min-height: 0; flex-direction: row; align-items: center; gap: 13px; padding: 11px 13px; }
  .benefit-icon { width: 36px; height: 36px; }
  .benefit strong { margin-bottom: 2px; font-size: 13px; }
  .benefit small { font-size: 11px; }
  .privacy-note { margin-top: 15px; }
  .access-card { padding: clamp(23px, 6vw, 34px); }
}
@media (max-width: 480px) {
  .portal-shell { width: calc(100% - 28px); padding: 22px 0 16px; }
  .portal-brand { margin-bottom: 26px; }
  .portal-brand img { width: 168px; max-height: 48px; }
  .portal-brand { padding: 10px 14px 9px; }
  .brand-caption { margin-top: 7px; font-size: 9px; }
  .welcome-copy h1 { font-size: clamp(36px, 10vw, 44px); }
  .intro { margin-bottom: 17px; font-size: 14px; line-height: 1.55; }
  .benefit { padding: 9px 11px; }
  .access-card, .account-card { border-radius: 17px; }
  .account-heading { align-items: flex-start; }
  .account-heading .secondary { min-height: 40px; padding: 0 12px; }
  .record { grid-template-columns: 1fr; }
  .record .record-meta { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Portal premium: composición mobile-first sobre azul institucional. */
:root { color: #fff; background: var(--navy); }
html, body { min-width: 320px; min-height: 100%; background: var(--navy); }
body { min-height: 100vh; min-height: 100dvh; }
.portal-shell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: max(18px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.portal-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; width: 100%; max-width: 600px; margin: 0 auto; align-items: start; }
.welcome { min-width: 0; padding: 0; }
.portal-brand { margin: 0 0 20px; padding: 0; background: transparent; }
.portal-brand img { width: min(176px, 58vw); max-height: 50px; }
.brand-caption { margin: 7px 0 0 1px; color: rgba(255,255,255,.78); font-size: 9px; letter-spacing: .18em; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 10px; letter-spacing: .16em; }
.welcome-copy h1 { max-width: 520px; color: #fff; font-size: clamp(34px, 8.8vw, 43px); line-height: 1.03; letter-spacing: -.04em; }
.intro { max-width: 470px; margin: 10px 0 16px; color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.5; }
.benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.benefit { min-width: 0; min-height: 72px; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px; border-color: rgba(255,255,255,.16); border-radius: 13px; background: rgba(255,255,255,.075); text-align: center; }
.benefit-icon { width: 30px; height: 30px; border-radius: 10px; background: rgba(255,255,255,.11); color: #e6c77f; }
.benefit-icon svg { width: 18px; height: 18px; }
.benefit strong { margin: 0; color: #fff; font-size: 11px; line-height: 1.2; }
.benefit small { display: none; }
.access-card, .account-card { width: 100%; padding: 22px; border-color: rgba(16,47,82,.08); border-radius: 19px; box-shadow: 0 10px 28px rgba(4,18,33,.13); }
.access-heading h2, .account-heading h2 { font-size: 25px; }
.access-heading p, .step-copy { font-size: 13px; line-height: 1.5; }
.access-form { gap: 9px; margin-top: 19px; }
.access-form input { min-width: 0; font-size: 16px; }
.primary { width: 100%; min-height: 52px; margin-top: 6px; }
.password-note { margin-top: 3px; }
.privacy-note { max-width: 600px; align-items: center; margin: 12px auto 0; color: rgba(255,255,255,.76); font-size: 11px; }
.privacy-dot { width: 18px; height: 18px; background: rgba(199,160,82,.2); color: #e7c879; }
.portal-shell > footer { padding: 18px 0 0; color: rgba(255,255,255,.62); }

@media (min-width: 600px) and (max-width: 900px) {
  .portal-shell { padding-left: 28px; padding-right: 28px; }
  .portal-grid { gap: 24px; }
  .welcome-copy h1 { font-size: clamp(42px, 7vw, 56px); }
  .benefit { min-height: 82px; }
}
@media (min-width: 901px) {
  .portal-shell { width: min(100%, 1360px); margin: 0 auto; padding: 38px clamp(36px, 6vw, 88px) 24px; }
  .portal-grid { flex: 1; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .82fr); gap: clamp(48px, 8vw, 116px); max-width: 1160px; align-items: center; }
  .portal-brand { margin-bottom: clamp(30px, 4vw, 48px); }
  .portal-brand img { width: 190px; max-height: 54px; }
  .brand-caption { font-size: 10px; }
  .welcome-copy h1 { max-width: 620px; font-size: clamp(50px, 5.1vw, 66px); }
  .intro { margin: 18px 0 24px; font-size: 16px; }
  .benefits { gap: 11px; }
  .benefit { min-height: 126px; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 15px 13px; text-align: left; }
  .benefit-icon { width: 35px; height: 35px; }
  .benefit-icon svg { width: 21px; height: 21px; }
  .benefit strong { font-size: 12px; }
  .benefit small { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 10px; line-height: 1.4; }
  .access-card, .account-card { padding: clamp(28px, 3vw, 40px); }
  .access-heading h2 { font-size: 30px; }
  .access-heading p { font-size: 14px; }
  .access-form { margin-top: 24px; }
  .privacy-note { width: min(1160px, 100%); margin: 15px auto 0; }
}
@media (max-width: 359px) {
  .portal-shell { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .portal-grid { gap: 17px; }
  .portal-brand { margin-bottom: 16px; }
  .portal-brand img { width: 158px; max-height: 45px; }
  .welcome-copy h1 { font-size: 34px; }
  .intro { margin: 8px 0 13px; font-size: 13px; }
  .benefits { gap: 6px; }
  .benefit { min-height: 66px; }
  .benefit strong { font-size: 10px; }
  .access-card { padding: 19px 17px; }
}
