/* ===== AUTH PAGES – DESIGN V2 ===== */
@keyframes float-up {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes blob1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(30px,-20px) scale(1.08); }
}
@keyframes blob2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-20px,25px) scale(1.05); }
}
@keyframes blob3 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(15px,15px) scale(1.1); }
}
@keyframes count-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes progress-fill {
  from { width: 0; }
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(139,92,246,.35); }
  70%  { box-shadow: 0 0 0 10px rgba(139,92,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
}

* { box-sizing: border-box; }

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-family: 'Inter', sans-serif;
}

/* ──────────────────────────── LEFT PANEL ──────────────────────────── */
.auth-left {
  background: linear-gradient(145deg, #1e1b4b 0%, #4f46e5 50%, #7c3aed 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}
/* animated blobs */
.auth-left .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .25;
  pointer-events: none;
}
.auth-left .blob-1 {
  width: 420px; height: 420px;
  background: #a78bfa;
  top: -120px; right: -120px;
  animation: blob1 8s ease-in-out infinite;
}
.auth-left .blob-2 {
  width: 300px; height: 300px;
  background: #818cf8;
  bottom: -80px; left: -80px;
  animation: blob2 10s ease-in-out infinite;
}
.auth-left .blob-3 {
  width: 200px; height: 200px;
  background: #c4b5fd;
  bottom: 30%; right: 10%;
  animation: blob3 7s ease-in-out infinite;
}
/* dot grid */
.auth-left::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.auth-left-content {
  position: relative; z-index: 1;
  text-align: center; color: white;
  max-width: 380px;
  animation: float-up .7s ease both;
}

.auth-left-logo {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 1.6rem; font-weight: 800;
  margin-bottom: 44px;
  letter-spacing: -.5px;
}
.auth-left-logo img {
  width: 44px; height: 44px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  flex-shrink: 0;
}

.auth-left h2 {
  font-size: 2rem; margin-bottom: 14px;
  line-height: 1.25; font-weight: 800;
}
.auth-left p {
  color: rgba(255,255,255,.72);
  line-height: 1.75; font-size: 0.95rem;
}

/* feature list */
.auth-features { margin-top: 36px; text-align: left; }
.auth-feature-item {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
  color: rgba(255,255,255,.9);
  font-size: 0.875rem;
  animation: float-up .7s ease both;
}
.auth-feature-item:nth-child(1) { animation-delay: .1s; }
.auth-feature-item:nth-child(2) { animation-delay: .2s; }
.auth-feature-item:nth-child(3) { animation-delay: .3s; }
.auth-feature-item .icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
}

/* stats strip */
.auth-stats {
  display: flex; gap: 0;
  margin-top: 40px;
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 28px;
  width: 100%;
  justify-content: space-around;
}
.auth-stat { text-align: center; }
.auth-stat-num {
  font-size: 1.6rem; font-weight: 800;
  animation: count-up .6s ease both;
  animation-delay: .5s;
}
.auth-stat-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

/* ──────────────────────────── RIGHT PANEL ──────────────────────────── */
.auth-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px;
  background: #f8f7ff;
  overflow-y: auto;
}
.auth-form-wrapper {
  width: 100%; max-width: 440px;
  animation: float-up .6s ease both;
}

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: #6b7280;
  margin-bottom: 30px;
  transition: all .2s; text-decoration: none;
  font-weight: 500;
}
.back-link:hover { color: #4f46e5; gap: 8px; }

/* card wrapper */
.auth-card {
  background: white;
  border-radius: 24px;
  padding: 40px 38px;
  box-shadow: 0 4px 6px rgba(0,0,0,.04), 0 20px 60px rgba(79,70,229,.08);
  border: 1px solid rgba(79,70,229,.08);
}

.auth-form-header { margin-bottom: 28px; }
.auth-form-header h1 {
  font-size: 1.65rem; font-weight: 800;
  color: #0f172a; margin-bottom: 6px;
  letter-spacing: -.5px;
}
.auth-form-header p { color: #64748b; font-size: 0.9rem; }

/* ──────────── INPUT GROUP ──────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem; font-weight: 600;
  color: #374151; margin-bottom: 7px;
}
.input-wrap {
  position: relative;
}
.input-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  transition: color .2s;
}
.input-wrap:focus-within .input-icon { color: #4f46e5; }
.form-control {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  background: #fafafa;
  color: #0f172a;
  transition: all .2s;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.form-control:focus {
  border-color: #4f46e5;
  background: white;
  box-shadow: 0 0 0 4px rgba(79,70,229,.1);
}
.form-control.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239,68,68,.1);
}
.form-control.success {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16,185,129,.1);
}
.form-control::placeholder { color: #c4c4c4; }
/* no-icon variant */
.form-control.no-icon { padding-left: 14px; }

/* ──────────── PASSWORD ──────────── */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 13px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; color: #9ca3af;
  transition: color .2s; padding: 2px;
}
.password-toggle:hover { color: #4f46e5; }

/* strength bar */
.strength-bar {
  margin-top: 8px; height: 5px;
  border-radius: 99px;
  background: #f1f5f9;
  overflow: hidden;
}
.strength-fill {
  height: 100%; width: 0;
  border-radius: 99px;
  transition: all .35s ease;
  animation: progress-fill .35s ease;
}
.strength-label {
  font-size: 0.72rem; margin-top: 5px; font-weight: 600;
}

/* ──────────── CHECKBOX ──────────── */
.checkbox-group {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; color: #6b7280; cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 17px; height: 17px;
  accent-color: #4f46e5; cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}
.checkbox-group a { color: #4f46e5; font-weight: 500; }

/* ──────────── BUTTON ──────────── */
.btn-auth {
  width: 100%;
  padding: 13px 20px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white; border: none;
  border-radius: 12px;
  font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  letter-spacing: .2px;
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
  animation: pulse-ring 2.5s infinite;
}
.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,.45);
}
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.btn-auth .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn-auth.loading .spinner { display: block; }
.btn-auth.loading .btn-text { display: none; }

/* ──────────── DIVIDER ──────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; color: #9ca3af;
  margin: 20px 0; font-weight: 500;
}
.divider::before,.divider::after {
  content:''; flex:1; height:1px; background:#e5e7eb;
}

/* ──────────── SOCIAL ──────────── */
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 11px;
  background: white;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all .2s; color: #374151;
  font-family: 'Inter', sans-serif;
}
.social-btn:hover { border-color: #4f46e5; background: #f5f3ff; }

/* ──────────── ALERT ──────────── */
.auth-alert {
  display: none;
  align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: 11px;
  font-size: 0.875rem; font-weight: 500;
  margin-bottom: 18px;
  animation: float-up .3s ease;
}
.auth-alert.show { display: flex; }
.auth-alert-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
}
.auth-alert-success {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a;
}
.auth-alert svg { flex-shrink: 0; }

/* shake for form error */
.shake { animation: shake .35s ease; }

/* ──────────── DEMO CARDS ──────────── */
.demo-section {
  margin-top: 24px;
  background: #f8f7ff;
  border: 1.5px dashed #c7d2fe;
  border-radius: 16px;
  padding: 18px;
}
.demo-section-title {
  font-size: 0.75rem; font-weight: 700;
  color: #4f46e5; text-transform: uppercase;
  letter-spacing: .8px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.demo-cards { display: flex; flex-direction: column; gap: 8px; }
.demo-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e0e7ff;
  cursor: pointer;
  transition: all .2s;
}
.demo-card:hover { border-color: #4f46e5; background: #f5f3ff; transform: translateX(3px); }
.demo-avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800; color: white; flex-shrink: 0;
}
.demo-avatar.admin { background: linear-gradient(135deg, #ef4444, #dc2626); }
.demo-avatar.agent { background: linear-gradient(135deg, #f59e0b, #d97706); }
.demo-avatar.user  { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.demo-info { flex: 1; min-width: 0; }
.demo-role { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #9ca3af; }
.demo-email { font-size: 0.8rem; color: #374151; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-use {
  font-size: 0.72rem; color: #4f46e5; font-weight: 600;
  white-space: nowrap; background: #e0e7ff; padding: 3px 8px; border-radius: 6px;
}

/* ──────────── FOOTER ──────────── */
.auth-form-footer {
  text-align: center; margin-top: 20px;
  font-size: 0.85rem; color: #64748b;
}
.auth-form-footer a { color: #4f46e5; font-weight: 600; }
.auth-form-footer a:hover { text-decoration: underline; }

/* ──────────── STEP INDICATOR ──────────── */
.step-indicator {
  display: flex; align-items: center;
  margin-bottom: 28px; gap: 0;
}
.step-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; }
.step-circle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #e5e7eb;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: white; color: #9ca3af;
  transition: all .3s; position: relative; z-index: 1;
}
.step-label {
  font-size: 0.68rem; font-weight: 600; color: #9ca3af;
  margin-top: 5px; text-align: center; white-space: nowrap;
}
.step-line { flex: 1; height: 2px; background: #e5e7eb; transition: all .3s; }
.step.active .step-circle { background: #4f46e5; border-color: #4f46e5; color: white; box-shadow: 0 0 0 4px rgba(79,70,229,.2); }
.step.active .step-label { color: #4f46e5; }
.step.done .step-circle  { background: #10b981; border-color: #10b981; color: white; }
.step.done .step-label   { color: #10b981; }
.step.done .step-line    { background: #10b981; }

/* form steps */
.form-step { display: none; animation: float-up .35s ease; }
.form-step.active { display: block; }

/* ──────────── ROLE CARDS ──────────── */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.role-card {
  border: 2px solid #e5e7eb; border-radius: 14px;
  padding: 16px 12px; text-align: center; cursor: pointer;
  transition: all .2s; position: relative; background: white;
}
.role-card input[type="radio"] { position: absolute; opacity: 0; }
.role-card:hover { border-color: #a5b4fc; background: #f5f3ff; }
.role-card.selected { border-color: #4f46e5; background: #eef2ff; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.role-card .role-icon { font-size: 2rem; margin-bottom: 8px; }
.role-card .role-name { font-weight: 700; font-size: 0.875rem; color: #0f172a; }
.role-card .role-desc { font-size: 0.72rem; color: #6b7280; margin-top: 4px; }
.role-card .check-badge {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #4f46e5; color: white;
  display: none; align-items: center; justify-content: center;
  font-size: 0.65rem;
}
.role-card.selected .check-badge { display: flex; }

/* ──────────── MATCH INDICATOR ──────────── */
.match-label { font-size: 0.72rem; margin-top: 5px; font-weight: 600; }

/* ──────────── TRUST BADGES ──────────── */
.trust-badges {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 20px;
  flex-wrap: wrap;
}
.trust-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; color: #9ca3af; font-weight: 500;
}
.trust-badge svg { color: #10b981; }

/* ──────────── GOOGLE BUTTON ──────────── */
.social-btn-google {
  width: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid #dadce0;
  transition: all .2s;
  position: relative;
}
.social-btn-google:hover {
  background: #f8f9ff;
  border-color: #4285F4;
  box-shadow: 0 2px 8px rgba(66,133,244,.2);
}

/* ──────────── RESPONSIVE ──────────── */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 32px 20px; background: white; }
}
