:root {
  --navy: #071225;
  --navy-2: #0b203d;
  --blue: #1769e8;
  --blue-dark: #0d55c7;
  --surface: #ffffff;
  --canvas: #eef3f8;
  --text: #132238;
  --muted: #6b7889;
  --line: #dce3ec;
  --danger: #b42318;
  --success: #137a4a;
  --shadow: 0 24px 60px rgba(7, 18, 37, .16);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--canvas);
}
button, input { font: inherit; }
a { color: inherit; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 44%) minmax(420px, 56%);
  background: var(--surface);
}

.auth-cover {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 58px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 24%, rgba(23, 105, 232, .32), transparent 32rem),
    radial-gradient(circle at 20% 82%, rgba(17, 76, 158, .22), transparent 26rem),
    linear-gradient(145deg, #061126 0%, #071a34 56%, #061225 100%);
}
.auth-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .17;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(135deg, #000, transparent 72%);
  pointer-events: none;
}
.auth-cover::after {
  content: "";
  position: absolute;
  inset: auto -180px -220px auto;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 105, 232, .42), transparent 66%);
  pointer-events: none;
}
.auth-brand,
.auth-cover__identity { position: relative; z-index: 1; }
.auth-brand { width: min(270px, 100%); }
.auth-brand img { display: block; width: 100%; height: auto; }
.auth-cover__identity { display: grid; gap: 5px; }
.auth-cover__identity span {
  color: rgba(255,255,255,.66);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-cover__identity strong { font-size: clamp(1.8rem, 3vw, 3.2rem); letter-spacing: -.035em; }
.auth-cover__identity small { color: rgba(255,255,255,.62); font-size: .9rem; }

.auth-pane {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 70px);
  background:
    radial-gradient(circle at 100% 0, rgba(23, 105, 232, .08), transparent 32rem),
    var(--canvas);
}
.auth-card {
  width: min(100%, 430px);
  padding: clamp(26px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-back {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 650;
}
.auth-back:hover { color: var(--blue); }
.auth-heading { margin-bottom: 24px; }
.auth-heading > span {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-heading h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2rem, 5vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: -.035em;
}
.auth-heading p { margin: 8px 0 0; color: var(--muted); font-size: .94rem; }

.google-auth { min-height: 44px; }
.google-auth[hidden], .auth-divider[hidden] { display: none !important; }
.google-button { min-height: 44px; display: flex; justify-content: center; overflow: hidden; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #8b96a4; font-size: .76rem; }
.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; }
label > span:first-child { color: var(--navy); font-size: .84rem; font-weight: 750; }
input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cfd8e4;
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #fbfcfe;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus { border-color: rgba(23, 105, 232, .7); background: #fff; box-shadow: 0 0 0 3px rgba(23, 105, 232, .1); }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; border: 1px solid #cfd8e4; border-radius: 10px; background: #fbfcfe; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.password-field:focus-within { border-color: rgba(23, 105, 232, .7); background: #fff; box-shadow: 0 0 0 3px rgba(23, 105, 232, .1); }
.password-field input { min-width: 0; border: 0; border-radius: 0; padding-right: 10px; background: transparent; }
.password-field input:focus { box-shadow: none; }
.password-field button {
  min-width: 82px;
  margin: 5px;
  border: 0;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--blue);
  background: #edf4ff;
  font-size: .75rem;
  font-weight: 750;
  cursor: pointer;
}
.password-field button:hover { background: #dceaff; }
.password-field button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.auth-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-row a,
.auth-secondary { color: var(--blue); text-decoration: none; font-size: .82rem; font-weight: 700; }
.auth-row a:hover,
.auth-secondary:hover { text-decoration: underline; }
.auth-status { min-height: 20px; font-size: .84rem; font-weight: 650; }
.auth-status.is-error { color: var(--danger); }
.auth-status.is-success { color: var(--success); }
.auth-submit {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-weight: 760;
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.auth-submit:hover { background: var(--blue-dark); transform: translateY(-1px); }
.auth-submit:disabled { opacity: .58; cursor: wait; transform: none; }
.auth-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}
.auth-footer span { width: 7px; height: 7px; border-radius: 50%; background: #20a66a; }

.auth-summary { display: grid; gap: 0; margin: 0 0 20px; }
.auth-summary div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.auth-summary span { color: var(--muted); }
.auth-summary strong { text-align: right; }
.auth-note { margin: -8px 0 18px; color: var(--muted); font-size: .8rem; }
.auth-secondary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-cover { min-height: 190px; padding: 24px; }
  .auth-cover__identity { display: none; }
  .auth-pane { min-height: calc(100vh - 190px); padding: 20px 14px 34px; align-items: start; }
  .auth-card { margin-top: -54px; position: relative; z-index: 2; }
}

@media (max-width: 480px) {
  .auth-cover { min-height: 150px; }
  .auth-brand { width: min(210px, 72vw); }
  .auth-pane { min-height: calc(100vh - 150px); }
  .auth-card { margin-top: -34px; padding: 24px 19px; border-radius: 15px; }
  .auth-back { margin-bottom: 22px; }
}

.preview-access {
  display: grid;
  gap: 7px;
  margin: 0 0 20px;
  padding: 14px 15px;
  border: 1px solid rgba(23, 105, 232, .22);
  border-radius: 12px;
  background: #f2f7ff;
}
.preview-access[hidden] { display: none !important; }
.preview-access > span { color: var(--blue); font-size: .7rem; font-weight: 850; letter-spacing: .08em; }
.preview-access > strong { color: var(--navy); font-size: .86rem; }
.preview-access button {
  justify-self: start;
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}
.preview-access button:hover { text-decoration: underline; }

/* BUILD 017 · LOGIN MÓVIL */
@media(max-width:640px){
  html,body{min-height:100%;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
  .login-shell,.auth-shell{padding:16px 12px!important}.login-card,.auth-card{width:100%!important;max-width:100%!important;padding:24px 18px!important;border-radius:18px!important}
  input,select,textarea{font-size:16px!important;min-height:50px!important}.button,button{min-height:48px!important;font-size:15px!important}
}

/* Acceso premium: menos blanco plano, mejor contraste y CTA principal claro. */
body[data-auth-page="login"] {
  background:
    radial-gradient(circle at 10% 0%, rgba(49, 147, 255, 0.12), transparent 30rem),
    linear-gradient(145deg, #e8f1fb 0%, #f4f8fd 52%, #e6eef8 100%);
}
body[data-auth-page="login"] .auth-shell {
  background: linear-gradient(112deg, #061126 0%, #0a1f3d 43.5%, #eaf2fb 43.5%, #eaf2fb 100%);
}
body[data-auth-page="login"] .auth-pane {
  background:
    radial-gradient(circle at 100% 0%, rgba(42, 158, 255, 0.16), transparent 30rem),
    linear-gradient(145deg, #eaf3fc 0%, #f5f9fe 100%);
}
body[data-auth-page="login"] .auth-card {
  border-color: rgba(133, 169, 209, 0.58);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(244,249,255,0.97));
  box-shadow: 0 30px 70px rgba(24, 63, 106, 0.18), 0 8px 22px rgba(24, 63, 106, 0.08);
}
body[data-auth-page="login"] .auth-back {
  width: fit-content;
  margin-bottom: 24px;
  padding: 7px 10px;
  border: 1px solid rgba(115, 151, 194, 0.28);
  border-radius: 999px;
  color: #5c7390;
  background: rgba(235, 244, 253, 0.76);
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
body[data-auth-page="login"] .auth-back:hover {
  border-color: rgba(23, 105, 232, 0.38);
  color: #0d5fd0;
  background: rgba(224, 239, 255, 0.94);
}
body[data-auth-page="login"] input {
  border-color: #c2d3e7;
  border-radius: 12px;
  background: #f1f6fc;
}
body[data-auth-page="login"] input:focus {
  border-color: rgba(23, 105, 232, 0.72);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(23, 105, 232, 0.11), 0 5px 14px rgba(23, 105, 232, 0.08);
}
body[data-auth-page="login"] .password-field {
  border-color: #c2d3e7;
  border-radius: 12px;
  background: #f1f6fc;
}
body[data-auth-page="login"] .password-field:focus-within {
  border-color: rgba(23, 105, 232, 0.72);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(23, 105, 232, 0.11), 0 5px 14px rgba(23, 105, 232, 0.08);
}
body[data-auth-page="login"] .password-field button {
  min-width: 88px;
  margin: 4px;
  border: 1px solid rgba(120, 194, 255, 0.55);
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(135deg, #1267df 0%, #2bb9ff 100%);
  box-shadow: 0 5px 12px rgba(18, 103, 223, 0.22), inset 0 1px 0 rgba(255,255,255,0.18);
  font-size: .78rem;
  font-weight: 800;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
body[data-auth-page="login"] .password-field button:hover {
  background: linear-gradient(135deg, #0f5dce 0%, #1fa9ef 100%);
  filter: saturate(1.08);
  transform: translateY(-1px);
  box-shadow: 0 7px 15px rgba(18, 103, 223, 0.28), inset 0 1px 0 rgba(255,255,255,0.2);
}
body[data-auth-page="login"] .password-field button:focus-visible {
  outline: 3px solid rgba(45, 181, 255, 0.34);
  outline-offset: 1px;
}
body[data-auth-page="login"] .auth-submit {
  min-height: 56px;
  border: 1px solid rgba(111, 205, 255, 0.42);
  border-radius: 15px;
  background: linear-gradient(135deg, #0c5fd6 0%, #1b82ef 52%, #38c4ff 100%);
  box-shadow: 0 13px 26px rgba(13, 100, 231, 0.27), inset 0 1px 0 rgba(255,255,255,0.2);
  font-size: 1rem;
  font-weight: 820;
  letter-spacing: -0.01em;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
body[data-auth-page="login"] .auth-submit:hover {
  background: linear-gradient(135deg, #0b58c9 0%, #1679e3 52%, #2bb5f2 100%);
  filter: saturate(1.08);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(13, 100, 231, 0.34), inset 0 1px 0 rgba(255,255,255,0.22);
}
body[data-auth-page="login"] .auth-submit:focus-visible {
  outline: 3px solid rgba(45, 181, 255, 0.38);
  outline-offset: 3px;
}
body[data-auth-page="login"] .auth-submit svg {
  width: 20px;
  height: 20px;
}
body[data-auth-page="login"] .auth-footer {
  border-top-color: rgba(133, 169, 209, 0.42);
}

@media (max-width: 480px) {
  body[data-auth-page="login"] .auth-shell {
    background: #071a34;
  }

  body[data-auth-page="login"] .auth-card {
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(242,248,255,0.98));
  }

  body[data-auth-page="login"] .auth-submit {
    min-height: 56px !important;
  }
}
