/* ─── Auth Module — Split Card Login (Desarrollo Económico Iztapalapa Palette) ── */

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  padding: var(--spacing-xl);
}

/* ─── Card ────────────────────────────────────────── */
.auth-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 920px;
  min-height: 560px;
  background-color: var(--surface-color);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* ─── Branding (Left Column) ───────────────────────── */
.auth-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #691C32 0%, #4a1222 50%, #2d0b15 100%);
  color: var(--surface-color);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}

.auth-branding::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.auth-branding::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
}

.auth-branding-content {
  max-width: 320px;
  position: relative;
  z-index: 1;
}

/* Logo group */
.auth-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface-color);
}

.auth-logo-text {
  display: flex;
  flex-direction: column;
}

.auth-logo-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--surface-color);
  line-height: 1.2;
}

.auth-logo-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

/* Headline */
.auth-headline {
  font-family: var(--font-family-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--surface-color);
}

.auth-headline em {
  font-style: normal;
  color: #D4A0B0;
}

/* Subheadline */
.auth-subheadline {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 36px;
}

/* Feature list */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
}

.auth-feature-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface-color);
}

/* ─── Form Section (Right Column) ──────────────────── */
.auth-form-section {
  display: flex;
  flex-direction: column;
  padding: 36px 40px;
}

/* Top bar */
.auth-form-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.auth-back-link:hover {
  color: var(--brand-primary);
}

.auth-form-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Heading */
.auth-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.auth-heading em {
  font-style: normal;
  color: var(--brand-primary);
}

.auth-subheading {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

/* ── Tabs (Pill-style) ── */
.auth-tabs {
  display: flex;
  gap: 4px;
  background-color: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.5);
}

.auth-tab--active {
  color: var(--surface-color);
  background-color: var(--brand-primary);
}

.auth-tab--active:hover {
  color: var(--surface-color);
  background-color: var(--brand-primary-hover);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}

/* ── Panels ── */
.auth-panel {
  animation: authFadeIn 0.2s ease;
}

.auth-panel[hidden] {
  display: none;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form Groups ── */
.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form .form-label {
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 8px;
}

.auth-form .form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background-color: var(--surface-color);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.auth-form .form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(105, 28, 50, 0.1);
}

/* ── Password Toggle (inline "Mostrar") ── */
.auth-password-wrapper {
  position: relative;
}

.auth-password-wrapper .form-input {
  padding-right: 90px;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}

/* ── Checkbox ── */
.auth-remember {
  margin-bottom: 24px;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auth-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-checkbox-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  background-color: var(--surface-color);
  transition: all var(--transition-fast);
  position: relative;
}

.auth-checkbox:checked + .auth-checkbox-custom {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.auth-checkbox:checked + .auth-checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid var(--surface-color);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-checkbox:focus-visible + .auth-checkbox-custom {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
}

/* ── Submit Button ── */
.auth-submit {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  background-color: var(--brand-primary);
  color: var(--surface-color);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.auth-submit:hover {
  background-color: var(--brand-primary-hover);
  color: var(--surface-color);
}

.auth-submit:active {
  transform: scale(0.98);
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.auth-divider-dot {
  width: 6px;
  height: 6px;
  background-color: #cbd5e1;
  border-radius: 50%;
  margin: 0 12px;
}

/* ── Footer Text ── */
.auth-footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer-text a {
  font-weight: 600;
  color: var(--brand-primary);
}

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

/* ── Flash Messages ── */
.auth-flash-container {
  margin-bottom: 20px;
}

.auth-flash {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.auth-flash svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-flash--danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-flash--warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.auth-flash--success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-flash--info {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ── Validation Errors ── */
.form-input--error {
  border-color: #dc2626;
}

.form-input--error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 500;
}

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .auth-wrapper {
    padding: 0;
    align-items: stretch;
  }

  .auth-card {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-radius: 0;
  }

  .auth-branding {
    display: none;
  }

  .auth-form-section {
    padding: 32px 24px;
    justify-content: center;
  }

  .auth-heading {
    font-size: 1.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .auth-card {
    max-width: 780px;
  }

  .auth-branding {
    padding: 32px 28px;
  }

  .auth-branding-content {
    max-width: 260px;
  }

  .auth-headline {
    font-size: 1.625rem;
  }

  .auth-form-section {
    padding: 32px 28px;
  }
}
