/* ==========================================================
   OINTRACK · LOGIN
   Responsive: Mobile · Tablet · Laptop · Desktop
   ========================================================== */

:root{
  /* Brand palette */
  --bg-deep:        #030a1c;
  --bg-deeper:      #020716;
  --panel:          #061533;
  --panel-2:        #0a1f44;
  --panel-border:   rgba(46, 232, 122, 0.18);
  --panel-border-2: rgba(120, 160, 255, 0.10);

  --accent-green:   #2ee87a;
  --accent-green-2: #19c66a;
  --accent-blue:    #5b6cff;
  --accent-violet:  #7c5cff;

  --text-strong:    #ffffff;
  --text:           #e7ecf7;
  --text-soft:      #a9b4cc;
  --text-mute:      #7a849c;

  --input-bg:       rgba(255, 255, 255, 0.025);
  --input-border:   rgba(255, 255, 255, 0.08);
  --input-border-focus: rgba(46, 232, 122, 0.55);

  --radius-card:    28px;
  --radius-input:   14px;
  --radius-btn:     14px;

  --shadow-card:    0 30px 90px -20px rgba(0, 0, 0, 0.85),
                    0 0 0 1px rgba(255,255,255,0.03) inset,
                    0 0 60px -10px rgba(46, 232, 122, 0.18);

  --grad-cta:       linear-gradient(90deg, #2ee87a 0%, #2bd3b4 45%, #5b6cff 100%);
  --grad-illus:     radial-gradient(120% 80% at 50% 100%, #082045 0%, #051330 55%, #020817 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(91, 108, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(46, 232, 122, 0.10), transparent 60%),
    var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  overflow-x: hidden;
}

/* Subtle dot grid background */
body::before{
  content:'';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}

/* ============== CARD ============== */
.card{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  background: linear-gradient(180deg, rgba(10, 25, 58, 0.85), rgba(5, 14, 35, 0.88));
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  /* Se adapta a la altura de la ventana: nunca obliga a hacer scroll */
  min-height: min(660px, calc(100vh - 32px));
}

/* ============== LEFT — ILLUSTRATION PANEL ============== */
.illus{
  position: relative;
  padding: clamp(28px, 4vw, 48px);
  background: var(--grad-illus);
  border-right: 1px solid var(--panel-border-2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 100%;
}

/* Faint dot pattern */
.illus::before{
  content:'';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(46, 232, 122, 0.10) 1px, transparent 1.5px);
  background-size: 14px 14px;
  mask-image: radial-gradient(120% 60% at 50% 0%, #000 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(120% 60% at 50% 0%, #000 30%, transparent 70%);
  opacity: .8;
}

/* Brand */
.brand{
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.brand .eye-logo{
  width: clamp(72px, 8vw, 96px);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(46,232,122,0.45));
  animation: float 4.5s ease-in-out infinite;
}
@keyframes float{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-5px); }
}
.brand .name{
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 3.2vw, 42px);
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 4px;
}
.brand .name .oin{ color: #ffffff; }
.brand .name .track{ color: var(--accent-green); }
.brand .tagline{
  font-size: 10.5px;
  letter-spacing: 4px;
  color: var(--text-soft);
  font-weight: 500;
  margin-top: 8px;
}

/* Headline */
.headline{
  position: relative;
  z-index: 2;
  margin-top: clamp(24px, 4vw, 40px);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.25;
  color: #fff;
}
.headline .hl{ color: var(--accent-green); }

/* Vehicles scene */
.scene{
  position: relative;
  z-index: 2;
  margin-top: auto;
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: 18px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(2,7,21,0.6) 100%),
    radial-gradient(60% 50% at 50% 60%, rgba(46,232,122,0.18), transparent 70%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.scene svg{ width: 100%; height: 100%; display: block; }

/* ====== Animaciones de la escena (rastreo en vivo) ====== */
/* Pin: flota suave */
.sc-pin{
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: scPinFloat 3s ease-in-out infinite;
}
@keyframes scPinFloat{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-6px); }
}
/* Resplandor bajo el pin: latido */
.sc-glow{
  transform-box: fill-box;
  transform-origin: center;
  animation: scGlow 3s ease-in-out infinite;
}
@keyframes scGlow{
  0%,100%{ opacity:.5; transform: scaleX(1); }
  50%{ opacity:.85; transform: scaleX(1.08); }
}
/* Anillos radar: se expanden y desvanecen, escalonados */
.sc-rings ellipse{
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: scRadar 2.8s ease-out infinite;
}
.sc-rings ellipse:nth-child(1){ animation-delay: 0s; }
.sc-rings ellipse:nth-child(2){ animation-delay: .9s; }
.sc-rings ellipse:nth-child(3){ animation-delay: 1.8s; }
@keyframes scRadar{
  0%{ transform: scale(.45); opacity:.85; }
  100%{ transform: scale(1.3); opacity:0; }
}
/* Nodos de red: titilan */
.sc-nodes circle{ animation: scTwinkle 2.8s ease-in-out infinite; }
.sc-nodes circle:nth-child(2n){ animation-delay:.9s; }
.sc-nodes circle:nth-child(3n){ animation-delay:1.6s; }
@keyframes scTwinkle{
  0%,100%{ opacity:.35; }
  50%{ opacity:1; }
}
/* Ventanas de edificios: titilan suave */
.sc-windows rect{ animation: scTwinkle 4.5s ease-in-out infinite; }
.sc-windows rect:nth-child(2n){ animation-delay:1.4s; }
.sc-windows rect:nth-child(3n){ animation-delay:2.6s; }

/* ============== RIGHT — FORM PANEL ============== */
.form-wrap{
  padding: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

.form-head{
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.form-head h1{
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--text-strong);
  margin: 0;
  letter-spacing: -0.3px;
}
.form-head p{
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

/* Form */
form{ display: flex; flex-direction: column; gap: 14px; }

.field{
  position: relative;
  display: flex;
  align-items: center;
}
.field .icon{
  position: absolute;
  left: 18px;
  width: 18px; height: 18px;
  color: var(--text-mute);
  pointer-events: none;
}
.field input{
  width: 100%;
  height: 54px;
  padding: 0 50px;
  font: 500 14.5px 'Plus Jakarta Sans', sans-serif;
  color: var(--text-strong);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.field input::placeholder{ color: var(--text-mute); }
.field input:focus{
  border-color: var(--input-border-focus);
  background: rgba(46, 232, 122, 0.04);
  box-shadow: 0 0 0 4px rgba(46, 232, 122, 0.10);
}
.field input:-webkit-autofill{
  -webkit-text-fill-color: var(--text-strong);
  -webkit-box-shadow: 0 0 0 1000px rgba(10,25,58,0.95) inset;
  caret-color: var(--text-strong);
}

.toggle-pass{
  position: absolute;
  right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 8px;
  transition: color .2s ease, background .2s ease;
}
.toggle-pass:hover{ color: var(--text); background: rgba(255,255,255,0.04); }
.toggle-pass svg{ width: 18px; height: 18px; }

/* Row: remember + forgot */
.row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 8px;
}
.check{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.check input{
  appearance: none;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s ease;
}
.check input:checked{
  background: var(--accent-violet);
  border-color: var(--accent-violet);
}
.check input:checked::after{
  content:'';
  width: 11px; height: 11px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}
.forgot{
  font-size: 14px;
  color: var(--accent-violet);
  text-decoration: none;
  font-weight: 500;
  transition: color .15s ease;
}
.forgot:hover{ color: #a99dff; text-decoration: underline; }

/* CTA */
.btn-primary{
  width: 100%;
  height: 56px;
  border: none;
  border-radius: var(--radius-btn);
  font: 600 16px 'Outfit', sans-serif;
  letter-spacing: 0.3px;
  color: #fff;
  cursor: pointer;
  background: var(--grad-cta);
  background-size: 200% 100%;
  background-position: 0% 50%;
  position: relative;
  overflow: hidden;
  transition: background-position .5s ease, transform .15s ease, box-shadow .25s ease;
  box-shadow: 0 12px 30px -10px rgba(91,108,255,0.55),
              0 6px 22px -8px rgba(46,232,122,0.50);
}
.btn-primary:hover{ background-position: 100% 50%; }
.btn-primary:active{ transform: translateY(1px); }

/* Divider */
.divider{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--text-mute);
  font-size: 13px;
  margin: 2px 0;
}
.divider::before, .divider::after{
  content:'';
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
}

/* Social buttons */
.socials{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn-social{
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.025);
  color: var(--text);
  font: 500 14px 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.btn-social:hover{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}
.btn-social:active{ transform: translateY(1px); }
.btn-social svg{ width: 20px; height: 20px; }

/* Signup link */
.signup{
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 2px;
}
.signup a{
  color: var(--accent-violet);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}
.signup a:hover{ text-decoration: underline; }

/* ============== FOOTER (trust badges) ============== */
.trust{
  grid-column: 1 / -1;
  border-top: 1px solid var(--panel-border-2);
  padding: 18px clamp(20px, 3vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 60px);
  flex-wrap: wrap;
  background: rgba(2, 7, 21, 0.4);
  position: relative;
}
/* dividers between items */
.trust .item + .item::before{
  content:'';
  position: absolute;
  margin-left: -30px;
  height: 22px;
  width: 1px;
  background: rgba(255,255,255,0.08);
  align-self: center;
}
.trust .item{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  position: relative;
}
.trust .item svg{
  width: 22px; height: 22px;
  color: var(--accent-green);
  filter: drop-shadow(0 0 6px rgba(46, 232, 122, 0.35));
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */

/* Laptop ≤ 1024px */
@media (max-width: 1024px){
  .card{ max-width: 920px; }
  .form-wrap{ padding: 40px 36px; }
}

/* Tablet ≤ 820px — stack panels */
@media (max-width: 820px){
  .card{
    grid-template-columns: 1fr;
    max-width: 560px;
    min-height: 0;
  }
  .illus{
    border-right: none;
    border-bottom: 1px solid var(--panel-border-2);
    padding: 36px 28px 24px;
  }
  .scene{
    max-width: 400px;
    margin: 24px auto 0;
  }
  .form-wrap{ padding: 32px 28px; }
  .trust .item + .item::before{ margin-left: -16px; }
}

/* Mobile ≤ 520px */
@media (max-width: 520px){
  body{ padding: 0; }
  .card{
    border-radius: 0;
    min-height: 100vh;
    border: none;
    max-width: 100%;
    box-shadow: none;
  }
  .illus{ padding: 28px 22px 18px; }
  .headline{ font-size: 18px; }
  .scene{ aspect-ratio: 16/10; }
  .form-wrap{ padding: 26px 22px 34px; gap: 18px; }
  .field input{ height: 52px; font-size: 14px; }
  .btn-primary{ height: 54px; }
  .socials{ grid-template-columns: 1fr; }
  .trust{
    gap: 14px 24px;
    padding: 16px 18px;
  }
  .trust .item + .item::before{ display: none; }
  .trust .item{ font-size: 13px; }
}

/* Very small ≤ 360px */
@media (max-width: 360px){
  .form-wrap{ padding: 22px 16px 28px; }
  .illus{ padding: 24px 16px 14px; }
  .brand .name{ font-size: 26px; }
}

/* Desktop ≥ 1280px */
@media (min-width: 1280px){
  .card{ max-width: 1120px; min-height: min(720px, calc(100vh - 40px)); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* =========================================================
   TEMA CLARO (LIGHT) · [data-theme="light"]
   El panel ilustracion permanece oscuro (identidad de marca);
   el panel del formulario se adapta a claro y legible.
   ========================================================= */
[data-theme="light"] body{
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(91, 108, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(46, 232, 122, 0.12), transparent 60%),
    #eef2f7;
  color: #0f172a;
}
[data-theme="light"] body::before{
  background-image: radial-gradient(rgba(15,23,42,0.05) 1px, transparent 1px);
}
[data-theme="light"] .card{
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 30px 80px -28px rgba(15, 23, 42, 0.30),
              0 0 0 1px rgba(15,23,42,0.03) inset;
}
/* El panel .illus mantiene su gradiente oscuro de marca (sin cambios) */

[data-theme="light"] .form-head h1{ color: #0f172a; }
[data-theme="light"] .form-head p,
[data-theme="light"] .check,
[data-theme="light"] .signup,
[data-theme="light"] .trust .item{ color: #475569; }

[data-theme="light"] .field input{
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}
[data-theme="light"] .field input::placeholder{ color: #94a3b8; }
[data-theme="light"] .field input:focus{
  border-color: var(--accent-green-2);
  background: rgba(46, 232, 122, 0.06);
  box-shadow: 0 0 0 4px rgba(46, 232, 122, 0.14);
}
[data-theme="light"] .field input:-webkit-autofill{
  -webkit-text-fill-color: #0f172a;
  -webkit-box-shadow: 0 0 0 1000px #f1f5f9 inset;
  caret-color: #0f172a;
}
[data-theme="light"] .field .icon,
[data-theme="light"] .toggle-pass{ color: #64748b; }
[data-theme="light"] .toggle-pass:hover{ background: rgba(15,23,42,0.05); color: #0f172a; }

[data-theme="light"] .check input{
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.25);
}
[data-theme="light"] .check input:checked{
  background: var(--accent-violet);
  border-color: var(--accent-violet);
}

[data-theme="light"] .divider{ color: #64748b; }
[data-theme="light"] .divider::before,
[data-theme="light"] .divider::after{
  background: linear-gradient(90deg, transparent, rgba(15,23,42,0.12), transparent);
}

[data-theme="light"] .btn-social{
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.10);
  color: #0f172a;
}
[data-theme="light"] .btn-social:hover{
  background: #e7edf5;
  border-color: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .trust{
  background: #f8fafc;
  border-top-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .trust .item + .item::before{ background: rgba(15, 23, 42, 0.12); }

/* =========================================================
   AJUSTE A PANTALLA COMPLETA (escritorio/laptop) — sin scroll
   El card llena la ventana y la ilustración se encoge para caber.
   ========================================================= */
@media (min-width: 821px){
  html, body{ height: 100vh; }
  body{ overflow: hidden; padding: 16px; }
  .card{
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: 1fr auto;   /* paneles arriba, footer de confianza abajo */
  }
  .illus, .form-wrap{ min-height: 0; }
  .illus{ overflow: hidden; }
  .scene{
    aspect-ratio: auto;             /* deja de forzar altura fija */
    flex: 1 1 auto;
    min-height: 120px;              /* se encoge para caber */
  }
}

/* Boton flotante de cambio de tema en el login */
.login-theme-toggle{
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #e7ecf7;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .3s ease;
}
.login-theme-toggle:hover{ background: rgba(255,255,255,0.12); transform: rotate(20deg); }
.login-theme-toggle svg{ width: 20px; height: 20px; }
[data-theme="light"] .login-theme-toggle{
  border-color: rgba(15,23,42,0.12);
  background: rgba(15,23,42,0.05);
  color: #0f172a;
}
[data-theme="light"] .login-theme-toggle:hover{ background: rgba(15,23,42,0.10); }