/* ==========================================================================
   DentSync — Dental Clinic & Lab Sourcing OS
   Design System: Modern Clinical Light Mode (Crisp White, Deep Navy & Royal Blue)
   ========================================================================== */

:root {
  --primary-blue: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --cyan-accent: #0ea5e9;
  --cyan-light: #f0f9ff;
  --teal-accent: #0d9488;
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --border-subtle: #e2e8f0;
  --border-light: #f1f5f9;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --card-shadow-hover: 0 12px 30px -4px rgba(37, 99, 235, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.04);
}

/* Base Styles */
html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--navy-900);
  background-color: var(--bg-page);
}

body {
  overflow-x: hidden;
  background-color: #ffffff;
  color: #1e293b;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Clinical Card System */
.clinical-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.clinical-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: #bfdbfe;
  transform: translateY(-2px);
}

/* Accent Bar Cards */
.accent-card-blue {
  border-left: 4px solid var(--primary-blue);
}
.accent-card-cyan {
  border-left: 4px solid var(--cyan-accent);
}
.accent-card-teal {
  border-left: 4px solid var(--teal-accent);
}
.accent-card-amber {
  border-left: 4px solid #f59e0b;
}

/* Buttons & Glow Effects */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-cyan {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
}

.btn-cyan:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

/* Clinical Status Badges */
.badge-clinic {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.025em;
}

.badge-lab {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.badge-cad {
  background-color: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f5d0fe;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.badge-urgent {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 700;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

/* Interactive Dental Arch Chart (Tooth Selector) */
.dental-arch-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem;
}

.dental-arch-row {
  display: flex;
  justify-content: flex-start;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (min-width: 768px) {
  .dental-arch-row {
    justify-content: center;
  }
}

.tooth-node {
  width: 2.1rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  border: 1.5px solid #cbd5e1;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tooth-node:hover {
  border-color: #3b82f6;
  background-color: #eff6ff;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
  z-index: 2;
}

.tooth-node.selected {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: scale(1.1);
  z-index: 3;
}

.tooth-node.selected .tooth-label {
  color: #bfdbfe;
}

.tooth-label {
  font-size: 0.55rem;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
}

/* Range Slider Styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  background-color: #ffffff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item.active {
  border-color: #bfdbfe;
  box-shadow: 0 4px 15px -2px rgba(37, 99, 235, 0.08);
}

.faq-question {
  cursor: pointer;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: #0f172a;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.25rem;
  color: #475569;
  font-size: 0.925rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 350px;
  padding: 0 1.25rem 1.25rem 1.25rem;
}

.faq-icon {
  transition: transform 0.25s ease;
  color: #64748b;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: #2563eb;
}

/* Mobile Sticky Bottom CTA Bar */
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 640px) {
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }

  /* Prevent auto-zoom on iOS inputs and selects */
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Toast Notifications */
#toast-notification {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  max-width: 92vw;
  box-sizing: border-box;
}

#toast-notification.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
