:root {
  --sand:       #F8FAFC;
  --white:      #FFFFFF;
  --dark-bg:    #0F172A;
  --dark-card:  #1E293B;
  --stone:      #E2E8F0;
  --stone-dark: #CBD5E1;
  --text-main:  #0F172A;
  --text-muted: #64748B;
  --emerald:    #1EB08B;
  --emerald-dark: #168D6F;
  --emerald-light: rgba(30, 176, 139, 0.08);
  --error:      #EF4444;
  --radius-card: 20px;
  --transition-apple: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--white);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

/* =========================================================
   SPLIT-SCREEN LAYOUT
   ========================================================= */
.split-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 100vh;
  width: 100vw;
}

/* =========================================================
   LADO IZQUIERDO: SHOWCASE VISUAL & PROPUESTA DE VALOR
   ========================================================= */
.showcase-pane {
  position: relative;
  background: linear-gradient(145deg, #042f2e 0%, #0f172a 60%, #064e3b 100%);
  color: #FFFFFF;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.showcase-bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(30, 176, 139, 0.25) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(15, 118, 110, 0.2) 0%, transparent 60%);
  opacity: 0.8;
  pointer-events: none;
}

.showcase-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  gap: 36px;
}

.showcase-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.showcase-logo-icon {
  height: 44px;
  width: 44px;
  object-fit: contain;
}

.showcase-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFFFFF;
}

.showcase-logo-text span {
  color: var(--emerald);
}

.showcase-hero {
  max-width: 540px;
}

.showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 176, 139, 0.15);
  border: 1px solid rgba(30, 176, 139, 0.4);
  color: #5EEAD4;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.showcase-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  color: #FFFFFF;
}

.showcase-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #CBD5E1;
}

.showcase-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}

.showcase-feat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, background 0.2s;
}

.showcase-feat-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(30, 176, 139, 0.2);
  color: #5EEAD4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.showcase-feat-card h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.showcase-feat-card p {
  font-size: 0.84rem;
  color: #94A3B8;
  line-height: 1.4;
}

.showcase-footer {
  padding-top: 16px;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #94A3B8;
  font-weight: 500;
}

.trust-badge i {
  color: var(--emerald);
  font-size: 1.1rem;
}

/* =========================================================
   LADO DERECHO: FORMULARIO Y ACCIONES
   ========================================================= */
.form-pane {
  background: var(--white);
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.form-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.2s;
}

.back-home-link:hover {
  color: var(--emerald);
}

.lang-toggle-pill {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #F1F5F9;
  border: 1px solid var(--stone);
  border-radius: 100px;
  padding: 3px;
}

.lang-toggle-pill button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.lang-toggle-pill button.active {
  background: var(--emerald);
  color: #FFFFFF;
  font-weight: 700;
}

.form-card-container {
  width: 100%;
  max-width: 440px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.mobile-logo-icon {
  height: 38px;
  width: 38px;
  object-fit: contain;
}

.mobile-logo-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.login-header {
  margin-bottom: 24px;
}

.login-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-header p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Píldora sutil de Plan Seleccionado */
.plan-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(30, 176, 139, 0.12);
  border: 1px solid rgba(30, 176, 139, 0.35);
  color: #0F766E;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  animation: fadeInDown 0.3s ease;
}

.plan-pill i {
  color: var(--emerald);
  font-size: 1rem;
}

/* Formulario Unificado Limpio */
.auth-form-clean {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.success-banner {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #065F46;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.success-banner i {
  font-size: 1.15rem;
  color: #059669;
}

/* Botón Oficial de Google */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 50px;
  border-radius: 12px;
  border: 1.5px solid var(--stone-dark);
  background: #FFFFFF;
  color: #1E293B;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition-apple);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  cursor: pointer;
}

.btn-google:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.google-svg {
  flex-shrink: 0;
}

/* Divisor */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  text-align: center;
  color: #94A3B8;
  font-size: 0.82rem;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--stone);
}

.auth-divider span {
  padding: 0 14px;
}

/* Formularios */
.form-group {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.mb-20 {
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

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

.link-forgot {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--emerald);
  text-decoration: none;
  transition: color 0.2s;
}

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

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

.input-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 1.15rem;
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border-radius: 12px;
  border: 1.5px solid var(--stone);
  background: var(--sand);
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-apple);
}

.form-control:focus {
  border-color: var(--emerald);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(30, 176, 139, 0.12);
}

.form-control-pr {
  padding-right: 44px;
}

.password-toggle-icon {
  left: auto !important;
  right: 14px !important;
  cursor: pointer;
  color: #94A3B8 !important;
  transition: color 0.2s;
}

.password-toggle-icon:hover {
  color: var(--text-main) !important;
}

.btn-submit {
  width: 100%;
  height: 50px;
  border-radius: 12px;
  border: none;
  background: var(--emerald);
  color: #FFFFFF;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-apple);
  box-shadow: 0 4px 14px rgba(30, 176, 139, 0.25);
}

.btn-submit:hover {
  background: var(--emerald-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 176, 139, 0.35);
}

.register-prompt {
  margin-top: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-register {
  color: var(--emerald);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}

.link-register:hover {
  text-decoration: underline;
  color: var(--emerald-dark);
}

.security-footer-note {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #94A3B8;
}

.security-footer-note i {
  color: var(--emerald);
  font-size: 0.95rem;
}

.error-banner {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #991B1B;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
}

/* Casilla de aceptación de Términos: solo aparece al crear cuenta. */
.terms-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748B;
  font-weight: 400;
  cursor: pointer;
}
.terms-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #1EB08B;
  cursor: pointer;
}
.terms-consent-label a {
  color: #1EB08B;
  font-weight: 600;
  text-decoration: underline;
}

/* Letra pequeña bajo el selector de plan del alta. */
.plan-choice-note {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748B;
}

/* Aviso de "la contraseña llega por correo": ocupa el sitio que tenía el campo
   de contraseña al crear cuenta, para que el formulario no parezca incompleto.
   login.js lo pone en display:flex. */
.register-pass-note {
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748B;
}
.register-pass-note i {
  color: #1EB08B;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* Mismo hueco del banner de error, en verde, para confirmar el alta. */
.error-banner.is-notice {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #065F46;
}

.success-banner {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #166534;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
}

/* =========================================================
   MODAL DE RECUPERACIÓN
   ========================================================= */
.recovery-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.recovery-modal-box {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--stone);
  animation: modalScale 0.25s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.recovery-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.recovery-modal-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.recovery-modal-close-btn {
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s;
}

.recovery-modal-close-btn:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.mt-20 { margin-top: 20px; }
.mb-15 { margin-bottom: 15px; }

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
.pf-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pf-toast {
  background: #FFFFFF;
  border: 1px solid var(--stone);
  border-left: 4px solid var(--emerald);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.pf-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.pf-toast.hide {
  opacity: 0;
  transform: translateY(-12px);
}

.pf-toast.error {
  border-left-color: var(--error);
}

/* =========================================================
   RESPONSIVE DESIGN (MOBILE / TABLET)
   ========================================================= */
@media (max-width: 960px) {
  .split-layout {
    grid-template-columns: 1fr;
  }
  .showcase-pane {
    display: none;
  }
  .form-pane {
    padding: 32px 24px;
    min-height: 100vh;
  }
  .mobile-brand {
    display: flex;
  }
}

/* =========================================================
   SELECTOR DE MODO (INICIAR SESIÓN / CREAR CUENTA)
   ========================================================= */
.auth-mode-toggle {
  display: flex;
  background-color: #F1F5F9;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.mode-tab-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.mode-tab-btn:hover {
  color: #0F172A;
}

.mode-tab-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}


