@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800;900&display=swap');

/* Hoja de estilos propia para login.html / registro.html — tema oscuro,
   independiente de style.css (que define el tema claro del panel interno)
   para que no se pisen las variables de color entre los dos. */

:root {
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --color-brand-green: #3dffa0;
  --color-brand-green-dim: #28cc7a;
  --color-surface: #0d1117;
  --color-card: #161b22;
  --color-card-border: #21262d;
  --color-text: #e6edf3;
  --color-text-dim: #c9d1d9;
  --color-muted: #8b949e;
  --color-faint: #4a5568;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-surface);
  color: var(--color-text);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset;
  -webkit-text-fill-color: var(--color-text);
  caret-color: var(--color-text);
}

.auth-page {
  min-height: 100dvh;
  display: flex;
}

/* ---- Panel izquierdo: marca ---- */

.auth-side {
  display: none;
  width: 42%;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #161b22 0%, #0d1117 60%, #0a1a0e 100%);
  border-right: 1px solid var(--color-card-border);
}
@media (min-width: 1024px) {
  .auth-side { display: flex; }
}

.auth-side-grid {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: linear-gradient(var(--color-brand-green) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-brand-green) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.auth-side-glow {
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 255, 160, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.auth-logo-badge {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-logo-badge svg { color: var(--color-brand-green); flex-shrink: 0; }
.auth-logo-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.auth-logo-wordmark em { color: var(--color-brand-green); font-style: normal; }
.auth-logo-by {
  font-size: 11px;
  color: var(--color-muted);
  letter-spacing: 0.06em;
}

.auth-side-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.auth-eyebrow {
  font-size: 11px;
  color: var(--color-brand-green);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.auth-side-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
  margin: 0 0 20px;
}
.auth-side-title em { color: var(--color-brand-green); font-style: normal; }
.auth-side-copy {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 340px;
  margin: 0;
}

.auth-stats {
  display: flex;
  gap: 32px;
}
.auth-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
}
.auth-stat-label {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
}

.auth-side-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--color-faint);
  margin: 0;
}

/* ---- Panel derecho: formulario ---- */

.auth-form-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-logo-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}
@media (min-width: 1024px) {
  .auth-logo-mobile { display: none; }
}
.auth-logo-mobile svg { color: var(--color-brand-green); }
.auth-logo-mobile-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
}
.auth-logo-mobile-wordmark em { color: var(--color-brand-green); font-style: normal; }
.auth-logo-mobile-by {
  font-size: 10px;
  color: var(--color-faint);
  margin: 1px 0 0;
}

.auth-form-wrap { width: 100%; max-width: 400px; }

.auth-form-header { margin-bottom: 36px; }
.auth-form-header h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 8px;
}
.auth-form-header p {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
}

.auth-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.auth-field-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-dim);
}
.auth-forgot {
  font-size: 12px;
  color: var(--color-brand-green);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.auth-input-wrap {
  position: relative;
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  background: var(--color-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input-wrap:focus-within {
  border-color: var(--color-brand-green);
  box-shadow: 0 0 0 3px rgba(61, 255, 160, 0.08);
}
.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-faint);
  display: flex;
  pointer-events: none;
  transition: color 0.15s;
}
.auth-input-wrap:focus-within .auth-input-icon { color: var(--color-brand-green); }
.auth-input-wrap input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 13px 14px 13px 44px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  border-radius: 10px;
}
.auth-input-wrap input.has-toggle { padding-right: 44px; }
.auth-toggle-visibility {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-faint);
  padding: 0;
  display: flex;
  align-items: center;
}
.auth-toggle-visibility:hover { color: var(--color-text-dim); }

.auth-hint {
  font-size: 12.5px;
  color: var(--color-muted);
  margin: -12px 0 20px;
}

.auth-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--color-brand-green) 0%, var(--color-brand-green-dim) 100%);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #0a1a0e;
  cursor: pointer;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  margin-top: 4px;
  transition: opacity 0.15s, transform 0.1s;
}
.auth-submit:hover { opacity: 0.92; transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.auth-submit.is-loading { color: transparent; pointer-events: none; position: relative; }
.auth-submit.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid rgba(10, 26, 14, 0.35);
  border-top-color: #0a1a0e;
  animation: auth-spin 700ms linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .auth-submit.is-loading::after { animation-duration: 1400ms; }
}

.auth-switch {
  text-align: center;
  margin-top: 28px;
  font-size: 14px;
  color: var(--color-muted);
}
.auth-switch button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-brand-green);
  font-weight: 600;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
}
.auth-switch a {
  color: var(--color-brand-green);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

.btn-ver-planes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(61, 255, 160, 0.3);
  background: rgba(61, 255, 160, 0.06);
  color: var(--color-brand-green);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ver-planes:hover { border-color: rgba(61, 255, 160, 0.5); background: rgba(61, 255, 160, 0.1); }

.hidden { display: none !important; }

.result-box {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--color-card-border);
  background: var(--color-card);
  color: var(--color-text-dim);
}
.result-box.error {
  background: rgba(248, 81, 73, 0.12);
  color: #ff9e97;
  border-color: rgba(248, 81, 73, 0.35);
}
.result-box.ok {
  background: rgba(61, 255, 160, 0.1);
  color: var(--color-brand-green);
  border-color: rgba(61, 255, 160, 0.3);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-card-border); border-radius: 3px; }

/* ==================== DISEÑO V2 + ANIMACIONES ====================
   Capa encima de lo de arriba: solo presentación, ningún selector de acá
   toca IDs que use el JS de login/registro. Todo se apaga con
   prefers-reduced-motion (ver al final). */

@keyframes dl-slide-left   { from { opacity: 0; transform: translateX(-60px) skewX(-3deg); } to { opacity: 1; transform: none; } }
@keyframes dl-slide-right  { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes dl-slide-bottom { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
@keyframes dl-glow-pulse {
  0%, 100% { box-shadow: 0 0 20px 0 rgba(61,255,160,.15), 0 0 60px 0 rgba(61,255,160,.05); }
  50%      { box-shadow: 0 0 40px 8px rgba(61,255,160,.25), 0 0 80px 20px rgba(61,255,160,.08); }
}
@keyframes dl-orb1 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,-30px) scale(1.1); } 66% { transform: translate(-20px,20px) scale(.95); } }
@keyframes dl-orb2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px,30px) scale(1.15); } }
@keyframes dl-particle {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
  10%, 90% { opacity: var(--o, .4); }
  100% { transform: translateY(-120vh) translateX(30px) rotate(360deg); opacity: 0; }
}
@keyframes dl-scanline { from { transform: translateY(-100%); } to { transform: translateY(100vh); } }
@keyframes dl-count-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dl-shimmer  { from { background-position: -200% center; } to { background-position: 200% center; } }
@keyframes dl-fade-scale { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes dl-grid-move { from { background-position: 0 0; } to { background-position: 48px 48px; } }
@keyframes dl-letter-pop { from { opacity: 0; transform: translateY(20px) rotateX(90deg); } to { opacity: 1; transform: none; } }
@keyframes dl-ripple { from { transform: scale(0); opacity: .6; } to { transform: scale(4); opacity: 0; } }

/* ---- Panel izquierdo ---- */
@media (min-width: 1024px) {
  .auth-side { width: 45%; min-width: 420px; }
}
.auth-side {
  padding: 52px;
  background: linear-gradient(150deg, #0f1f14 0%, #0d1117 50%, #0a0f1a 100%);
  border-right-color: #1a2530;
  animation: dl-slide-left .8s cubic-bezier(.22,1,.36,1) both;
}
.auth-side-grid { background-size: 48px 48px; animation: dl-grid-move 4s linear infinite; }
.auth-side-scan {
  position: absolute; left: 0; right: 0; height: 2px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(61,255,160,.15), transparent);
  animation: dl-scanline 6s linear infinite;
}
.auth-side-glow {
  bottom: -60px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(61,255,160,.09) 0%, transparent 65%);
  animation: dl-orb1 8s ease-in-out infinite;
}
.auth-side-glow-2 {
  position: absolute; top: -40px; right: -60px; width: 320px; height: 320px; border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(61,255,160,.06) 0%, transparent 65%);
  animation: dl-orb2 11s ease-in-out infinite;
}
.auth-particles span {
  position: absolute; bottom: -10px; border-radius: 50%; background: var(--color-brand-green);
  left: var(--x); width: var(--s); height: var(--s); opacity: 0;
  animation: dl-particle var(--t) linear var(--d) infinite;
  pointer-events: none;
}

.auth-logo { z-index: 2; animation: dl-slide-left .7s cubic-bezier(.22,1,.36,1) .05s both; }
.auth-logo-badge {
  background: rgba(61,255,160,.08);
  border-color: rgba(61,255,160,.2);
  border-radius: 12px;
  padding: 10px 14px;
  gap: 10px;
  backdrop-filter: blur(8px);
}
.auth-logo-wordmark { font-weight: 800; font-size: 15px; letter-spacing: 0; }
.auth-logo-by { font-size: 10px; color: var(--color-faint); letter-spacing: .08em; text-transform: uppercase; }

.auth-side-body { z-index: 2; gap: 0; }
.auth-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: .2em; margin-bottom: 12px;
  animation: dl-slide-left .7s cubic-bezier(.22,1,.36,1) .15s both;
}
.auth-side-title {
  font-weight: 900; font-size: clamp(2.4rem, 3.5vw, 3.2rem); line-height: 1.05;
  margin-bottom: 24px; perspective: 600px;
}
.auth-side-title .l {
  display: inline-block;
  animation: dl-letter-pop .5s cubic-bezier(.22,1,.36,1) calc(var(--b, .2s) + var(--i) * .04s) both;
}
.auth-side-title em .l {
  background: linear-gradient(90deg, #3dffa0 0%, #7fffcb 40%, #3dffa0 60%, #28cc7a 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    dl-letter-pop .5s cubic-bezier(.22,1,.36,1) calc(var(--b, .45s) + var(--i) * .04s) both,
    dl-shimmer 3s linear infinite;
}
.auth-side-copy {
  line-height: 1.7; margin-bottom: 40px;
  animation: dl-slide-left .7s cubic-bezier(.22,1,.36,1) .55s both;
}

.auth-stats { gap: 0; border: 1px solid #1e2a1e; border-radius: 12px; overflow: hidden; }
.auth-stats > div {
  flex: 1; padding: 18px 16px; text-align: center;
  background: rgba(255,255,255,.02);
  border-right: 1px solid #1e2a1e;
  animation: dl-count-up .5s cubic-bezier(.22,1,.36,1) both;
}
.auth-stats > div:nth-child(1) { animation-delay: .6s; }
.auth-stats > div:nth-child(2) { animation-delay: .7s; background: rgba(61,255,160,.05); }
.auth-stats > div:nth-child(3) { animation-delay: .8s; border-right: none; }
.auth-stat-value { font-size: 24px; font-weight: 900; line-height: 1; }
.auth-stats > div:nth-child(2) .auth-stat-value { color: var(--color-brand-green); }
.auth-stat-label { color: var(--color-faint); margin-top: 4px; letter-spacing: .04em; }

.auth-side-footer { z-index: 2; font-size: 11px; color: #2a3a2a; animation: dl-fade-scale .5s ease .9s both; }

/* ---- Panel derecho ---- */
.auth-form-side {
  position: relative; overflow: hidden;
  animation: dl-slide-right .7s cubic-bezier(.22,1,.36,1) .1s both;
}
.auth-form-side::before {
  content: ''; position: absolute; top: 20%; right: -100px; width: 400px; height: 400px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(61,255,160,.03) 0%, transparent 70%);
}
.auth-form-wrap { position: relative; }

.auth-form-header { margin-bottom: 40px; animation: dl-slide-right .6s cubic-bezier(.22,1,.36,1) .2s both; }
.auth-form-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.auth-form-eyebrow::before {
  content: ''; height: 2px; width: 28px; border-radius: 2px;
  background: linear-gradient(90deg, var(--color-brand-green), transparent);
}
.auth-form-eyebrow span {
  font-size: 11px; color: var(--color-brand-green); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
.auth-form-header h1 { font-size: 30px; font-weight: 900; margin-bottom: 10px; line-height: 1.1; }
.auth-form-header p { line-height: 1.6; }

/* Aparición escalonada: cada bloque trae su delay en --d */
.auth-anim { animation: dl-slide-bottom .5s cubic-bezier(.22,1,.36,1) var(--d, 0s) both; }

.auth-field { gap: 8px; margin-bottom: 18px; }
.auth-field label { font-size: 12px; font-weight: 600; color: var(--color-muted); letter-spacing: .05em; text-transform: uppercase; }
.auth-forgot { transition: opacity .15s; }
.auth-forgot:hover { opacity: .7; }

.auth-input-wrap {
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.auth-input-wrap:focus-within {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(61,255,160,.1), 0 4px 20px rgba(0,0,0,.3);
}
.auth-input-icon { left: 15px; transition: color .2s; }
.auth-input-wrap input { padding: 14px 14px 14px 46px; border-radius: 12px; }
.auth-input-wrap input.has-toggle { padding-right: 46px; }
.auth-toggle-visibility { right: 15px; transition: color .2s; }

.auth-submit {
  position: relative; overflow: hidden;
  padding: 15px; border-radius: 12px;
  background: linear-gradient(135deg, #3dffa0 0%, #1dd97a 50%, #28cc7a 100%);
  font-weight: 800; color: #051409; letter-spacing: .02em;
  animation: dl-glow-pulse 2.5s ease-in-out infinite;
  transition: transform .15s, filter .15s, opacity .15s;
}
.auth-submit:hover { opacity: 1; transform: translateY(-2px) scale(1.01); filter: brightness(1.08); }
.auth-submit:active { transform: scale(.98); }
.auth-submit:disabled { animation: none; }
.auth-ripple {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: rgba(255,255,255,.25); pointer-events: none;
  animation: dl-ripple .6s ease-out forwards;
}

.auth-switch a { font-weight: 700; text-decoration: underline; text-decoration-color: rgba(61,255,160,.3); transition: opacity .15s; }
.auth-switch a:hover { opacity: .75; }

.btn-ver-planes { border-radius: 12px; transition: border-color .2s, background .2s, transform .15s; }
.btn-ver-planes:hover { transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .auth-side, .auth-side *, .auth-form-side, .auth-form-side *, .auth-form-side::before {
    animation: none !important;
    transition: none !important;
  }
  .auth-particles, .auth-side-scan { display: none; }
}
