/* ============================================================
   CatálogoApp — Login Page Styles  ·  TEMA "GAMER KEYBOARD"
   Negro + verde lima neón + naranja
   Split-screen: dark brand panel (left) + dark form panel (right)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Paleta gamer */
  --lime:        #A3FF12;   /* verde lima neón (primario) */
  --lime-dark:   #8FE000;   /* hover */
  --lime-light:  #BFFF4D;
  --orange:      #FF7A1A;   /* naranja (acento secundario) */
  --orange-dark: #F26A00;

  /* RGB para glows */
  --lime-rgb:    163, 255, 18;
  --orange-rgb:  255, 122, 26;

  /* Compat: nombres antiguos apuntan a la paleta nueva */
  --brand-purple:       var(--lime);
  --brand-purple-dark:  var(--lime-dark);
  --brand-purple-light: var(--lime-light);
  --brand-accent:       var(--orange);

  /* Paneles negros */
  --panel-dark-bg:      #0A0A0A;
  --panel-dark-surface: #141414;
  --panel-dark-border:  rgba(var(--lime-rgb), 0.18);

  /* Form panel (oscuro tipo gamer) */
  --form-bg:            #0F0F0F;
  --form-input-bg:      #1A1A1A;
  --form-input-border:  #2A2A2A;
  --form-input-focus:   var(--lime);

  /* Texto */
  --text-dark:          #F5F5F5;   /* texto principal (claro sobre negro) */
  --text-muted:         #8A8A8A;
  --text-on-dark:       #FFFFFF;
  --text-muted-dark:    #9CA3AF;
}

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--panel-dark-bg);
}

/* ── Wrapper ────────────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   BRAND PANEL — columna izquierda
   ============================================================ */
.brand-panel {
  width: 50%;
  min-height: 100vh;
  background: var(--panel-dark-bg);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--panel-dark-border);
}

/* Pattern decorativo: puntos */
.brand-decoration {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(var(--lime-rgb), 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Glow difuso esquina superior-derecha (lima) */
.brand-panel::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(var(--lime-rgb), 0.22) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Glow difuso esquina inferior-izquierda (naranja) */
.brand-panel::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(var(--orange-rgb), 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Brand header ─────────────────────────────────────────── */
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand-logo-mark {
  width: 40px;
  height: 40px;
  background: var(--lime);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(var(--lime-rgb), 0.4), 0 0 18px rgba(var(--lime-rgb), 0.5);
}

.brand-logo-mark svg {
  width: 22px;
  height: 22px;
  color: #0A0A0A;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: -0.02em;
}

/* ── Brand hero ───────────────────────────────────────────── */
.brand-hero {
  position: relative;
  z-index: 1;
}

.brand-headline {
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 800;
  color: var(--text-on-dark);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}

.brand-headline em {
  font-style: normal;
  color: var(--lime);
  text-shadow: 0 0 24px rgba(var(--lime-rgb), 0.45);
}

.brand-subheadline {
  font-size: 16px;
  color: var(--text-muted-dark);
  line-height: 1.65;
  margin: 0;
}

/* ── Stats ────────────────────────────────────────────────── */
.brand-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-dark-border);
  border-radius: 16px;
  position: relative;
  z-index: 1;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--lime);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted-dark);
  margin-top: 4px;
  line-height: 1.3;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--panel-dark-border);
  flex-shrink: 0;
}

/* ============================================================
   FORM PANEL — columna derecha
   ============================================================ */
.form-panel {
  width: 50%;
  min-height: 100vh;
  background: var(--form-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

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

/* ── Form header ──────────────────────────────────────────── */
.form-header {
  margin-bottom: 32px;
}

.form-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.025em;
  margin: 0 0 8px;
}

.form-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Alert error ──────────────────────────────────────────── */
.alert-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #FCA5A5;
  margin-bottom: 24px;
}

.alert-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #EF4444;
}

/* ── Campos ───────────────────────────────────────────────── */
.field-group {
  margin-bottom: 20px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #D1D5DB;
  letter-spacing: 0.01em;
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #6B7280;
  pointer-events: none;
  flex-shrink: 0;
}

.field-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 44px;
  background: var(--form-input-bg);
  border: 1.5px solid var(--form-input-border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-dark);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: var(--form-input-focus);
  box-shadow: 0 0 0 3px rgba(var(--lime-rgb), 0.2);
  background: #202020;
}

.field-input.is-invalid {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-input::placeholder {
  color: #5A5A5A;
}

/* Password field: padding right extra para botón ojo */
.field-input[type="password"],
.field-input[type="text"] {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  line-height: 0;
}

.toggle-password:hover {
  color: var(--lime);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

.field-error {
  font-size: 12px;
  color: #F87171;
  margin: 6px 0 0;
}

/* ── Opciones (recordarme) ────────────────────────────────── */
.form-options {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #D1D5DB;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--form-input-border);
  border-radius: 5px;
  background: var(--form-input-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--lime);
  border-color: var(--lime);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #0A0A0A;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

/* ── Botón submit ─────────────────────────────────────────── */
.btn-login {
  width: 100%;
  height: 52px;
  background: var(--lime);
  color: #0A0A0A;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 18px rgba(var(--lime-rgb), 0.4);
  overflow: hidden;
}

.btn-login svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.btn-login:hover {
  background: var(--lime-dark);
  box-shadow: 0 0 28px rgba(var(--lime-rgb), 0.6);
  transform: translateY(-1px);
}

.btn-login:hover svg {
  transform: translateX(2px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 0 12px rgba(var(--lime-rgb), 0.4);
}

.btn-login:disabled {
  cursor: not-allowed;
  transform: none;
}

/* Estado loading */
.btn-login.is-loading span,
.btn-login.is-loading svg {
  opacity: 0;
}

.btn-login.is-loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(10, 10, 10, 0.35);
  border-top-color: #0A0A0A;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Form footer ──────────────────────────────────────────── */
.form-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.form-footer a {
  color: var(--lime);
  font-weight: 600;
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* ============================================================
   RESPONSIVE — mobile
   ============================================================ */
@media (max-width: 768px) {
  .login-wrapper {
    flex-direction: column;
  }

  .brand-panel {
    width: 100%;
    min-height: auto;
    padding: 24px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid var(--panel-dark-border);
  }

  .brand-hero,
  .brand-stats {
    display: none;
  }

  .brand-header {
    flex: 1;
  }

  .brand-name {
    font-size: 17px;
  }

  .brand-logo-mark {
    width: 34px;
    height: 34px;
  }

  .form-panel {
    width: 100%;
    min-height: auto;
    padding: 32px 20px 48px;
    align-items: flex-start;
  }

  .form-container {
    max-width: 100%;
  }

  .form-title {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .form-panel {
    padding: 24px 16px 40px;
  }
}
