/* =========================================================
   FUENTES.COM — Login Page Styles
   Split-screen layout: brand panel left / form panel right
   Fully responsive + dark mode support
   ========================================================= */

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

:root {
  --brand-bg: #0d1b2a;
  --brand-accent: #2563eb;
  --brand-accent-2: #60a5fa;
  --form-bg: #ffffff;
  --form-text: #0f172a;
  --form-muted: #64748b;
  --form-border: #e2e8f0;
  --form-input-bg: #f8fafc;
  --form-focus: #2563eb;
  --btn-primary: #2563eb;
  --btn-primary-hover: #1d4ed8;
  --btn-secondary-border: #2563eb;
  --btn-secondary-text: #2563eb;
  --btn-secondary-hover-bg: #2563eb;
  --btn-secondary-hover-text: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-form: 0 0 0 1px rgba(0,0,0,0.06), 0 4px 24px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  background: var(--brand-bg);
  color: var(--form-text);
  overflow-x: hidden;
}

/* =========================================================
   BRAND PANEL (izquierdo)
   ========================================================= */

.brand-panel {
  position: relative;
  width: 42%;
  min-height: 100vh;
  background: linear-gradient(145deg, #0d1b2a 0%, #0f2647 55%, #0a1a38 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  flex-shrink: 0;
}

/* Canvas animado de fondo */
#brandCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
  pointer-events: none;
}

/* Línea decorativa vertical en el borde derecho */
.brand-panel::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(37, 99, 235, 0.4) 20%,
    rgba(96, 165, 250, 0.6) 50%,
    rgba(37, 99, 235, 0.4) 80%,
    transparent 100%
  );
}

.brand-content {
  position: relative;
  z-index: 2;
  padding: 56px 48px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Logo SVG */
.brand-logo-wrap {
  margin-bottom: 28px;
}

.brand-svg-logo {
  width: 56px;
  height: 56px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(37, 99, 235, 0.5));
}

/* Nombre de marca */
.brand-name {
  font-size: 2.6rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 12px;
}

.brand-dot {
  color: var(--brand-accent-2);
  font-weight: 700;
}

/* Tagline */
.brand-tagline {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 40px;
}

/* Separador */
.brand-sep {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-2));
  border-radius: 99px;
  margin-bottom: 32px;
}

/* Lista de características */
.brand-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.4;
}

.feat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 10px;
  color: var(--brand-accent-2);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.brand-features li:hover .feat-icon {
  background: rgba(37, 99, 235, 0.35);
  border-color: rgba(96, 165, 250, 0.5);
}

/* Copyright */
.brand-copyright {
  position: relative;
  z-index: 2;
  padding: 24px 48px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
}

/* =========================================================
   FORM PANEL (derecho)
   ========================================================= */

.form-panel {
  flex: 1;
  background: var(--form-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  transition: background var(--transition), color var(--transition);
}

.form-container {
  width: 100%;
  max-width: 420px;
  position: relative;
}

/* Controles superiores (modo oscuro) */
.top-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--form-input-bg);
  border: 1px solid var(--form-border);
  border-radius: 50%;
  font-size: 0.9rem;
  color: var(--form-muted);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}

.theme-btn:hover {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: #ffffff;
  transform: rotate(12deg);
}

/* Logo móvil (solo visible < 768px) */
.mobile-brand {
  display: none;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.mobile-brand svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.m-brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--form-text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.m-brand-name span {
  color: var(--brand-accent);
}

.m-brand-sub {
  font-size: 0.75rem;
  color: var(--form-muted);
  margin-top: 2px;
}

/* Encabezado del formulario */
.form-head {
  margin-bottom: 32px;
}

.form-head h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--form-text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.form-head p {
  font-size: 0.9rem;
  color: var(--form-muted);
  line-height: 1.5;
}

/* =========================================================
   CAMPOS DEL FORMULARIO
   ========================================================= */

.f-group {
  margin-bottom: 20px;
}

.f-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--form-text);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

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

.f-ico {
  position: absolute;
  left: 14px;
  font-size: 0.85rem;
  color: var(--form-muted);
  pointer-events: none;
  z-index: 1;
  transition: color var(--transition);
}

.f-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 40px;
  background: var(--form-input-bg);
  border: 1.5px solid var(--form-border);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--form-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
}

.f-wrap input::placeholder {
  color: #b0bec5;
}

.f-wrap input:focus {
  border-color: var(--form-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.f-wrap input:focus + .f-ico,
.f-wrap:focus-within .f-ico {
  color: var(--form-focus);
}

/* Botón ojo contraseña */
.f-eye {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--form-muted);
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  outline: none;
}

.f-eye:hover {
  color: var(--form-focus);
  background: rgba(37, 99, 235, 0.08);
}

/* =========================================================
   OPCIONES (recordar / olvidaste)
   ========================================================= */

.form-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}

/* Checkbox personalizado */
.cb-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--form-muted);
  user-select: none;
}

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

.cb-box {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--form-border);
  border-radius: 5px;
  background: var(--form-input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.cb-label input:checked ~ .cb-box {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
}

.cb-label input:checked ~ .cb-box::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.terms-check {
  margin-bottom: 18px;
}
.terms-check .cb-label span { font-size: 0.82rem; }
.terms-link {
  color: var(--btn-primary);
  font-weight: 600;
  transition: color 0.2s ease;
}
.terms-link:hover { color: var(--btn-hover); text-decoration: underline; }
.terms-error {
  display: none;
  font-size: 0.78rem;
  color: #ef4444;
  margin-top: 6px;
  padding-left: 26px;
}
.terms-error.visible { display: block; }
.terms-check.shake {
  animation: shakeTerms 0.4s ease;
}
@keyframes shakeTerms {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.link-forgot {
  font-size: 0.83rem;
  color: var(--btn-primary);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--transition);
}

.link-forgot:hover {
  color: var(--btn-primary-hover);
  text-decoration: underline;
}

/* =========================================================
   CLOUDFLARE TURNSTILE
   ========================================================= */

.cf-turnstile {
  display: flex !important;
  justify-content: center !important;
  margin: 4px auto 20px !important;
  max-width: 100% !important;
}

@media (max-width: 480px) {
  .cf-turnstile {
    transform: scale(0.88);
    transform-origin: center;
    margin: 2px auto 16px !important;
  }
}

@media (max-width: 360px) {
  .cf-turnstile {
    transform: scale(0.75);
    transform-origin: center;
  }
}

.cf-turnstile iframe {
  border-radius: 8px !important;
  max-width: 100% !important;
}

/* =========================================================
   BOTONES
   ========================================================= */

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

/* Botón principal: Iniciar Sesión */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--btn-primary) 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: all var(--transition);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn-login:hover::before {
  background: rgba(255,255,255,0.07);
}

.btn-login:hover {
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}

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

/* Botón secundario: Adquirir Acceso */
.btn-access {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 48px;
  background: transparent;
  color: var(--btn-secondary-text);
  font-size: 0.92rem;
  font-weight: 500;
  font-family: var(--font);
  border: 1.5px solid var(--btn-secondary-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  outline: none;
}

.btn-access:hover {
  background: var(--btn-secondary-hover-bg);
  color: var(--btn-secondary-hover-text);
  border-color: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

.btn-access:active {
  transform: translateY(0);
}

/* =========================================================
   PIE DEL FORMULARIO
   ========================================================= */

.form-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--form-muted);
}

.form-foot a {
  color: var(--btn-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.form-foot a:hover {
  color: var(--btn-primary-hover);
  text-decoration: underline;
}

/* =========================================================
   NOTIFICACIONES DE LOGIN — Inline profesional
   ========================================================= */

.login-notification {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.84rem;
  font-family: var(--font);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.login-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.login-notification .notif-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 0.65rem;
}

.login-notification .notif-content {
  flex: 1;
  min-width: 0;
}

.login-notification .notif-title {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.login-notification .notif-message {
  font-weight: 400;
  font-size: 0.82rem;
  opacity: 0.85;
}

.login-notification .notif-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  margin: -2px -4px 0 0;
  border-radius: 4px;
  font-size: 0.7rem;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.login-notification .notif-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

/* Error */
.login-notification-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.login-notification-error .notif-icon {
  background: #dc2626;
  color: #ffffff;
}

.login-notification-error .notif-close {
  color: #991b1b;
}

/* Warning */
.login-notification-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.login-notification-warning .notif-icon {
  background: #d97706;
  color: #ffffff;
}

.login-notification-warning .notif-close {
  color: #92400e;
}

/* Success */
.login-notification-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.login-notification-success .notif-icon {
  background: #16a34a;
  color: #ffffff;
}

.login-notification-success .notif-close {
  color: #166534;
}

/* Info */
.login-notification-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.login-notification-info .notif-icon {
  background: #2563eb;
  color: #ffffff;
}

.login-notification-info .notif-close {
  color: #1e40af;
}

/* Dark mode notifications */
body.dark-mode .login-notification-error {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #fca5a5;
}

body.dark-mode .login-notification-error .notif-close { color: #fca5a5; }

body.dark-mode .login-notification-warning {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.25);
  color: #fcd34d;
}

body.dark-mode .login-notification-warning .notif-close { color: #fcd34d; }

body.dark-mode .login-notification-success {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
  color: #86efac;
}

body.dark-mode .login-notification-success .notif-close { color: #86efac; }

body.dark-mode .login-notification-info {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

body.dark-mode .login-notification-info .notif-close { color: #93c5fd; }

body.dark-mode .login-notification .notif-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   DARK MODE
   ========================================================= */

body.dark-mode {
  background: #0d1b2a;
}

body.dark-mode .form-panel {
  background: #111827;
}

body.dark-mode .form-head h2,
body.dark-mode .m-brand-name,
body.dark-mode .f-label {
  color: #f1f5f9;
}

body.dark-mode .form-head p,
body.dark-mode .form-muted,
body.dark-mode .form-foot,
body.dark-mode .cb-label,
body.dark-mode .form-muted {
  color: #94a3b8;
}

body.dark-mode .f-wrap input {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-mode .f-wrap input::placeholder {
  color: #4b5563;
}

body.dark-mode .f-wrap input:focus {
  background: #1e293b;
  border-color: var(--form-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.dark-mode .f-ico {
  color: #64748b;
}

body.dark-mode .f-wrap:focus-within .f-ico {
  color: var(--form-focus);
}

body.dark-mode .f-eye {
  color: #64748b;
}

body.dark-mode .f-eye:hover {
  color: var(--form-focus);
  background: rgba(37, 99, 235, 0.15);
}

body.dark-mode .cb-box {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .theme-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .theme-btn:hover {
  background: var(--btn-primary);
  border-color: var(--btn-primary);
  color: #ffffff;
}

body.dark-mode .btn-access {
  color: var(--brand-accent-2);
  border-color: rgba(96, 165, 250, 0.4);
}

body.dark-mode .btn-access:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: var(--brand-accent-2);
  color: var(--brand-accent-2);
}

body.dark-mode .m-brand-sub {
  color: #64748b;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */

/* Tablets: ajustar ancho del panel */
@media (max-width: 1100px) {
  .brand-panel {
    width: 38%;
  }

  .brand-name {
    font-size: 2.1rem;
  }

  .brand-content {
    padding: 48px 36px;
  }

  .brand-copyright {
    padding: 20px 36px;
  }
}

/* Tablets pequeñas: ocultar panel brand */
@media (max-width: 768px) {
  body {
    background: linear-gradient(145deg, #0d1b2a 0%, #0f2647 100%);
  }

  .brand-panel {
    display: none;
  }

  .form-panel {
    background: transparent;
    padding: 24px 16px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .form-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    max-width: 440px;
    width: 100%;
  }

  .mobile-brand {
    display: flex;
  }

  .top-controls {
    margin-bottom: 24px;
  }

  .form-head {
    margin-bottom: 24px;
  }

  .form-head h2 {
    font-size: 1.45rem;
  }

  body.dark-mode .form-container {
    background: #1e293b;
  }
}

/* Móviles */
@media (max-width: 480px) {
  .form-panel {
    padding: 16px 12px;
    padding-top: 28px;
    align-items: flex-start;
  }

  .form-container {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .form-head h2 {
    font-size: 1.3rem;
  }

  .f-wrap input {
    height: 46px;
    font-size: 0.9rem;
  }

  .btn-login,
  .btn-access {
    height: 46px;
    font-size: 0.9rem;
  }

  .login-notification {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .login-notification .notif-title {
    font-size: 0.8rem;
  }

  .login-notification .notif-message {
    font-size: 0.8rem;
  }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
  .form-container {
    padding: 20px 16px;
    border-radius: 14px;
  }

  .form-head h2 {
    font-size: 1.15rem;
  }

  .mobile-brand svg {
    width: 40px;
    height: 40px;
  }

  .m-brand-name {
    font-size: 1.15rem;
  }
}

/* =========================================================
   CANVAS ANIMADO — Script inline para el panel brand
   ========================================================= */
