/* ==========================================================================
   1. TOKENS DE PALETA REALES (CALIBRADOS CON TU FIGMA)
   ========================================================================== */
:root {
  --color-white-pure: #ffffff;
  /* Solo para la tarjeta del formulario */
  --color-brand-green: #415a36;
  /* Verde árbol (Títulos principales y botones) */
  --color-brand-green-hover: #324729;
  /* Background Boton Green */
  --color-btn-green: #4a6b3a;

  --color-text-main: #2d312a;
  /* Textos de inputs y etiquetas (Grafito oscuro) */
  --color-text-muted: #7a8276;
  --color-text-subtitle: #3d3530;
  /* Pestañas inactivas y enlaces secundarios */

  /* El alma de tu diseño: Fondo cálido/crema general de la pantalla */
  --color-bg-warm-canvas: #f5f4f0;
  /* Tono lino/arena suave de fondo */
  --color-bg-input-soft: #faf3e7;
  /* Fondo sutil para destacar los inputs (no blanco) */
  --color-border-subtle: #eae8df;
  /* Bordes de tarjetas y separadores */
  --color-border-input: #dcdad0;
  /* gradient color */
  --color-gradient: #94b26f;
  /* Contorno limpio de los campos */
}

/* ==========================================================================
   2. ANULACIÓN RADICAL DE DAISYUI / MODO OSCURO AUTOMÁTICO
   ========================================================================== */
body.controller-devise,
body.controller-devise main,
.auth-split-wrapper,
.auth-split-wrapper * {
  /* Forzamos a DaisyUI a usar nuestra paleta clara e ignorar los contrastes del sistema */
  --b1: 0 0% 100% !important;
  --bg-selector: var(--color-white-pure) !important;
  --n: 0 0% 100% !important;
  color: var(--color-text-main);
}

/* ==========================================================================
   3. DISTRIBUCIÓN DE PANELES CON EL FONDO CÁLIDO INTEGRADO
   ========================================================================== */
.auth-split-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-warm-canvas) !important;
  /* Todo el wrapper es cálido */
  box-sizing: border-box;
}

/* PANEL IZQUIERDO: Mantiene la calidez y el balance */
.auth-panel-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 800px;
  padding: 4rem;
  background-color: var(--color-bg-input-soft) !important;
  border-right: 1px solid var(--color-border-subtle) !important;

  .gradient-part {
    background: var(--color-gradient);
    background: linear-gradient(
      180deg,
      rgba(148, 178, 111, 1) 20%,
      rgba(148, 178, 111, 1) 0%
    );
  }
}

/* PANEL DERECHO: CORREGIDO - Ya no es blanco, es del mismo color cálido general */
.auth-panel-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: var(--color-bg-input-soft) !important;
}

/* ==========================================================================
   4. LA TARJETA DEL FORMULARIO (EL ÚNICO ELEMENTO BLANCO PURO)
   ========================================================================== */
.auth-bespoke-card {
  background-color: var(--color-white-pure) !important;
  /* Blanco destacado */
  border: 1px solid var(--color-border-subtle) !important;
  box-shadow: 0 30px 60px -15px rgba(45, 49, 42, 0.06) !important;
  /* Sombra suave orgánica */
  width: 100%;
  max-width: 440px;
  padding: 3.5rem 2.5rem;
  border-radius: 1.5rem !important;
  /* rounded-3xl de Figma */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Icono del árbol integrado */
.auth-tree-icon {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-bottom: 2rem !important;
  width: 100% !important;
  background: transparent !important;
}

.auth-tree-icon svg {
  color: var(--color-btn-green) !important;
  background: var(--color-bg-input-soft) !important;
}

.auth-bespoke-card h2 {
  display: none !important;
}

/* ==========================================================================
   5. NAVEGACIÓN POR PESTAÑAS INTERNAS (TABS)
   ========================================================================== */
.auth-tabs-nav {
  display: flex;
  justify-content: space-evenly;
  gap: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 0.5rem;
  width: 100%;
}

.auth-tab-item {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none !important;
  transition: color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.auth-tab-item:hover,
.auth-tab-item.active {
  color: var(--color-btn-green);
}

.auth-tab-item.active {
  font-weight: 600;
}

/* Línea indicadora verde debajo de la pestaña activa */
.auth-tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -0.6rem;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-brand-green);
  border-radius: 1px;
}

/* ==========================================================================
   6. LABELS E INPUTS CORREGIDOS (NO BLANCOS)
   ========================================================================== */
.auth-bespoke-card form {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.auth-bespoke-card .field,
.auth-bespoke-card .mb-4 {
  margin-bottom: 1.25rem !important;
  display: flex;
  flex-direction: column;
}

/* Estilo de los Labels */
.label-text-bespoke,
.auth-bespoke-card label {
  font-family: ui-sans-serif, system-ui, sans-serif !important;
  font-size: 0.875rem !important;
  color: var(--color-text-main) !important;
  margin-bottom: 0.5rem !important;
  text-align: left !important;
  display: block !important;
}

.input-pill,
.auth-bespoke-card input[type="text"],
.auth-bespoke-card input[type="email"],
.auth-bespoke-card input[type="password"],
.auth-bespoke-card select {
  width: 100% !important;
  height: 3.25rem !important;
  padding: 0 1.25rem !important;
  background-color: var(--color-bg-input-soft) !important;
  border: 1px solid var(--color-border-input) !important;
  border-radius: 9999px !important;
  font-family: ui-sans-serif, system-ui, sans-serif !important;
  font-size: 0.95rem !important;
  color: var(--color-text-main) !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
}

.input-pill:focus,
.auth-bespoke-card input:focus {
  border-color: var(--color-brand-green) !important;
  box-shadow: 0 0 0 4px rgba(65, 90, 54, 0.08) !important;
  background-color: var(--color-white-pure) !important;
  /* Se vuelve blanco solo al escribir */
}

/* Bloqueador definitivo de Autofill de Chrome (mantiene nuestro fondo crema soft) */
.auth-bespoke-card input:-webkit-autofill,
.auth-bespoke-card input:-webkit-autofill:hover,
.auth-bespoke-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text-main) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--color-bg-input-soft) inset !important;
  box-shadow: 0 0 0px 1000px var(--color-bg-input-soft) inset !important;
}

/* Checkbox "Recordarme" */
.auth-bespoke-card .field.checkbox,
.auth-bespoke-card .remember-me-container {
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.auth-bespoke-card input[type="checkbox"] {
  width: 1.2rem !important;
  height: 1.2rem !important;
  accent-color: var(--color-brand-green) !important;
  background-color: var(--color-bg-input-soft) !important;
  border: 1px solid var(--color-border-input) !important;
  cursor: pointer !important;
}

/* ==========================================================================
   7. BOTÓN PRINCIPAL DE ENVIÓ (VERDE MAESTRO)
   ========================================================================== */
.auth-bespoke-card .actions {
  margin-top: 1.5rem !important;
}

.btn-bespoke-green {
  background-color: var(--color-btn-green);
  color: white;
  border-radius: 9999px;
}

.auth-bespoke-card input[type="submit"],
.auth-bespoke-card .btn-submit-bespoke {
  width: 100% !important;
  height: 3.25rem !important;
  background-color: var(--color-brand-green) !important;
  border: none !important;
  border-radius: 9999px !important;
  color: var(--color-white-pure) !important;
  font-family: ui-sans-serif, system-ui, sans-serif !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.auth-bespoke-card input[type="submit"]:hover {
  background-color: var(--color-brand-green-hover) !important;
}

.auth-bespoke-card input[type="submit"]:active {
  transform: scale(0.98);
}

.auth-links-container {
  margin-top: 1.25rem !important;
  text-align: center !important;
}

.auth-links-container a {
  color: var(--color-text-muted) !important;
  font-size: 0.85rem !important;
  text-decoration: none !important;
}

.auth-links-container a:hover {
  color: var(--color-brand-green) !important;
}

/* ==========================================================================
   8. TEXTOS DE MARCA CORREGIDOS (LETRAS GRANDES VERDES)
   ========================================================================== */
.left-column-title {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif !important;
  font-size: 3.75rem !important;
  font-weight: 700 !important;
  color: var(--color-brand-green) !important;
  /* CORREGIDO: AHORA ES VERDE FIGMA */
  line-height: 1.15 !important;
  letter-spacing: -0.03em !important;
  margin-bottom: 1.5rem !important;
  text-align: left;
}

.left-column-subtitle {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 400 !important;
  color: var(--color-text-subtitle) !important;
  line-height: 1.6 !important;
  max-width: 460px;
  text-align: left;
}

/* ==========================================================================
   9. RESPONSIVE COMPLETO
   ========================================================================== */
@media (max-width: 1024px) {
  .auth-split-wrapper {
    flex-direction: column !important;
  }

  .auth-panel-left {
    padding: 5rem 2rem 2rem 2rem !important;
    text-align: center !important;
  }

  .left-column-title {
    font-size: 2.75rem !important;
    text-align: center !important;
  }

  .left-column-subtitle {
    text-align: center !important;
    margin: 0 auto !important;
  }

  .auth-panel-right {
    padding: 2rem 1rem 5rem 1rem !important;
  }

  .auth-bespoke-card {
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .label-text-bespoke,
  .auth-bespoke-card label {
    font-weight: 500 !important;
  }
}
