/* ============================================================
   Pantallas de autenticación (login / registro)
   Paleta: verde esmeralda. Mobile-first, escala a split-screen
   en desktop (>=992px). Incluye formas decorativas CSS (sin fotos).
   ============================================================ */

:root {
  --color-primary: #059669;
  --color-primary-dark: #064E3B;
  --color-mint: #D1FAE5;
  --color-text: #1E293B;
  --color-bg: #F8FAFC;
  --color-error: #DC2626;
  --radius-lg: 18px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
}

.auth-body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Banner verde en MÓVIL (versión compacta del panel de marca)
   ============================================================ */
.auth-mobile-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 36px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-mobile-header .auth-shapes span {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.auth-mobile-header .auth-shapes span:nth-child(1) {
  width: 110px;
  height: 110px;
  top: -40px;
  left: -30px;
}

.auth-mobile-header .auth-shapes span:nth-child(2) {
  width: 70px;
  height: 70px;
  bottom: -30px;
  right: -10px;
  background: rgba(209, 250, 229, 0.18);
}

.auth-mobile-header .auth-shapes span:nth-child(3) {
  width: 40px;
  height: 40px;
  top: 10px;
  right: 30px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-mobile-header .auth-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-mobile-header .auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 12px;
}

.auth-mobile-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.auth-mobile-header p {
  font-size: 13.5px;
  color: var(--color-mint);
  margin: 0;
  max-width: 280px;
}

/* ============================================================
   Panel de marca en DESKTOP (solo visible >=992px)
   ============================================================ */
.auth-brand-panel {
  display: none;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 56px 48px;
}

/* Patrón sutil de puntos */
.auth-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
  z-index: 0;
}

/* Formas geométricas decorativas (blobs y círculos) */
.auth-brand-panel .auth-shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-brand-panel .auth-shapes span {
  position: absolute;
  display: block;
  filter: blur(0.5px);
}

.auth-brand-panel .auth-shapes span:nth-child(1) {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  top: -120px;
  right: -100px;
}

.auth-brand-panel .auth-shapes span:nth-child(2) {
  width: 220px;
  height: 220px;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  background: rgba(209, 250, 229, 0.12);
  bottom: -60px;
  left: -60px;
}

.auth-brand-panel .auth-shapes span:nth-child(3) {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  bottom: 18%;
  right: 12%;
}

.auth-brand-panel .auth-shapes span:nth-child(4) {
  width: 60px;
  height: 60px;
  border-radius: 40% 60% 60% 40% / 50% 50% 50% 50%;
  background: rgba(209, 250, 229, 0.15);
  top: 22%;
  left: 8%;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
}

.auth-brand-top .auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 24px;
}

.auth-brand-top h2 {
  font-weight: 700;
  font-size: 32px;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.auth-brand-top p {
  font-size: 16px;
  color: var(--color-mint);
  max-width: 340px;
  line-height: 1.6;
}

.auth-brand-bottom {
  position: relative;
  z-index: 1;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 20px;
}

/* ============================================================
   Panel del formulario
   ============================================================ */
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-panel-box {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.04), 0 16px 40px -12px rgba(6, 78, 59, 0.18);
  padding: 28px 24px;
}

.auth-panel-box h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--color-text);
}

.auth-panel-box .auth-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 22px;
}

/* --- Campos --- */
.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.auth-input-wrap {
  position: relative;
}

/* Ícono dentro del input (izquierda) */
.auth-input-wrap .auth-input-icon {
  position: absolute;
  top: 0;
  left: 0;
  height: 48px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-input-wrap.has-icon .auth-input {
  padding-left: 40px;
}

.auth-field.has-error .auth-input-icon,
.auth-field:focus-within .auth-input-icon {
  color: var(--color-primary);
}

.auth-field.has-error .auth-input-icon {
  color: var(--color-error);
}

.auth-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
  color: #94A3B8;
}

.auth-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.auth-field.has-error .auth-input {
  border-color: var(--color-error);
}

.auth-field.has-error .auth-input:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

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

.auth-error-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-error);
  margin-top: 6px;
}

.auth-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--color-error);
  font-size: 13.5px;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 18px;
}

/* Toggle mostrar/ocultar contraseña */
.auth-input-wrap.has-toggle .auth-input {
  padding-right: 44px;
}

.auth-toggle-pwd {
  position: absolute;
  top: 0;
  right: 0;
  height: 48px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #94A3B8;
  transition: color 0.15s ease;
}

.auth-toggle-pwd:hover {
  color: var(--color-primary);
}

.auth-toggle-pwd:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Medidor de fuerza de contraseña */
.auth-strength {
  margin-top: 8px;
}

.auth-strength-bar {
  height: 5px;
  border-radius: 4px;
  background: #E2E8F0;
  overflow: hidden;
}

.auth-strength-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: var(--color-error);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.auth-strength-label {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  display: block;
}

/* Botón principal */
.auth-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.15);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px rgba(6, 78, 59, 0.45);
}

.auth-btn:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 6px rgba(6, 78, 59, 0.3);
}

.auth-btn:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

.auth-btn[disabled] {
  opacity: 0.85;
  cursor: not-allowed;
  transform: none;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
  display: none;
}

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

.auth-footer-link {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  margin-top: 20px;
}

.auth-footer-link a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-footer-link a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* --- Desktop: split screen --- */
@media (min-width: 992px) {
  .auth-shell {
    flex-direction: row;
  }

  .auth-brand-panel {
    display: flex;
    flex: 1;
  }

  .auth-form-panel {
    flex: 1;
  }

  .auth-mobile-header {
    display: none;
  }

  .auth-card {
    max-width: 420px;
  }

  .auth-panel-box {
    padding: 40px;
  }
}
