/* ============================================================
   Vene Advisers LLC — auth.css
   Diseño de Inicio de Sesión y Registro
   ============================================================ */

/* ---------- VARIABLES (Consistentes con el sitio principal) ---------- */
:root {
  --blue-main: #004aad;
  --blue-night: #001b43;
  --carbon: #1c2533;
  --steel-gray: #8896aa;
  --white: #ffffff;
  --off-white: #f4f6fb;
  --gold-accent: #c9a84c;

  --font-title: 'Bree Serif', Georgia, serif;
  --font-body: 'Lora', 'DejaVu Serif', Georgia, serif;

  --shadow-sm: 0 2px 8px rgba(0, 27, 67, .10);
  --shadow-md: 0 6px 24px rgba(0, 27, 67, .16);
  --shadow-lg: 0 16px 48px rgba(0, 27, 67, .22);

  --radius: 12px;
  --transition: .5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-smooth: .4s ease;
}

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

body {
  font-family: var(--font-body);
  color: var(--carbon);
  background: var(--azul-pastel);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ---------- BACKGROUND DECORATIVO ---------- */
.auth-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, #004aad 0%, #002870 100%);
}

.auth-bg-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

/* ---------- WRAPPER & CONTAINER ---------- */
.auth-wrapper {
  width: 100%;
  max-width: 1000px;
  padding: 1.5rem;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  min-height: 650px;
  position: relative;
  overflow: hidden;
}

/* ---------- INFO PANEL (DESKTOP) ---------- */
.auth-info-panel {
  flex: 1;
  background: linear-gradient(135deg, #004aad 0%, var(--blue-night) 100%);
  color: var(--white);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: var(--transition-smooth);
  z-index: 2;
}

.auth-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 2rem;
}

.auth-logo-img {
  width: 190px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.auth-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--blue-main), #0062e0);
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-logo-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.auth-logo-name {
  display: block;
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--white);
  line-height: 1;
}

.auth-logo-tagline {
  font-size: .65rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-info-text {
  display: none;
  animation: slideInLeft 0.5s ease-out;
}

.auth-info-text.active {
  display: block;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.auth-info-text h2 {
  font-family: var(--font-title);
  font-size: 2.2rem;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}

.auth-info-text p {
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ---------- FORMS PANEL ---------- */
.auth-forms-panel {
  flex: 1.2;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background: var(--off-white);
}

.auth-form-box {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.auth-form-box.active {
  display: block;
}

.auth-form-header {
  margin-bottom: 2rem;
}

.auth-form-header h1 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--blue-night);
  margin-bottom: .5rem;
}

.auth-form-header p {
  color: var(--steel-gray);
  font-size: .95rem;
}

/* ---------- FORM ELEMENTS ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-form label {
  font-size: .85rem;
  font-weight: 700;
  color: var(--carbon);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--steel-gray);
  transition: var(--transition-smooth);
}

.auth-form input {
  width: 100%;
  padding: .85rem 3.5rem .85rem 2.8rem;
  border: 1.5px solid rgba(0, 27, 67, 0.1);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: .95rem;
  outline: none;
  transition: all var(--transition-smooth);
}

.auth-form input:focus {
  border-color: var(--blue-main);
  box-shadow: 0 0 0 4px rgba(0, 27, 67, 0.1);
}

.auth-form input:focus+i {
  color: var(--blue-main);
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--steel-gray);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-smooth);
  z-index: 5;
}

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

.password-toggle i {
  font-size: 1.1rem;
}

.password-hint {
  font-size: .75rem;
  color: var(--steel-gray);
  margin-top: .25rem;
}

.password-invalid .input-icon-wrapper {
  animation: shakeError 0.4s ease-out;
}

.password-invalid input {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.password-invalid .password-hint {
  color: #dc2626;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Checkbox Custom */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 1.75rem;
  cursor: pointer;
  font-size: .85rem !important;
  font-weight: 400 !important;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--azul-pastel);
  border: 1.5px solid rgba(0, 27, 67, 0.1);
  border-radius: 4px;
}

.checkbox-container:hover input~.checkmark {
  background-color: #eee;
}

.checkbox-container input:checked~.checkmark {
  background-color: var(--blue-main);
  border-color: var(--blue-main);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked~.checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Links */
.forgot-link {
  font-size: .8rem;
  color: var(--blue-main);
  font-weight: 600;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* ---------- BUTTONS ---------- */
.btn {
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: none;
}

.btn-primary {
  background: var(--blue-main);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 27, 67, 0.25);
}

.btn-primary:hover {
  background: var(--blue-main);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 27, 67, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-outline-white {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: var(--white);
  font-size: .9rem;
}

.btn-outline-white:hover {
  background: var(--white);
  color: var(--blue-main);
  border-color: var(--white);
}

.btn-social {
  background: var(--white);
  border: 1.5px solid rgba(0, 27, 67, 0.1);
  padding: .6rem;
  width: 100%;
}

.btn-social img {
  width: 24px;
}

.btn-social:hover {
  background: var(--azul-pastel);
  border-color: rgba(0, 27, 67, 0.2);
}

/* ---------- SEPARATORS ---------- */
.auth-separator {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  color: var(--steel-gray);
  font-size: .8rem;
}

.auth-separator::before,
.auth-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(0, 27, 67, 0.1);
}

.auth-separator span {
  padding: 0 1rem;
}

.social-auth {
  display: flex;
  gap: 1rem;
}

/* ---------- SWITCH MOBILE ---------- */
.auth-switch-mobile {
  display: none;
  /* Desktop */
  text-align: center;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--steel-gray);
}

.auth-switch-mobile a {
  color: var(--blue-main);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- FORGOT PASSWORD SPECIAL ---------- */
.back-to-login {
  background: none;
  border: none;
  color: var(--blue-main);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
  padding: 0;
  font-size: .9rem;
}

/* ---------- FOOTER ---------- */
.auth-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: .85rem;
}

.footer-links {
  margin-top: .5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--white);
}

/* -- Developer credit dropdown -- */
.auth-dev {
  position: relative;
  margin-top: 1.25rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  text-align: center;
}

.auth-dev-text {
  position: relative;
  font-size: .75rem;
  color: rgba(255, 255, 255, .3);
}

.auth-dev-toggle {
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: color var(--transition-smooth);
  white-space: nowrap;
}

.auth-dev-toggle:hover {
  color: var(--white);
}

.auth-dev-toggle i {
  font-size: .6rem;
  margin-left: .25rem;
  transition: transform var(--transition-smooth);
  display: inline-block;
}

.auth-dev-toggle.open i {
  transform: rotate(180deg);
}

.auth-dev-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0a1e3d;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: .4rem 0;
  min-width: 170px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
  z-index: 100;
}

.auth-dev-menu.show {
  display: block;
}

.auth-dev-menu-header {
  padding: .5rem .85rem .4rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: .15rem;
  text-align: center;
  font-family: var(--font-title);
  letter-spacing: .03em;
}

.auth-dev-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  font-size: .78rem;
  color: rgba(255, 255, 255, .5);
  text-decoration: none;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

.auth-dev-link:hover {
  background: rgba(255, 255, 255, .05);
  color: var(--white);
}

.auth-dev-link i {
  width: 14px;
  text-align: center;
  font-size: .7rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .auth-info-panel {
    display: none;
  }

  .auth-container {
    min-height: auto;
  }

  .auth-switch-mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  .auth-forms-panel {
    padding: 2rem 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .auth-wrapper {
    padding: 1rem;
  }
}

/* ── Ahora usa modals.css (.va-modal-backdrop) ── */
/* Login Success específicos conservados abajo */

/* ── LOGIN ERROR MESSAGE ── */
.login-error-msg {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #dc2626;
  margin-top: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-radius: 8px;
  animation: shakeError 0.4s ease-out;
}

.login-error-msg.active {
  display: flex;
}

.login-error-msg i {
  font-size: 0.9rem;
  flex-shrink: 0;
}

@keyframes shakeError {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

/* ---------- ANIMATION FOR SWITCHING ---------- */
.auth-container.switching-to-register .auth-info-panel {
  transform: translateX(120%);
  /* Move info panel to the right if we were doing a full swap */
  /* For this design, we'll just toggle visibility of elements as it's cleaner for different form */ 
}

/* ── Términos y login-success ahora usan modals.css ──
   Solo mantenemos estilos específicos del login-success card
   que no están en el sistema unificado */

/* Login Success Card — específico por el icon bounce + loader */
.login-success-card {
  background: var(--white);
  border-radius: 24px;
  padding: 3rem 4rem;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 27, 67, 0.35);
  animation: cardPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 420px;
  width: 90%;
  overflow: hidden;
  position: relative;
}

@keyframes cardPopIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.login-success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  animation: iconBounce 0.6s ease-out 0.3s both;
}

@keyframes iconBounce {
  0%   { transform: scale(0); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.login-success-card h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  color: var(--blue-night);
  margin-bottom: 0.5rem;
}

.login-success-card p {
  font-size: 0.95rem;
  color: var(--steel-gray);
  margin-bottom: 1.5rem;
}

.login-success-loader {
  height: 4px;
  background: rgba(0, 74, 173, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.login-success-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--blue-main), var(--gold-accent));
  border-radius: 4px;
  animation: loaderProgress 2s ease-in-out forwards;
}
@keyframes loaderProgress {
  from { width: 0; }
  to   { width: 100%; }
}
