/* =========================================================
   YOUR BODY TALKS — style-login.css
   Dark Premium · Glassmorphism · Teal
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* =========================================================
   TOKENS — Dark (default)
   ========================================================= */
:root {
  --ink:       #0a0f1e;
  --ink2:      #0d1529;
  --ink3:      #111d35;
  --ink4:      #152038;

  --teal:      #00c9a7;
  --teal2:     #00a98d;
  --teal-glow: rgba(0,201,167,.25);
  --teal-bg:   rgba(0,201,167,.06);
  --teal-bgh:  rgba(0,201,167,.11);
  --teal-bdr:  rgba(0,201,167,.22);
  --teal-bdrh: rgba(0,201,167,.45);

  --text:      #f0f4ff;
  --text2:     #f0f4ff;
  --muted:     rgba(176,192,220,.58);
  --muted2:    rgba(176,192,220,.32);

  --border:    rgba(255,255,255,.07);
  --borderh:   rgba(255,255,255,.13);
  --glass:     rgba(255,255,255,.032);
  --glassb:    rgba(255,255,255,.058);

  --shadow:    0 20px 60px rgba(0,0,0,.45);
  --radius:    16px;
  --font-head: 'Sora', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* =========================================================
   TOKENS — Light
   ========================================================= */
.light-theme {
  --ink:       #f0f3fb;
  --ink2:      #e8ecf7;
  --ink3:      #dde2f0;
  --ink4:      #d2d8ec;

  --teal:      #009980;
  --teal2:     #007a66;
  --teal-glow: rgba(0,153,128,.18);
  --teal-bg:   rgba(0,153,128,.06);
  --teal-bgh:  rgba(0,153,128,.11);
  --teal-bdr:  rgba(0,153,128,.20);
  --teal-bdrh: rgba(0,153,128,.45);

  --text:      #0d1529;
  --text2:     #0d1529;
  --muted:     rgba(40,60,100,.55);
  --muted2:    rgba(40,60,100,.32);

  --border:    rgba(0,0,0,.08);
  --borderh:   rgba(0,0,0,.14);
  --glass:     rgba(255,255,255,.65);
  --glassb:    rgba(255,255,255,.88);

  --shadow:    0 12px 40px rgba(0,0,0,.11);
}

/* =========================================================
   RESET / BASE
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  scrollbar-width: none;
}
*::-webkit-scrollbar { display: none; }

html, body { height: 100%; margin: 0; }

body.body-style {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .3s, color .3s;
}

a { color: inherit; text-decoration: none; }

/* =========================================================
   LAYOUT
   ========================================================= */
.auth-grid {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
}

/* =========================================================
   HERO — columna izquierda
   ========================================================= */
.hero.hero-deck {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 52px) clamp(28px, 4.5vw, 56px);
  overflow: hidden;
  border-right: 1px solid var(--border);
  transition: border-color .3s;
}

/* Grilla de puntos */
.hero.hero-deck::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(0,201,167,.10) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}
.light-theme .hero.hero-deck::before {
  background-image: radial-gradient(circle, rgba(0,153,128,.09) 1px, transparent 1px);
}

/* Orb de luz */
.hero.hero-deck::after {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,201,167,.11) 0%, transparent 68%);
  top: -200px; left: -170px;
  z-index: 0;
  animation: orbPulse 9s ease-in-out infinite;
}
.light-theme .hero.hero-deck::after {
  background: radial-gradient(circle, rgba(0,153,128,.08) 0%, transparent 68%);
}
@keyframes orbPulse {
  0%,100% { transform: scale(1) translate(0,0);         opacity: .75; }
  50%      { transform: scale(1.14) translate(24px,32px); opacity: 1;  }
}

.hero.hero-deck > * { position: relative; z-index: 1; }

/* -- Top: marca -- */
.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  border: 1px solid var(--teal-bdr);
  background: var(--teal-bg);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.brand-icon::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,201,167,.18), transparent 65%);
}
.brand-icon svg { position: relative; z-index: 1; }

.brand-text { font-family: var(--font-head); }

.brand-name {
  display: block;
  font-size: 15px; font-weight: 700;
  color: var(--text);
  letter-spacing: -.15px;
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  font-size: 10px; font-weight: 600;
  color: var(--teal);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  margin-top: 1px;
}

/* -- Cuerpo del hero -- */
.hero-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vh, 52px) 0;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 11px; font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 18px;
}
.hero-kicker::before {
  content: '';
  display: block;
  width: 22px; height: 1.5px;
  background: var(--teal);
  border-radius: 1px;
}

.hero-headline {
  font-family: var(--font-head);
  font-size: clamp(28px, 3.6vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.6px;
  color: var(--text);
  margin: 0 0 20px;
}
.hero-headline em {
  font-style: normal;
  color: var(--teal);
}

.hero-desc {
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.7;
  color: var(--muted);
  max-width: 40ch;
  margin: 0 0 40px;
}

/* Métricas */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.metric {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: clamp(14px, 2vw, 20px);
  transition: border-color .2s, background .2s, transform .2s;
  cursor: default;
}
.metric:hover {
  border-color: var(--teal-bdr);
  background: var(--teal-bgh);
  transform: translateY(-2px);
}

.metric-val {
  font-family: var(--font-head);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
}
.metric-val sup {
  font-size: .58em;
  color: var(--teal);
  font-weight: 700;
  vertical-align: super;
}

.metric-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.35;
}

/* -- Pie del hero -- */
.hero-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-beta {
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--teal-bdr);
  background: var(--teal-bg);
  padding: 3px 10px;
  border-radius: 20px;
}

.hero-foot-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* =========================================================
   PANEL — columna derecha
   ========================================================= */
.panel {
  background: var(--ink2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 56px) clamp(28px, 4vw, 48px);
  transition: background .3s, border-color .3s;
}

.login-card {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

/* Encabezado */
.login-pre {
  display: block;
  font-family: var(--font-head);
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 10px;
}

.login-title {
  font-family: var(--font-head);
  font-size: clamp(22px, 2.5vw, 28px);
  font-weight: 800;
  color: var(--text2);
  letter-spacing: -.4px;
  margin: 0 0 6px;
  line-height: 1.15;
}

.login-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 30px;
  line-height: 1.5;
}

/* ── Campos ── */
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field > span {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
}

.input-wrap { position: relative; }

.field-icon {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  opacity: .45;
  display: flex;
  pointer-events: none;
  transition: opacity .18s;
}
.input-wrap:focus-within .field-icon { opacity: .85; }

.field input,
.input-wrap input {
  width: 100%;
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0 46px 0 16px;
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field input:not(.has-icon),
.input-wrap input:not(.has-icon) { padding-right: 16px; }

.field input::placeholder,
.input-wrap input::placeholder { color: var(--muted2); }

.field input:hover,
.input-wrap input:hover { border-color: var(--borderh); }

.field input:focus,
.input-wrap input:focus {
  border-color: var(--teal-bdrh);
  background: var(--teal-bg);
  box-shadow: 0 0 0 3px rgba(0,201,167,.10);
}

.light-theme .field input,
.light-theme .input-wrap input {
  background: rgba(255,255,255,.75);
}
.light-theme .field input:focus,
.light-theme .input-wrap input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,153,128,.10);
}

/* ── Password ── */
.password-field { position: relative; }

.toggle-password {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: .5;
  transition: opacity .18s;
}
.toggle-password:hover { opacity: 1; }
.toggle-password .icon-eye-off { display: none; }
.toggle-password[aria-pressed="true"] .icon-eye     { display: none; }
.toggle-password[aria-pressed="true"] .icon-eye-off { display: inline; }

/* ── Botones ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .15px;
  line-height: 1;
  user-select: none;
  text-decoration: none;
  transition: filter .15s, transform .12s, box-shadow .15s;
}

.btn-primary {
  width: 100%;
  height: 50px;
  background: var(--teal);
  color: var(--ink);
  margin-top: 8px;
  border-color: transparent;
  box-shadow: 0 4px 22px var(--teal-glow), 0 1px 0 rgba(255,255,255,.18) inset;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,.12);
  opacity: 0;
  transition: opacity .18s;
}
.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 6px 30px var(--teal-glow);
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(1px); }

/* ── Separador ── */
.sep-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-size: 12px;
  color: var(--muted);
}
.sep-or::before,
.sep-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Acciones secundarias ── */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.link {
  font-size: 13px;
  font-weight: 500;
  color: var(--teal);
  text-decoration: none;
  transition: opacity .15s;
}
.link:hover { opacity: .72; }

.btn-ghost {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover {
  border-color: var(--teal-bdr);
  background: var(--teal-bgh);
}

/* ── Legal ── */
.legal {
  margin-top: 26px;
  font-size: 11.5px;
  color: var(--muted);
  opacity: .6;
  text-align: center;
  line-height: 1.6;
}

/* =========================================================
   TOGGLE TEMA — fixed
   ========================================================= */
#toggle-theme {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 90;
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: background .25s, border-color .25s;
}
#toggle-theme::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--teal);
  top: 2px; left: 2px;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 10px var(--teal-glow);
}
body.light-theme #toggle-theme::after { transform: translateX(18px); }
body.light-theme #toggle-theme {
  background: var(--teal-bg);
  border-color: var(--teal-bdr);
}

/* =========================================================
   MODAL
   ========================================================= */
.modal {
  position: fixed; inset: 0;
  display: none;
  place-items: center;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  transition: opacity .22s ease;
}
.modal.open {
  display: grid;
  opacity: 1;
}

.modal-contenido {
  width: min(480px, 92%);
  max-height: 82vh;
  overflow: auto;
  background: var(--ink2);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 32px;
  position: relative;
  transform: translateY(14px) scale(.98);
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.modal.open .modal-contenido { transform: translateY(0) scale(1); }

.cerrar {
  position: absolute;
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--glass);
  font-size: 20px; line-height: 1;
  transition: background .15s, border-color .15s;
}
.cerrar:hover {
  background: var(--glassb);
  border-color: var(--borderh);
}

.modal-contenido h3 {
  font-family: var(--font-head);
  font-size: 20px; font-weight: 800;
  color: var(--text2);
  margin: 0 0 8px;
  letter-spacing: -.3px;
}
.modal-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
}

body.no-scroll { overflow: hidden; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .auth-grid { grid-template-columns: 1fr; }

  .hero.hero-deck {
    order: 2;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: clamp(24px, 4vw, 36px) clamp(20px, 4vw, 32px);
  }
  .panel { padding: 36px 20px 28px; }
  .metrics { gap: 8px; }
  .metric { padding: 14px; }
  .metric-val { font-size: 20px; }
  .hero-headline { font-size: clamp(24px, 6vw, 34px); }
}

@media (max-width: 480px) {
  .hero-headline { font-size: 22px; }
  .metrics { gap: 6px; }
  .metric { padding: 12px 10px; }
  .metric-val { font-size: 17px; }
  .metric-label { font-size: 10px; }
  .login-card { max-width: 100%; }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero.hero-deck::after { animation: none; }
  .metric,
  .btn-primary,
  .btn-ghost,
  .toggle-password { transition: none; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .auth-grid {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  /* Ocultar hero completo en móvil */
  .hero.hero-deck {
    display: none;
  }

  /* Panel ocupa toda la pantalla */
  .panel {
    min-height: 100vh;
    padding: 36px 24px;
    border-left: none;
  }

  .login-card {
    max-width: 380px;
  }
}

@media (max-width: 480px) {
  .panel {
    padding: 28px 18px;
  }

  .login-card {
    max-width: 100%;
  }

  .field input,
  .input-wrap input {
    height: 46px;
    font-size: 15px;
  }

  .btn-primary {
    height: 48px;
  }
}