/* ============================================================
   DentalClinic — Auth Pages
   Clean · Medical · Light Healthcare Theme
   ============================================================ */

/* ── Arabic / English font stack ──────────────────────────── */
.auth-page,
.auth-page button,
.auth-page input,
.auth-page select,
.auth-page textarea {
  font-family: 'Tajawal', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

/* ── Background — clean medical feel ──────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  background: #e4eef3;
  background-image:
    radial-gradient(ellipse at 30% 0%, rgba(0, 150, 214, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 100%, rgba(140, 198, 63, 0.09) 0%, transparent 50%);
}

/* Subtle decorative shapes */
.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::before {
  width: 450px;
  height: 450px;
  background: rgba(0, 150, 214, 0.05);
  top: -180px;
  inset-inline-end: -120px;
}

.auth-page::after {
  width: 350px;
  height: 350px;
  background: rgba(140, 198, 63, 0.05);
  bottom: -140px;
  inset-inline-start: -100px;
}

/* Static dots decoration */
.auth-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Small dot particles */
.auth-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 150, 214, 0.06);
  animation: particleFloat 6s ease-in-out infinite;
}

.auth-particle:nth-child(even) {
  animation-duration: 8s;
  animation-direction: reverse;
}

@keyframes particleFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50%      { transform: translateY(-20px) scale(1.2); opacity: 0.8; }
}

/* Floating dental bubbles */
.dental-icon {
  position: absolute;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 4px 16px rgba(0, 120, 180, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.7);
  opacity: 0;
  animation: bubbleFloat linear infinite;
  user-select: none;
  font-style: normal;
  filter: grayscale(0.2) opacity(0.55);
}

/* Gentle shine on top-left of bubble */
.dental-icon::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 30%;
  height: 20%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  filter: blur(2px);
}

@keyframes bubbleFloat {
  0%   { transform: translateY(105vh) translateX(0)    rotate(0deg);   opacity: 0;    }
  3%   { opacity: 0.7; }
  25%  { transform: translateY(70vh)  translateX(15px)  rotate(90deg);  opacity: 0.8;  }
  50%  { transform: translateY(40vh)  translateX(-12px) rotate(180deg); opacity: 0.65; }
  75%  { transform: translateY(15vh)  translateX(10px)  rotate(270deg); opacity: 0.5;  }
  97%  { opacity: 0.2; }
  100% { transform: translateY(-10vh) translateX(0)     rotate(360deg); opacity: 0;    }
}

/* ── Main Container ───────────────────────────────────────── */
.auth-container {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 10;
  animation: containerEntry 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes containerEntry {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Brand Header ──────────────────────────────────────────── */
.auth-brand {
  text-align: center;
  margin-block-end: 1.5rem;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.75rem;
  background: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 150, 214, 0.12);
  padding: 10px;
  animation: logoPulse 2s ease-in-out 0.6s 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(0, 150, 214, 0.18);
}

@keyframes logoPulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); }
  60%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.auth-logo img {
  max-height: 48px;
  max-width: 48px;
  object-fit: contain;
}

.auth-logo i {
  font-size: 1.8rem;
  color: var(--color-primary);
}

.auth-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.auth-brand p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-block-start: 0.25rem;
}

/* ── Card ─────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  background: var(--color-bg-card);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

/* ── Card Header (Tabs + Language) ─────────────────────────── */

/* ── Language Badge — sits on top border ──────────────────── */
.auth-lang-badge {
  position: absolute;
  top: -14px;
  inset-inline-end: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #1a3a4a;
  background: #fff;
  border: 1.5px solid rgba(0, 150, 214, 0.2);
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 80, 120, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

.auth-lang-badge i {
  font-size: 0.9rem;
  color: var(--color-primary);
}

.auth-lang-badge:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0, 150, 214, 0.3);
  transform: translateY(-2px);
}

.auth-lang-badge:hover i {
  color: #fff;
}

.auth-lang-badge:active {
  transform: translateY(0) scale(0.96);
}

/* ── Tabs ──────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-block-end: 1.75rem;
  background: #f0f7fa;
  border-radius: 12px;
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.88rem;
  color: #7a9baa;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.auth-tab:hover {
  color: #1a3a4a;
  background: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 150, 214, 0.1);
}

.auth-tab:active {
  transform: translateY(0) scale(0.97);
}

.auth-tab.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0, 150, 214, 0.35);
}

.auth-tab.active:hover {
  box-shadow: 0 6px 20px rgba(0, 150, 214, 0.45);
  transform: translateY(-1px);
}

/* ── Form Panels ───────────────────────────────────────────── */
.auth-panel {
  display: none;
  animation: panelSlide 0.35s ease;
}

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

@keyframes panelSlide {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir="rtl"] .auth-panel {
  animation-name: panelSlideRtl;
}

@keyframes panelSlideRtl {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Auth-specific field overrides ─────────────────────────── */
/* Tel input letter spacing */
.auth-page .field-input[type="tel"] {
  letter-spacing: 0.5px;
}

/* RTL: LTR inputs (tel, email, etc.) — icon stays on the right, padding on the right */
html[dir="rtl"] .auth-page .field-input[type="tel"],
html[dir="rtl"] .auth-page .field-input.input-ltr {
  padding-inline-start: var(--field-padding-x);
  padding-right: var(--field-icon-padding);
}

/* ── Center login fields ───────────────────────────────────── */
#loginPanel .field-input {
  text-align: center;
  padding-inline-end: var(--field-icon-padding);
}

/* Password toggle — positioned at start like other icons */
.password-wrapper {
  position: relative;
}

.password-wrapper .field-input {
  padding-inline-start: 2.5rem;
}

.password-toggle {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-placeholder);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
  z-index: 2;
}

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

/* ── Checkbox / Remember Me ───────────────────────────────── */
.auth-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-block-end: 1.1rem;
}

/* Toggle switch track */
.auth-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border: none;
  border-radius: 20px;
  background: #c5d8e2;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

/* Toggle knob */
.auth-check input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Checked state */
.auth-check input[type="checkbox"]:checked {
  background: var(--color-primary);
}

.auth-check input[type="checkbox"]:checked::after {
  inset-inline-start: 19px;
  box-shadow: 0 1px 4px rgba(0, 150, 214, 0.3);
}

.auth-check label {
  font-size: 0.8rem;
  color: #5a7a8a;
  cursor: pointer;
  user-select: none;
  transition: color 0.25s;
}

.auth-check:hover label {
  color: #3a6a7a;
}

/* ── Buttons ───────────────────────────────────────────────── */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  min-height: 48px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Shine sweep overlay */
.auth-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transition: none;
  pointer-events: none;
}

.auth-btn:hover:not(:disabled)::after {
  left: 120%;
  transition: left 0.6s ease;
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loader i {
  font-size: 1.2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-btn.primary {
  background: linear-gradient(135deg, #0096D6, #0080c0);
  box-shadow: 0 3px 12px rgba(0, 150, 214, 0.25);
}

.auth-btn.primary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 8px 25px rgba(0, 150, 214, 0.4),
    0 0 0 3px rgba(0, 150, 214, 0.08);
  background: linear-gradient(135deg, #00a4e8, #0090cc);
}

.auth-btn.secondary {
  background: linear-gradient(135deg, #8CC63F, #78b030);
  box-shadow: 0 3px 12px rgba(140, 198, 63, 0.25);
}

.auth-btn.secondary:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 8px 25px rgba(140, 198, 63, 0.4),
    0 0 0 3px rgba(140, 198, 63, 0.08);
  background: linear-gradient(135deg, #9ad44d, #85b838);
}

.auth-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}

/* ── Forgot Password Link ──────────────────────────────────── */
.auth-forgot-link {
  display: block;
  text-align: center;
  margin-block-start: 0.85rem;
  font-size: 0.82rem;
  color: #7a9baa;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  padding: 0.4rem;
}

.auth-forgot-link:hover {
  color: var(--color-primary);
  background: rgba(0, 150, 214, 0.06);
  transform: translateY(-1px);
}

/* ── Language Switcher — below card ─────────────────────────── */
.auth-bottom {
  text-align: center;
  margin-block-start: 1rem;
}

.auth-lang-btn {
  background: #fff;
  border: 1px solid #dce8ef;
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1a3a4a;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-lang-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(0, 150, 214, 0.3);
  transform: translateY(-2px) scale(1.03);
}

.auth-lang-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.1s;
}

/* ── Forgot Password Modal ─────────────────────────────────── */
.forgot-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 55, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.forgot-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.forgot-card {
  background: var(--color-bg-card);
  border-radius: 20px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.forgot-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.forgot-card p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-block-end: 1.25rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.auth-bottom-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-block-start: 1.25rem;
}

.auth-footer {
  text-align: center;
  font-size: 0.75rem;
  color: #9ab5c2;
}

/* ── Help link in footer ──────────────────────────────────── */
.auth-help-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #5a7a8a;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  transition: all 0.25s ease;
  margin-block-end: 0.4rem;
}

.auth-help-link:hover {
  background: rgba(255, 0, 0, 0.06);
  color: #cc0000;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-page {
    padding: 0.75rem;
    align-items: flex-start;
    padding-block-start: 1.5rem;
  }

  .auth-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .auth-row {
    flex-direction: column;
    gap: 0;
  }

  .auth-brand h1 {
    font-size: 1.3rem;
  }

  .auth-lang-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    top: -12px;
    inset-inline-end: 14px;
  }

  .auth-tab {
    font-size: 0.8rem;
    padding: 0.5rem 0.6rem;
  }
}

/* ── WhatsApp Floating Action Button ──────────────────────── */
.wa-fab {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  text-decoration: none;
  box-shadow:
    0 4px 16px rgba(37, 211, 102, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: waPulse 3s ease-in-out infinite;
}

.wa-fab:hover {
  transform: scale(1.12);
  background: #20bd5a;
  box-shadow:
    0 6px 24px rgba(37, 211, 102, 0.45),
    0 4px 10px rgba(0, 0, 0, 0.15);
  color: #fff;
}

.wa-fab:active {
  transform: scale(0.95);
}

@keyframes waPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35), 0 0 0 0 rgba(37, 211, 102, 0.3); }
  50%      { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35), 0 0 0 10px rgba(37, 211, 102, 0); }
}

/* ── Dark Mode Overrides ──────────────────────────────────── */
[data-theme="dark"] .auth-page {
  background: var(--color-bg-body);
  background-image:
    radial-gradient(ellipse at 30% 0%, rgba(56, 189, 248, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 100%, rgba(163, 230, 53, 0.06) 0%, transparent 50%);
}

[data-theme="dark"] .auth-page::before {
  background: rgba(56, 189, 248, 0.04);
}

[data-theme="dark"] .auth-page::after {
  background: rgba(163, 230, 53, 0.04);
}

[data-theme="dark"] .auth-logo {
  background: var(--color-bg-card);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .auth-tabs {
  background: var(--color-bg-page);
}

[data-theme="dark"] .auth-tab {
  color: var(--color-text-muted);
}

[data-theme="dark"] .auth-tab:hover {
  color: var(--color-text);
  background: var(--color-surface-hover);
}

[data-theme="dark"] .auth-tab.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

[data-theme="dark"] .auth-btn.primary {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.3);
}

[data-theme="dark"] .auth-btn.primary:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.35);
}

[data-theme="dark"] .auth-btn.secondary {
  background: linear-gradient(135deg, #65a30d, #4d7c0f);
  box-shadow: 0 3px 12px rgba(101, 163, 13, 0.3);
}

[data-theme="dark"] .auth-btn.secondary:hover {
  background: linear-gradient(135deg, #84cc16, #65a30d);
  box-shadow: 0 8px 25px rgba(132, 204, 22, 0.35);
}

/* Gender pills */
[data-theme="dark"] .gender-pill {
  background: var(--color-bg-page);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

[data-theme="dark"] .gender-pill:has(input:checked) {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border-color: transparent;
}

/* WhatsApp FAB */
[data-theme="dark"] .wa-fab {
  background: #1a9e4a;
  box-shadow: 0 4px 16px rgba(26, 158, 74, 0.3), 0 2px 6px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .wa-fab:hover {
  background: #22c55e;
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.4), 0 4px 10px rgba(0, 0, 0, 0.2);
}

@keyframes waPulseDark {
  0%, 100% { box-shadow: 0 4px 16px rgba(26, 158, 74, 0.3), 0 0 0 0 rgba(26, 158, 74, 0.25); }
  50%      { box-shadow: 0 4px 16px rgba(26, 158, 74, 0.3), 0 0 0 10px rgba(26, 158, 74, 0); }
}

[data-theme="dark"] .wa-fab {
  animation-name: waPulseDark;
}

[data-theme="dark"] .auth-lang-badge {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .auth-lang-btn {
  background: var(--color-bg-card);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .auth-check label {
  color: var(--color-text-muted);
}

[data-theme="dark"] .auth-check input[type="checkbox"] {
  background: var(--color-surface-hover);
}

[data-theme="dark"] .auth-forgot-link {
  color: var(--color-text-muted);
}

[data-theme="dark"] .auth-footer {
  color: var(--color-text-muted);
}

[data-theme="dark"] .auth-help-link {
  color: var(--color-text-muted);
}

[data-theme="dark"] .dental-icon {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .auth-particle {
  background: rgba(56, 189, 248, 0.08);
}

[data-theme="dark"] .auth-check:hover label {
  color: var(--color-text);
}

[data-theme="dark"] .forgot-overlay {
  background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .auth-help-link:hover {
  background: rgba(255, 0, 0, 0.1);
}