/* ═══════════════════════════════════════════════════
   AUTH — Modern Tabbed Login & Multi-Step Register
   ═══════════════════════════════════════════════════ */

/* ─── Auth Container ─── */
.auth-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--card-bg);
  border-radius: 28px;
  border: 3px solid var(--card-border);
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(39, 174, 96, 0.12), 0 8px 24px rgba(39, 174, 96, 0.08);
  transition: var(--transition);
}

.auth-card:hover {
  box-shadow: 0 24px 80px rgba(39, 174, 96, 0.16), 0 12px 32px rgba(39, 174, 96, 0.10);
  transform: translateY(-4px);
}

.auth-card-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.12) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Auth Tabs ─── */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  position: relative;
  z-index: 1;
  background: var(--lana-lightest);
}

.auth-tab {
  flex: 1;
  padding: 1rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s ease;
  position: relative;
  font-size: 0.9rem;
  min-height: 48px;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  width: 80%;
  height: 3px;
  background: var(--lana-dark);
  border-radius: 3px 3px 0 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.auth-tab.active {
  color: var(--lana-dark);
  background: var(--card-bg);
}

.auth-tab.active::after {
  transform: scaleX(1);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(46, 204, 113, 0.05);
}

.auth-tab-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.auth-tab-label {
  font-size: 0.85rem;
}

/* ─── Auth Panels ─── */
.auth-panel {
  display: none;
  padding: 2rem 2rem 2.5rem;
  position: relative;
  z-index: 1;
  animation: authPanelIn 0.35s ease;
}

.auth-panel.active {
  display: block;
}

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

.auth-panel-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-panel-header h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.auth-panel-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Auth Avatar ─── */
.auth-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 0.8rem;
  background: linear-gradient(135deg, var(--lana-lightest), rgba(46, 204, 113, 0.15));
  border: 3px solid var(--card-border);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
  animation: float 3s ease-in-out infinite;
}

.auth-avatar-doctor {
  background: linear-gradient(135deg, #e3f2fd, rgba(33, 150, 243, 0.1));
  border-color: var(--lana-dark);
}

.auth-avatar-child {
  background: linear-gradient(135deg, #fff8e1, rgba(255, 193, 7, 0.1));
  border-color: var(--warning);
}

/* ─── Auth Input Group ─── */
.auth-input-group {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.auth-input-group:focus-within {
  border-color: var(--lana-medium);
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.12);
}

.auth-input-icon {
  padding: 0 0.8rem;
  font-size: 1.2rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.auth-input-group input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 0.8rem 0.8rem 0.8rem 0 !important;
  margin: 0 !important;
  height: auto !important;
  font-size: 1rem !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.auth-input-group input:focus {
  box-shadow: none !important;
}

/* ─── Auth Buttons ─── */
.auth-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 14px;
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 3px solid transparent;
  margin-bottom: 0.5rem;
  min-height: 48px;
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--lana-dark), var(--lana-medium));
  color: white;
  border-color: var(--lana-dark);
  box-shadow: 0 4px 16px rgba(39, 174, 96, 0.25);
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(39, 174, 96, 0.35);
}

.auth-btn-primary:active {
  transform: translateY(0);
}

.auth-btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--card-border);
}

.auth-btn-outline:hover {
  background: var(--lana-lightest);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.12);
}

.auth-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0.5rem;
  font-size: 0.9rem;
}

.auth-btn-ghost:hover {
  color: var(--text-primary);
}

.auth-btn-link {
  background: transparent;
  color: var(--lana-dark);
  border: none;
  text-decoration: underline;
  font-size: 0.9rem;
  padding: 0.5rem;
}

.auth-btn-arrow {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.auth-btn:hover .auth-btn-arrow {
  transform: translateX(-4px);
}

/* ─── Auth Divider ─── */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 0.8rem 0;
  gap: 1rem;
}

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

.auth-divider span {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ─── PIN Overrides for new design ─── */
.auth-panel .pin-display-embedded {
  border-radius: 14px;
}

.auth-panel .pin-num {
  border-radius: 14px;
}

.pin-clear { color: var(--warning) !important; }
.pin-submit { color: var(--lana-dark) !important; font-weight: 900; }

/* ─── Google Sign-In Button (Professional) ─── */
.google-signin-btn {
  width: 100%;
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  margin-bottom: 0.8rem;
  min-height: 52px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.google-signin-btn:hover {
  background-color: #f8f9fa;
  border-color: #d2e3fc;
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
  transform: translateY(-1px);
}

.google-signin-btn:active {
  background-color: #eeeeee;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  transform: translateY(0);
}

.google-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 4px;
  flex-shrink: 0;
}

.google-signin-btn span {
  flex: 1;
  text-align: center;
  margin-right: -24px; /* Offset the icon width to center text exactly */
}

[dir="rtl"] .google-signin-btn span {
  margin-right: 0;
  margin-left: -24px;
}


/* ═══════════════════════════════════════════════════
   REGISTRATION — Multi-Step Forms
   ═══════════════════════════════════════════════════ */

.reg-wrapper {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.reg-card {
  width: 100%;
  background: var(--card-bg);
  border-radius: 28px;
  border: 3px solid var(--card-border);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(39, 174, 96, 0.12), 0 8px 24px rgba(39, 174, 96, 0.08);
}

.reg-card-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.10) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.reg-card > * {
  position: relative;
  z-index: 1;
}

/* ─── Progress Steps ─── */
.reg-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 0;
}

.reg-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.reg-step span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.reg-step.active span,
.reg-step.completed span {
  color: var(--lana-dark);
}

.reg-step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  background: var(--lana-lightest);
  color: var(--text-muted);
  border: 3px solid var(--border);
  transition: all 0.3s ease;
}

.reg-step.active .reg-step-circle {
  background: var(--lana-dark);
  color: white;
  border-color: var(--lana-dark);
  box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.2);
}

.reg-step.completed .reg-step-circle {
  background: var(--lana-medium);
  color: white;
  border-color: var(--lana-medium);
}

.reg-step-line {
  width: 40px;
  height: 3px;
  background: var(--border);
  margin: 0 0.3rem;
  margin-bottom: 1.2rem;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.reg-step-line.active {
  background: var(--lana-medium);
}

.reg-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.reg-header h2 {
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 900;
}

/* ─── Step Panels ─── */
.reg-step-panel {
  display: none;
  animation: regStepIn 0.4s ease;
}

.reg-step-panel.active {
  display: block;
}

@keyframes regStepIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── OTP Boxes ─── */
.otp-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.otp-info-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.otp-info p {
  color: var(--text-body);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.otp-email-display {
  color: var(--lana-dark) !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  direction: ltr;
  unicode-bidi: bidi-override;
}

.otp-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.5rem;
  direction: ltr;
}

.otp-digit {
  width: 52px !important;
  height: 60px !important;
  text-align: center !important;
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  border: 3px solid var(--card-border) !important;
  border-radius: 14px !important;
  background: var(--input-bg) !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: all 0.2s ease;
  caret-color: var(--lana-dark);
}

.otp-digit:focus {
  border-color: var(--lana-dark) !important;
  box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.2) !important;
  transform: translateY(-2px);
}

.otp-digit.filled {
  border-color: var(--lana-medium) !important;
  background: var(--lana-lightest) !important;
}

.otp-digit.error {
  border-color: var(--danger) !important;
  animation: otpShake 0.4s ease;
}

@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ─── OTP Timer ─── */
.otp-timer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.otp-countdown {
  color: var(--lana-dark);
  font-weight: 900;
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════════
   GOOGLE SETUP MODAL
   ═══════════════════════════════════════════════════ */

.gsetup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gsetup-overlay.show {
  opacity: 1;
}

.gsetup-overlay.show .gsetup-card {
  transform: translateY(0) scale(1);
}

.gsetup-card {
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border-radius: 28px;
  border: 3px solid var(--card-border);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(39, 174, 96, 0.18), 0 8px 32px rgba(0,0,0,0.15);
  transform: translateY(30px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.gsetup-card-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 160px;
  background: linear-gradient(180deg, rgba(66,133,244,0.1) 0%, rgba(46,204,113,0.08) 50%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.gsetup-card > * { position: relative; z-index: 1; }

/* ─── Google Badge ─── */
.gsetup-google-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(120deg, #4285F4, #34A853, #FBBC05, #EA4335);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.gsetup-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ─── Progress ─── */
.gsetup-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 1.2rem;
}

.gsetup-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.gsetup-step span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.3s;
}

.gsetup-step.active span, .gsetup-step.completed span { color: var(--lana-dark); }

.gsetup-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 0.85rem;
  background: var(--lana-lightest);
  color: var(--text-muted);
  border: 3px solid var(--border);
  transition: all 0.3s ease;
}

.gsetup-step.active .gsetup-step-circle {
  background: var(--lana-dark); color: white; border-color: var(--lana-dark);
  box-shadow: 0 0 0 4px rgba(39,174,96,0.2);
}

.gsetup-step.completed .gsetup-step-circle {
  background: var(--lana-medium); color: white; border-color: var(--lana-medium);
}

.gsetup-step-line {
  width: 40px; height: 3px;
  background: var(--border);
  margin: 0 0.3rem 1.1rem;
  border-radius: 3px;
  transition: background 0.3s ease;
}

.gsetup-step-line.active { background: var(--lana-medium); }

/* ─── Avatar Row ─── */
.gsetup-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--lana-lightest);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  text-align: right;
}

.gsetup-avatar-img {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  flex-shrink: 0;
  object-fit: cover;
}

.gsetup-avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.gsetup-avatar-info { flex: 1; }

.gsetup-avatar-name {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.gsetup-avatar-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  direction: ltr;
  unicode-bidi: bidi-override;
}

/* ─── Hint text ─── */
.gsetup-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  margin-bottom: 1.2rem;
  padding: 0.7rem 1rem;
  background: var(--lana-lightest);
  border-radius: 12px;
  border: 1px solid var(--card-border);
  line-height: 1.5;
}

/* ─── Locked Email Field ─── */
.gsetup-email-locked {
  background: var(--lana-lightest) !important;
  border-color: var(--lana-medium) !important;
  position: relative;
}

.gsetup-locked-badge {
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  margin-left: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── Step panels ─── */
.gsetup-step-panel { display: none; animation: regStepIn 0.35s ease; }
.gsetup-step-panel.active { display: block; }

/* ─── Mobile Responsive ─── */
@media (max-width: 520px) {
  .auth-card {
    border-radius: 20px;
    margin: 0 0.5rem;
  }

  .auth-panel {
    padding: 1.5rem 1.2rem 2rem;
  }

  .auth-tab-label {
    font-size: 0.75rem;
  }

  .auth-tab-icon {
    font-size: 1.3rem;
  }

  .reg-card {
    padding: 1.5rem 1.2rem;
    border-radius: 20px;
  }

  .otp-digit {
    width: 44px !important;
    height: 52px !important;
    font-size: 1.3rem !important;
  }

  .otp-boxes {
    gap: 5px;
  }

  .reg-step-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .reg-step span {
    font-size: 0.65rem;
  }

  .reg-step-line {
    width: 28px;
  }
}
