:root{
  --bg-main:#000;
  --bg-soft:#0b0b0b;
  --bg-elev:#111;
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);
  --text:#f5f5f5;
  --muted:#a9a9a9;
  --accent:#ffffff;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html,body{ height:100%; max-width:100%; overflow-x:hidden; }
body{
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  background: radial-gradient(800px 500px at 50% 0%, rgba(255,255,255,.06), transparent 55%),
              linear-gradient(180deg, #000, #000);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: .002em;
}
::selection{ background: rgba(255,255,255,.16); color: #fff; }

.login-app{
  min-height:100vh;
  max-width:480px;
  width:100%;
  margin:0 auto;
  padding: 1.1rem 1.2rem;
  display:flex;
  align-items:center;
  justify-content:center;
}

.login-card{
  width:100%;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 1.1rem 1rem 1rem;
  box-shadow: 0 18px 38px rgba(0,0,0,.75);
  backdrop-filter: blur(10px);
}

.logo{
  position: relative;
  width: 86px;
  height: 86px;
  margin: .2rem auto .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* logo responsive y limpio */
.orbital{
  width: 100%;
  height: 100%;
  object-fit: contain;     /* no recorta, solo ajusta */
  display: block;
}

/* Opcional: si el PNG tiene bordes raros, esto ayuda un poco */
.logo{
  padding: 10px;           /* crea aire alrededor del logo */
}

.logo-mark{
  width: 70px;
  height: 70px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.18), rgba(255,255,255,.03) 55%, rgba(0,0,0,.8) 100%);
  box-shadow: 0 0 20px rgba(255,255,255,.10);
  position:relative;
}
.logo-mark::after{
  content:"";
  position:absolute;
  inset: 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.65);
}
.logo-dots .dot{
  position:absolute;
  width:10px; height:10px;
  border-radius:999px;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.22);
}
.dot-1{ top: 8px; right: 14px; width: 12px; height: 12px; }
.dot-2{ top: 28px; right: 2px; width: 8px; height: 8px; opacity:.8; }
.dot-3{ top: 18px; left: 6px; width: 7px; height: 7px; opacity:.6; }

h1{
  text-align:center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .25rem;
}
.subtitle{
  text-align:center;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .95rem;
}

.field{
  display:flex;
  flex-direction:column;
  gap:.32rem;
  margin-bottom: .75rem;
}
.field-label{
  font-size: .72rem;
  color: var(--muted);
}

input{
  width:100%;
  border-radius: .9rem;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.55);
  color: var(--text);
  font-size: .86rem;
  padding: .62rem .78rem;
  outline: none;
}
input:focus{
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

.password-row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: .35rem;
  align-items:center;
}
.eye-btn{
  border-radius: .9rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  padding: .55rem .7rem;
  cursor:pointer;
}
.eye-btn:active{ transform: translateY(1px); }

/* ---- Consentimientos del registro ---- */
.consents{
  display:flex;
  flex-direction:column;
  gap:.6rem;
  margin: .35rem 0 .9rem;
}

.consent{
  display:grid;
  grid-template-columns: auto 1fr;
  gap:.55rem;
  align-items:start;
  font-size:.74rem;
  line-height:1.45;
  color: var(--muted);
  cursor:pointer;
}

/* La casilla hereda el `width:100%` de `input`: sin esto ocupa toda la fila. */
.consent input[type="checkbox"]{
  width:1rem;
  height:1rem;
  margin:.12rem 0 0;
  padding:0;
  flex:none;
  accent-color:#fff;
  cursor:pointer;
}

.consent a{
  color: var(--text);
  text-decoration: underline;
}

.consent--opcional{
  border-top: 1px solid var(--border);
  padding-top: .6rem;
  margin-top: .1rem;
}

.consent--opcional strong{ color: var(--text); }

.consent input[type="checkbox"]:focus-visible{
  outline: 2px solid rgba(255,255,255,.4);
  outline-offset: 2px;
}

.primary-btn{
  width:100%;
  margin-top: .25rem;
  border: none;
  border-radius: 999px;
  padding: .75rem .9rem;
  font-weight: 700;
  letter-spacing: .08em;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.65));
  color:#000;
  cursor:pointer;
}
.primary-btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.link-btn{
  width:100%;
  margin-top: .55rem;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: .78rem;
  cursor:pointer;
}

.divider{
  height:1px;
  background: var(--border);
  margin: .9rem 0 .7rem;
}

.bottom-text{
  text-align:center;
  font-size: .78rem;
  color: var(--muted);
}
.link-inline{
  background: transparent;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor:pointer;
  padding: 0;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  max-width: 480px;
  width: calc(100% - 2.4rem);
  background: rgba(10,10,10,.95);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: .7rem .85rem;
  font-size: .82rem;
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0,0,0,.75);
  opacity: 0;
  pointer-events:none;
  transition: opacity .16s ease, transform .16s ease;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Desktop: se mantiene “móvil” (solo centra y respeta max-width) */
@media (min-width: 768px){
  .login-app{ padding-top: 1.5rem; padding-bottom: 1.5rem; }
}
@media (min-width: 768px){
  .logo{
    width: 110px;
    height: 110px;
    padding: 12px;
  }
}

/* ===== Pulido profesional (monocromo) ===== */
input,
.eye-btn,
.primary-btn,
.link-btn,
.link-inline{
  transition: border-color .2s cubic-bezier(.4,0,.2,1),
              background-color .2s cubic-bezier(.4,0,.2,1),
              box-shadow .2s cubic-bezier(.4,0,.2,1),
              color .2s cubic-bezier(.4,0,.2,1),
              transform .12s cubic-bezier(.4,0,.2,1),
              filter .2s cubic-bezier(.4,0,.2,1);
}
.eye-btn:hover{ background: rgba(255,255,255,.08); }
.primary-btn:hover:not(:disabled){ filter: brightness(1.04); }
.primary-btn:active:not(:disabled){ transform: scale(.99); }
.link-btn:hover{ color: #fff; }
.link-inline:hover{ filter: brightness(1.1); }

/* ===== Animaciones de entrada ===== */
.login-card{
  animation: kzCardIn .55s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes kzCardIn{
  from{ opacity:0; transform: translateY(14px) scale(.985); filter: blur(2px); }
  to{ opacity:1; transform: translateY(0) scale(1); filter: blur(0); }
}
.logo{ animation: kzLogoIn .7s cubic-bezier(.22,.9,.3,1) both; }
@keyframes kzLogoIn{
  from{ opacity:0; transform: scale(.8); }
  to{ opacity:1; transform: scale(1); }
}
/* Entrada escalonada de los elementos del formulario */
.login-card h1{ animation: kzUp .5s ease both .06s; }
.login-card .subtitle{ animation: kzUp .5s ease both .12s; }
.login-card form > *{ animation: kzUp .5s ease both .18s; }
.login-card form > *:nth-child(2){ animation-delay:.24s; }
.login-card form > *:nth-child(3){ animation-delay:.30s; }
.login-card form > *:nth-child(4){ animation-delay:.36s; }
.login-card form > *:nth-child(5){ animation-delay:.42s; }
@keyframes kzUp{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}

/* ===== Código tipo OTP (4 casillas) ===== */
.otp-row{
  display:flex;
  gap:.55rem;
  justify-content:center;
}
.otp-box{
  width:100%;
  max-width:64px;
  height:60px;
  text-align:center;
  font-size:1.55rem;
  font-weight:800;
  font-variant-numeric: tabular-nums;
  border-radius:.85rem;
  border:1px solid var(--border);
  background: rgba(0,0,0,.55);
  color:#fff;
  caret-color: transparent;
  padding:0;
}
.otp-box:focus{
  border-color: rgba(255,255,255,.45);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
  transform: translateY(-1px);
}
.otp-box.is-filled{ border-color: rgba(255,255,255,.3); background:#0d0d0d; }

/* ===== Botón con estado de carga (spinner) ===== */
.primary-btn{ position:relative; }
.primary-btn.is-loading{ color: transparent !important; pointer-events:none; }
.primary-btn.is-loading::after{
  content:"";
  position:absolute; top:50%; left:50%;
  width:18px; height:18px; margin:-9px 0 0 -9px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,.35);
  border-top-color:#000;
  animation: kzSpin .7s linear infinite;
}
@keyframes kzSpin{ to{ transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* Optimización móvil: quita el desenfoque de fondo (caro de pintar) */
@media (pointer: coarse){
  .login-card{ backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
