:root {
  --blue: #283e83;
  --green: #009848;
  --orange: #ef7020;
  --ink: #1a2546;
  --muted: #7c8496;
  color: var(--ink);
  background: #fff;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

/* Hiro aparece cuando finishIntro() termina o se pulsa «Saltar animación». */
body:not(.intro-done) .btn-asistente,
body:not(.intro-done) #hiroBurbuja {
  visibility: hidden !important;
  pointer-events: none !important;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}
.intro[hidden] { display: none; }
.intro__stage { width: min(82vw, 980px, 170vh); }
.intro__stage svg { display: block; width: 100%; height: auto; overflow: visible; }
.intro--halloween .halo { fill: url(#halloween-halo); opacity: 0; }
.intro--halloween .body { fill: none; opacity: 0; }
.intro--halloween .face { fill: #ff9a36; opacity: 0; }
.intro--halloween .vein { fill: none; stroke: #ffab50; stroke-width: 3; opacity: 0; }
.intro--halloween .ribbon { fill: none; stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
#halloween-green { stroke: #009848; }
#halloween-orange { stroke: #ef7020; }
#halloween-logo { opacity: 0; }

.login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  opacity: 0;
  transition: opacity .65s ease;
}
body.intro-done .login { opacity: 1; transform: translateY(0); }

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 0;
  padding: clamp(24px, 5dvh, 48px) 10%;
  overflow: hidden;
  background: var(--blue);
  color: #fff;
}
.brand-panel::after {
  position: absolute;
  right: -260px;
  bottom: -300px;
  width: 420px;
  height: 700px;
  border: 1px solid #ffffff13;
  box-shadow: 0 0 0 65px #ffffff05, 0 0 0 130px #ffffff04;
  content: "";
  pointer-events: none;
  transform: rotate(-23deg);
}
.brand-panel__top, .brand-panel__footer {
  color: #ffffffa6;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
}
.brand-panel__top { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 7px; height: 7px; border-radius: 50%; background: #3acd88; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.brand-panel__message { position: relative; z-index: 1; margin: clamp(24px, 7dvh, 80px) 0; }
.brand-panel__message .eyebrow { color: #aebee9; }
h1 { margin: 23px 0; font-size: clamp(30px, 3.6vw, 54px); font-weight: 600; line-height: 1.15; letter-spacing: -.045em; }
.brand-panel__message p { color: #c0cae4; font-size: 14px; line-height: 1.8; }
.brand-panel__accent { display: flex; gap: 8px; margin-top: 42px; }
.brand-panel__accent i { display: block; width: 7px; height: 42px; background: var(--green); transform: skew(21deg); }
.brand-panel__accent i + i { background: var(--orange); }

.access-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(12px, 3dvh, 28px) 32px;
  gap: 14px;
}
.access-card { display: flex; flex-direction: column; align-items: flex-start; width: min(100%, 360px); margin-inline: auto; text-align: left; }
.access-card > form { width: 100%; text-align: left; }
.access-card > h2, .access-card__eyebrow, .access-card__description { width: 100%; text-align: left; }
.login-logo { display: block; width: 200px; max-width: 100%; height: auto; margin: 0 0 14px -22px; }
.access-card__eyebrow { display: block; margin-bottom: 8px; color: var(--green); }
h2 { margin: 0 0 6px; font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
.access-card__description { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
label { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 600; }
input { display: block; width: 100%; min-height: 44px; padding: 11px 14px; border: 1px solid #e0e4ec; border-radius: 7px; background: #fbfcfe; color: var(--ink); font-size: 13px; text-align: left; }
input::placeholder { color: #a2a8b6; }
input:disabled, button:disabled { cursor: not-allowed; opacity: .58; }
.access-card input:not([type="checkbox"]):focus { outline: none; border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.password-field { position: relative; width: 100%; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; display: grid; place-items: center; width: 42px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); }
.password-toggle:hover:not(:disabled) { background: #283e8308; color: var(--blue); }
.password-toggle__slash { display: none; }
.password-toggle[aria-pressed="true"] .password-toggle__slash { display: block; }
.remember-me { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 32px; margin: 8px 0 0; color: var(--muted); font-weight: 400; cursor: pointer; }
.remember-me input { flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); cursor: pointer; }
.submit { position: relative; display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 44px; margin-top: 18px; padding: 12px 40px 12px 18px; border: 0; border-radius: 7px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; transition: background .2s; }
.submit span { position: absolute; right: 18px; }
.submit:hover:not(:disabled) { background: #1d306b; }
.access-options { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.new-entry { display: grid; place-items: center; width: 100%; min-height: 44px; padding: 12px 18px; border: 1px solid var(--green); border-radius: 7px; background: #fff; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .035em; text-align: center; text-decoration: none; transition: background .2s; }
.new-entry:hover { background: #f0faf5; }
.recover-password { align-self: center; min-height: 44px; padding: 13px 14px 10px; border: 0; background: none; color: var(--blue); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.recover-password:hover { color: var(--green); }
.form-alert { display: flex; align-items: flex-start; gap: 9px; width: 100%; margin: 6px 0 0; padding: 10px 12px; border: 1px solid #f1c6c9; border-radius: 7px; background: #fff5f5; color: #a5252d; font-size: 12px; line-height: 1.45; }
.form-alert svg { flex: none; margin-top: 1px; }
.platform-note { width: 100%; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: center; }
.install-button { width: 100%; min-height: 40px; margin-top: 8px; padding: 9px 14px; border: 1px solid var(--blue); border-radius: 7px; background: #fff; color: var(--blue); font-size: 12px; font-weight: 600; }
.install-button:hover { background: #f3f5fb; }
.install-button[hidden] { display: none; }
.access-footer { margin: 0; color: #a2a8b6; font-size: 10px; letter-spacing: .04em; text-align: center; }
.no-script { position: fixed; right: 0; bottom: 0; left: 0; z-index: 110; margin: 0; padding: 12px; background: #fff; font-size: 12px; text-align: center; }
.ios-install-banner { position: fixed; right: 0; bottom: 0; left: 0; z-index: 120; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: #e9f2ff; color: #1b3a7a; box-shadow: 0 -6px 16px rgba(0, 0, 0, .08); font-size: 13px; }
.ios-install-banner__content { display: flex; align-items: flex-start; gap: 12px; max-width: 720px; margin: 0 auto; }
.ios-install-banner__icon { font-size: 20px; line-height: 1; }
.ios-install-banner__text { flex: 1; }
.ios-install-banner ol { margin: 6px 0 0 18px; padding: 0; }
.ios-install-banner button { padding: 8px 12px; border: 0; border-radius: 8px; background: #1b3a7a; color: #fff; }

@media (max-height: 740px) {
  .login-logo { width: 160px; margin-bottom: 8px; margin-left: -17px; }
  .access-card__eyebrow { margin-bottom: 6px; }
  h2 { font-size: 26px; }
  .access-card__description { margin-bottom: 6px; }
  label { margin-top: 10px; }
  .submit { margin-top: 12px; }
  .access-panel { gap: 8px; }
  .brand-panel__accent { margin-top: 24px; }
}
@media (max-width: 1024px) {
  .login { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .access-panel { padding: clamp(12px, 3dvh, 24px) 24px; }
  .access-card { align-items: center; text-align: center; }
  .access-card > form, .access-card > h2, .access-card__eyebrow, .access-card__description { text-align: center; }
  .login-logo { margin-right: auto; margin-left: auto; }
  .remember-me { margin-inline: auto; }
  input { font-size: 16px; text-align: left; }
  .submit { justify-content: center; padding-inline: 40px; }
}
@media (max-width: 700px) {
  .intro__stage { width: min(98vw, 170vh); }
  .ios-install-banner__content { flex-wrap: wrap; }
  .ios-install-banner button { margin-left: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; animation: none; }
  .login { opacity: 1; transform: none; transition: none; }
}
