/* ——— Auth pages — BestComKZ ——— */

/* Background */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 45%, #f0f9ff 100%);
}

.auth-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.auth-bg__orb--1 {
  width: min(44rem, 100vw);
  height: min(44rem, 100vw);
  top: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, transparent 70%);
  animation: auth-orb-float 20s ease-in-out infinite;
}

.auth-bg__orb--2 {
  width: min(36rem, 90vw);
  height: min(36rem, 90vw);
  bottom: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.18) 0%, transparent 70%);
  animation: auth-orb-float 26s ease-in-out infinite reverse;
}

@keyframes auth-orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(2%, 4%) scale(1.05); }
  70% { transform: translate(-2%, 1%) scale(0.97); }
}

.auth-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 10%, transparent 70%);
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg__orb { animation: none !important; }
}

/* Logo link */
.auth-logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  outline: none;
  border-radius: 0.75rem;
  transition: opacity 0.2s;
}
.auth-logo-link:hover { opacity: 0.8; }
.auth-logo-link:focus-visible { outline: 2px solid #4f46e5; outline-offset: 4px; }

/* Card */
.auth-card {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 32px 64px -20px rgba(15, 23, 42, 0.14),
    0 4px 16px -4px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

.auth-card__inner {
  padding: 2rem 2rem;
}

@media (max-width: 480px) {
  .auth-card__inner { padding: 1.5rem 1.25rem; }
}

/* Icon wrap */
.auth-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

/* Form field */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
}

.auth-input {
  width: 100%;
  height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.875rem;
  font-family: inherit;
  color: #111827;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.auth-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-input::placeholder { color: #9ca3af; }

.auth-textarea {
  height: auto;
  min-height: 5.5rem;
  padding: 0.625rem 0.875rem;
  resize: vertical;
}

.auth-field-error {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 500;
}

/* Buttons */
.auth-btn-primary {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.875rem;
  padding: 0 1.5rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 55%, #7c3aed 100%);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  box-shadow:
    0 10px 24px -10px rgba(79, 70, 229, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s ease,
    opacity 0.15s ease;
  text-decoration: none;
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 32px -10px rgba(79, 70, 229, 0.55),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

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

.auth-btn-primary:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
}

.auth-btn-secondary {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.5rem;
  border-radius: 0.875rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-btn-secondary:hover {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4f46e5;
  transform: translateY(-1px);
}

.auth-btn-secondary:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn-primary,
  .auth-btn-secondary {
    transition: none !important;
    transform: none !important;
  }
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.auth-divider span {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Alerts */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border-radius: 0.875rem;
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
}

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

.auth-alert--info {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
}

/* Dealer registration specific */
.dealer-section-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
  padding-bottom: 0;
}

.dealer-section-legend__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.5);
}

.dealer-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .dealer-grid { grid-template-columns: 1fr 1fr; }
  .dealer-grid .sm\:col-span-2 { grid-column: span 2; }
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

fieldset + fieldset {
  border-top: 1px solid #f3f4f6;
  padding-top: 2rem;
}
