:root {
  --navy: #0b2e6b;
  --navy-dark: #071f4b;
  --navy-soft: #173f82;
  --green: #67c23a;
  --green-dark: #4ea526;
  --yellow: #ffc72c;
  --ink: #172033;
  --muted: #66738a;
  --line: #dce4f0;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --danger: #c93838;
  --danger-soft: #fff2f2;
  --success: #247a32;
  --success-soft: #eef9ed;
  --info-soft: #eff5ff;
  --shadow: 0 32px 80px rgba(7, 31, 75, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: #f7f9fd;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px, 0.92fr) minmax(540px, 1.08fr);
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 199, 44, 0.11), transparent 24%),
    #f7f9fd;
}

.auth-showcase {
  position: relative;
  min-height: 100vh;
  /* `hidden` creaba un contenedor que interceptaba la rueda del mouse. */
  overflow: clip;
  display: flex;
  flex-direction: column;
  padding: clamp(34px, 5vw, 68px);
  color: white;
  background:
    radial-gradient(circle at 15% 82%, rgba(103, 194, 58, 0.24), transparent 31%),
    radial-gradient(circle at 93% 12%, rgba(255, 199, 44, 0.22), transparent 26%),
    linear-gradient(145deg, var(--navy-dark), var(--navy) 58%, #124787);
}

@media (min-width: 781px) {
  .auth-panel {
    align-self: start;
    overflow: visible;
  }
}

.auth-showcase::before,
.auth-showcase::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  pointer-events: none;
}

.auth-showcase::before {
  width: 390px;
  height: 390px;
  right: -245px;
  top: 18%;
}

.auth-showcase::after {
  width: 560px;
  height: 560px;
  left: -380px;
  bottom: -310px;
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  width: min(210px, 62vw);
  height: auto;
}

.brand--light {
  padding: 11px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.13);
}

.brand--mobile {
  display: none;
}

.showcase-content {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  margin: auto 0;
  padding: 72px 0 58px;
}

.showcase-eyebrow,
.auth-eyebrow {
  margin: 0 0 15px;
  color: var(--green);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-showcase h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2.45rem, 4.4vw, 4.75rem);
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.showcase-copy {
  max-width: 580px;
  margin: 25px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.68;
}

.showcase-benefits {
  display: grid;
  gap: 15px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.93);
  font-size: 0.95rem;
  font-weight: 600;
}

.showcase-benefits li {
  display: flex;
  gap: 12px;
  align-items: center;
}

.benefit-icon {
  flex: 0 0 26px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-dark);
  background: var(--green);
  font-size: 0.8rem;
  font-weight: 900;
}

.showcase-note {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.82rem;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px clamp(24px, 5vw, 84px);
}

.auth-panel-inner {
  width: min(490px, 100%);
}

.back-home,
.inline-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #53627a;
  background: transparent;
  font-size: 0.87rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms ease;
}

.back-home {
  margin: 0 0 18px 4px;
}

.inline-back {
  margin: 0 0 28px;
  padding: 0;
}

.back-home:hover,
.inline-back:hover {
  color: var(--navy);
  transform: translateX(-2px);
}

.auth-card {
  width: 100%;
  padding: clamp(29px, 4vw, 43px);
  border: 1px solid rgba(213, 223, 237, 0.8);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-heading {
  margin-bottom: 27px;
  text-align: center;
}

.auth-heading--left {
  text-align: left;
}

.auth-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.65rem, 3vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.auth-heading p:not(.auth-eyebrow) {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.heading-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 15px;
  color: var(--navy);
  background: rgba(103, 194, 58, 0.17);
  font-size: 1.25rem;
  font-weight: 900;
}

.verification-heading { text-align:center; }
.verification-icon{display:grid;place-items:center;width:72px;height:72px;margin:0 auto 20px;border-radius:22px;color:#0b2e6b;background:linear-gradient(145deg,#eaf2ff,#f5faeb);box-shadow:inset 0 0 0 1px #d7e4f4}
.verification-icon svg{width:34px;height:34px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.verification-email{display:block;margin-top:8px;color:#0b2e6b;font-size:1rem;overflow-wrap:anywhere}
.verification-note{display:grid;gap:7px;margin:28px 0 22px;padding:17px 18px;border:1px solid #dce5f1;border-radius:16px;background:#f7f9fc;color:#102a52}
.verification-note span{color:#64748b;font-size:.9rem;line-height:1.5}
.verification-resend,.verification-change{display:block;width:100%;border:0;background:transparent;color:#0b4a99;font:inherit;font-weight:750;cursor:pointer}
.verification-resend{margin-top:18px}.verification-change{margin-top:13px;color:#667085;font-weight:650}
.verification-resend:disabled{opacity:.55;cursor:wait}
.verification-help{margin:22px 0 0;color:#7b8494;text-align:center;font-size:.82rem;line-height:1.45}
html[data-theme="dark"] .verification-icon{color:#91c8ff;background:#111c2a;box-shadow:inset 0 0 0 1px #29384c}
html[data-theme="dark"] .verification-email{color:#9ac8ff}
html[data-theme="dark"] .verification-note{border-color:#283241;background:#11161e;color:#f4f7fb}
html[data-theme="dark"] .verification-note span,html[data-theme="dark"] .verification-help{color:#9da7b6}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 27px;
  padding: 5px;
  border-radius: 14px;
  background: #eef2f8;
}

.auth-tab {
  min-height: 43px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #66738a;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-tab.is-active {
  color: var(--navy);
  background: white;
  box-shadow: 0 5px 16px rgba(11, 46, 107, 0.09);
}

.auth-form {
  display: grid;
  gap: 18px;
}

.form-field {
  min-width: 0;
}

.form-field.is-reserved-hidden,
.password-health.is-reserved-hidden {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.form-field label,
.field-label-row {
  color: #263650;
  font-size: 0.83rem;
  font-weight: 750;
}

.form-field > label,
.field-label-row {
  display: flex;
  margin-bottom: 8px;
}

.field-label-row {
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.forgot-link {
  padding: 2px 0;
  color: var(--navy);
  background: transparent;
  font-size: 0.79rem;
  font-weight: 750;
  cursor: pointer;
}

.forgot-link:hover,
.auth-switch-copy button:hover {
  color: var(--green-dark);
}

.input-control {
  position: relative;
}

.input-control input {
  width: 100%;
  height: 53px;
  padding: 0 49px 0 45px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: white;
  font-size: 0.94rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-control input::placeholder {
  color: #9aa5b7;
}

.input-control input:hover:not(:disabled) {
  border-color: #c2cfe0;
}

.input-control input:focus {
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 4px rgba(11, 46, 107, 0.1);
}

.form-field.has-error .input-control input {
  border-color: var(--danger);
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(201, 56, 56, 0.08);
}

.input-icon {
  position: absolute;
  z-index: 1;
  left: 16px;
  top: 50%;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  color: #7d899d;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-icon svg,
.password-toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle {
  position: absolute;
  z-index: 2;
  right: 9px;
  top: 50%;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 8px;
  place-items: center;
  border-radius: 9px;
  color: #728099;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--navy);
  background: #f1f4f8;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.field-error {
  min-height: 0;
  margin: 6px 2px 0;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.35;
}

.field-error:empty {
  display: none;
}

.password-health {
  margin-top: -6px;
}

.password-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.password-strength span {
  height: 4px;
  border-radius: 999px;
  background: #e4e9f1;
  transition: background 180ms ease;
}

.password-health p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.password-health[data-strength="1"] .password-strength span:nth-child(-n + 1) {
  background: #e04b4b;
}

.password-health[data-strength="2"] .password-strength span:nth-child(-n + 2) {
  background: #e89925;
}

.password-health[data-strength="3"] .password-strength span:nth-child(-n + 3) {
  background: #8bbf35;
}

.password-health[data-strength="4"] .password-strength span {
  background: var(--green);
}

.auth-submit {
  position: relative;
  min-height: 54px;
  margin-top: 2px;
  padding: 12px 20px;
  overflow: hidden;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--navy), #194b96);
  box-shadow: 0 14px 28px rgba(11, 46, 107, 0.2);
  font-size: 0.91rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 17px 32px rgba(11, 46, 107, 0.25);
  filter: brightness(1.04);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.button-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  display: none;
  width: 19px;
  height: 19px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: white;
  border-radius: 50%;
  animation: auth-spin 700ms linear infinite;
}

.auth-submit.is-loading .button-label {
  visibility: hidden;
}

.auth-submit.is-loading .button-loader {
  display: block;
}

.auth-message {
  padding: 12px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.45;
}

.auth-message[data-state="error"] {
  color: #9f2828;
  border-color: #f3cece;
  background: var(--danger-soft);
}

.auth-message[data-state="success"] {
  color: var(--success);
  border-color: #cde8ca;
  background: var(--success-soft);
}

.auth-message[data-state="info"],
.auth-message[data-state="loading"] {
  color: var(--navy);
  border-color: #d5e2f7;
  background: var(--info-soft);
}

.auth-switch-copy {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.auth-switch-copy button {
  padding: 3px 2px;
  color: var(--navy);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.auth-legal {
  margin: 19px 0 0;
  padding-top: 18px;
  border-top: 1px solid #e9edf3;
  color: #8a95a7;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
}

.auth-footer {
  margin: 20px 0 0;
  color: #8a95a7;
  font-size: 0.71rem;
  text-align: center;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(255, 199, 44, 0.72);
  outline-offset: 3px;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(320px, 0.78fr) minmax(490px, 1.22fr);
  }

  .auth-showcase {
    padding: 40px 34px;
  }

  .auth-showcase h1 {
    font-size: clamp(2.25rem, 5vw, 3.4rem);
  }

  .showcase-benefits {
    font-size: 0.86rem;
  }

  .auth-panel {
    padding-inline: 34px;
  }
}

@media (max-width: 780px) {
  html.auth-session-probe .auth-shell {
    visibility: hidden;
  }

  .auth-shell {
    display: block;
    min-height: 100vh;
    padding: 22px 18px 30px;
    background:
      radial-gradient(circle at 100% 0, rgba(255, 199, 44, 0.18), transparent 31%),
      radial-gradient(circle at 0 100%, rgba(103, 194, 58, 0.12), transparent 34%),
      #f6f8fc;
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    min-height: auto;
    display: block;
    padding: 0;
  }

  .auth-panel-inner {
    margin: 0 auto;
  }

  .brand--mobile {
    display: inline-flex;
    margin: 4px 0 22px 3px;
  }

  .brand--mobile img {
    width: 178px;
  }

  .back-home {
    float: right;
    margin: 12px 4px 0 0;
  }

  .auth-card {
    clear: both;
    padding: 30px 25px;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(7, 31, 75, 0.12);
  }
}

@media (max-width: 440px) {
  .auth-shell {
    padding: 17px 12px 25px;
  }

  .brand--mobile {
    margin-bottom: 18px;
  }

  .brand--mobile img {
    width: 150px;
  }

  .back-home {
    margin-top: 9px;
    font-size: 0.78rem;
  }

  .auth-card {
    padding: 26px 18px;
    border-radius: 21px;
  }

  .auth-heading {
    margin-bottom: 23px;
  }

  .auth-heading h2 {
    font-size: 1.62rem;
  }

  .auth-tabs {
    margin-bottom: 23px;
  }

  .auth-tab {
    padding-inline: 6px;
    font-size: 0.78rem;
  }

  .field-label-row {
    align-items: flex-start;
  }

  .forgot-link {
    max-width: 150px;
    text-align: right;
  }

  .input-control input {
    font-size: 16px;
  }
}

/* Aplicación nativa: encabezado seguro y formulario móvil compacto. */
@media (max-width: 780px) {
  html[data-native-app],
  html[data-native-app] body {
    min-height: 100%;
    background: #080a0d !important;
  }

  html[data-native-app] .auth-shell {
    min-height: 100dvh;
    padding: 0 !important;
    background: #080a0d !important;
  }

  html[data-native-app] .auth-panel {
    min-height: 100dvh;
    padding:
      max(calc(env(safe-area-inset-top, 0px) + 28px), 66px)
      18px
      max(calc(env(safe-area-inset-bottom, 0px) + 22px), 34px) !important;
    background: #080a0d !important;
  }

  html[data-native-app] .auth-panel-inner {
    width: 100%;
    max-width: 520px;
  }

  html[data-native-app] .brand--mobile {
    width: 168px;
    min-height: 58px;
    margin: 0 0 28px;
    padding: 8px 12px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #ffffff;
  }

  html[data-native-app] .brand--mobile img {
    width: 145px;
    max-height: 42px;
    object-fit: contain;
  }

  html[data-native-app] .back-home {
    margin: 10px 2px 0 0;
  }

  html[data-native-app] .auth-card {
    padding: 24px 20px;
    border-radius: 22px;
    background: #0d0f12 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
  }

  html[data-native-app] .auth-heading {
    margin-bottom: 20px;
  }

  html[data-native-app] .auth-heading h2 {
    font-size: 1.75rem;
  }

  html[data-native-app] .auth-heading p:last-child {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  html[data-native-app] .auth-tabs {
    min-height: 52px;
    margin-bottom: 20px;
  }

  html[data-native-app] .auth-form {
    gap: 17px;
  }

  html[data-native-app] .input-control {
    min-height: 56px;
  }

  html[data-native-app] .auth-submit {
    min-height: 54px;
    margin-top: 6px;
  }

  html[data-native-app] .auth-footer {
    padding-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
