/* ============================================
   ExpertAuto-BG — Modern Auth Page Design
   Glassmorphism + Animated Mesh Gradient
   + Floating Particles + Micro-interactions
   ============================================ */

/* ===== Page background — pure white ===== */
body[data-page="auth"] {
  background: #ffffff;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body[data-page="auth"] main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-page-bg {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;  /* override marketing.css purple gradient */
  padding: 0 !important;
}

/* Mesh blobs hidden (clean white background) */
.auth-mesh,
.auth-mesh__blob,
.auth-particles,
.auth-particle {
  display: none !important;
}

@keyframes meshFloat1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 100px) scale(0.95); }
}
@keyframes meshFloat2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-100px, 40px) scale(1.15); }
}
@keyframes meshFloat3 {
  0%,100% { transform: translate(0,0) scale(1); }
  40% { transform: translate(60px, -80px) scale(1.05); }
  80% { transform: translate(-50px, -40px) scale(0.9); }
}
@keyframes meshFloat4 {
  0%,100% { transform: translate(0,0) scale(1) rotate(0deg); }
  50% { transform: translate(120px, -60px) scale(1.2) rotate(180deg); }
}

/* Very subtle grid (almost invisible) — engineering hint only */
.auth-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* ===== Floating particles ===== */
.auth-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.auth-particle {
  position: absolute;
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 50%;
  left: var(--x, 50%);
  bottom: -20px;
  background: radial-gradient(circle, rgba(114, 67, 242, 0.35) 0%, rgba(114, 67, 242, 0) 70%);
  animation: particleFloat var(--duration, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  50% { transform: translateY(-50vh) translateX(30px); }
  90% { opacity: 0.6; }
  100% {
    transform: translateY(-110vh) translateX(60px);
    opacity: 0;
  }
}

/* ===== Glassmorphism Card ===== */
.auth-glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 24px;
  padding: 44px 40px;
  max-width: 460px;
  width: 100%;
  position: relative;
  z-index: 2;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Subtle gradient glow on hover (gray) */
.auth-glass-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(75, 85, 99, 0.15), rgba(31, 41, 55, 0.15), rgba(107, 114, 128, 0.15));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s;
  filter: blur(20px);
}
.auth-glass-card:hover::before { opacity: 0.6; }

/* ===== Logo — clean, preserves aspect ratio ===== */
.auth-logo-link {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo-link a {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-logo-link img {
  height: 64px;
  width: auto;       /* preserve natural aspect ratio */
  max-width: 100%;
  display: block;
  object-fit: contain;
}
.auth-logo-link a:hover { transform: scale(1.05); }

/* ===== Headings ===== */
.auth-glass-card h2 {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px !important;
  font-family: var(--font-heading, 'Montserrat', sans-serif);
  color: #1f2937;
  background: linear-gradient(135deg, #1f2937, #4b5563);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Social buttons (Google / Apple) ===== */
.auth-glass-card .social-btn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.auth-glass-card .social-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
  background: #fff;
}
.auth-glass-card .social-btn:active { transform: translateY(0); }
.auth-glass-card .social-btn svg { width: 18px; height: 18px; }
.auth-glass-card .social-btn--apple {
  background: #000;
  color: #fff;
  border-color: #000;
}
.auth-glass-card .social-btn--apple:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
}

/* ===== Divider ===== */
.auth-glass-card .auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 !important;
  color: #9ca3af;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.auth-glass-card .auth-divider::before,
.auth-glass-card .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12), transparent);
}

/* ===== Form groups ===== */
.auth-glass-card .form-group {
  margin-bottom: 16px;
  position: relative;
  animation: formGroupIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.auth-glass-card .form-group:nth-child(1) { animation-delay: 0.05s; }
.auth-glass-card .form-group:nth-child(2) { animation-delay: 0.10s; }
.auth-glass-card .form-group:nth-child(3) { animation-delay: 0.15s; }
.auth-glass-card .form-group:nth-child(4) { animation-delay: 0.20s; }
.auth-glass-card .form-group:nth-child(5) { animation-delay: 0.25s; }

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

.auth-glass-card .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
  transition: color 0.2s;
}

.auth-glass-card .form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid rgba(229, 231, 235, 0.8);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #1d1729;
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  font-family: inherit;
}
.auth-glass-card .form-input:hover {
  border-color: rgba(75, 85, 99, 0.4);
  background: rgba(255, 255, 255, 0.85);
}
.auth-glass-card .form-input:focus {
  border-color: #4b5563;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 4px rgba(75, 85, 99, 0.12);
  transform: translateY(-1px);
}
/* When input is focused — label changes color */
.auth-glass-card .form-group:has(.form-input:focus) .form-label {
  color: #1f2937;
}
.auth-glass-card .form-hint {
  font-size: 11.5px;
  color: #9ca3af;
  margin-top: 4px;
  padding-left: 4px;
}

/* ===== Auth links ===== */
.auth-glass-card .auth-link {
  color: #4b5563;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.auth-glass-card .auth-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, #4b5563, #1f2937);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-glass-card .auth-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.auth-glass-card .auth-link:hover { color: #1f2937; }

/* ===== Primary submit button — with shimmer effect ===== */
.auth-glass-card .btn-primary {
  width: 100%;
  padding: 14px 24px !important;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #4b5563 100%);
  background-size: 200% auto;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.25);
  letter-spacing: 0.3px;
  font-family: var(--font-heading, 'Montserrat', sans-serif);
}
/* Shimmer streak that travels across on hover */
.auth-glass-card .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-glass-card .btn-primary:hover {
  transform: translateY(-2px);
  background-position: right center;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.35);
}
.auth-glass-card .btn-primary:hover::before { left: 100%; }
.auth-glass-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.25);
}

/* ===== Auth message ===== */
.auth-glass-card .auth-message {
  border-radius: 12px !important;
  padding: 12px 16px !important;
  font-weight: 500;
  font-size: 13.5px;
  animation: messageIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Form transition (login ↔ register) ===== */
.auth-form { transition: opacity 0.3s; }
.auth-form.active {
  animation: formSwitch 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes formSwitch {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .auth-glass-card {
    padding: 32px 24px;
    border-radius: 20px;
  }
  .auth-glass-card h2 { font-size: 24px; }
  .auth-mesh__blob { filter: blur(60px); }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .auth-mesh__blob,
  .auth-particle,
  .auth-glass-card,
  .auth-form,
  .auth-glass-card .form-group {
    animation: none !important;
  }
  .auth-glass-card .btn-primary::before { display: none; }
}
