/* RetinoPro — Clinical-Grade UI Styling */
:root {
  --bg-app: #f3f6fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;
  --accent-dark: #0369a1;
  --teal: #0d9488;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Noto Sans Thai', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.clinical-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
}

.eye-viewport-shell {
  background: radial-gradient(circle at 50% 42%, #182742 0%, #0f192d 58%, #09101f 100%);
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 32px rgba(7, 12, 24, 0.45), 0 12px 30px rgba(15, 23, 42, 0.14);
}

.eye-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 440px;
  margin: 0 auto;
  touch-action: none;
  border-radius: 0.9rem;
}

.drill-canvas {
  display: block;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border-radius: 1rem;
}

/* Tactile stepper buttons */
.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 0.55rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  transition: all 0.12s ease;
  user-select: none;
  cursor: pointer;
}

.stepper-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.stepper-btn:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

.stepper-btn-plus {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.stepper-btn-plus:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.stepper-btn-minus {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.stepper-btn-minus:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

/* Custom Range Slider */
input[type="range"].clinical-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #cbd5e1;
  outline: none;
}

input[type="range"].clinical-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0284c7;
  border: 2.5px solid #ffffff;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.45);
  cursor: pointer;
  transition: transform 0.12s ease;
}

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

/* Tab pill active styling — crisp fit for all 9 desktop modules without clipping */
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.36rem 0.58rem;
  border-radius: 0.6rem;
  font-size: 0.77rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-tab:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.nav-tab.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

/* 6-Box Segmented OTP Input */
.otp-digit-box {
  width: 2.65rem;
  height: 2.95rem;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 0.65rem;
  transition: all 0.14s ease;
  outline: none;
}

.otp-digit-box:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
  background: #f0f9ff;
}

.otp-digit-box.filled {
  border-color: #0d9488;
  background: #f0fdfa;
}

/* Hide scrollbars cleanly for horizontal tab strips */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Native-App Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
}

.mobile-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  padding: 0.42rem 0.2rem 0.32rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  transition: color 0.15s ease, transform 0.12s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
  transform: scale(0.94);
}

.mobile-nav-item .mobile-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 1.55rem;
  border-radius: 999px;
  font-size: 1.05rem;
  transition: background-color 0.15s ease;
}

.mobile-nav-item.active {
  color: #0369a1;
  font-weight: 700;
}

.mobile-nav-item.active .mobile-nav-icon {
  background: #e0f2fe;
}

.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.85rem;
  height: 2.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0284c7, #0d9488);
}

/* Mobile Slide-Up Menu Sheet */
.mobile-sheet-panel {
  animation: sheetSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

@keyframes sheetSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mobile-sheet-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  transition: all 0.14s ease;
  cursor: pointer;
}

.mobile-sheet-item:active {
  transform: scale(0.98);
}

.mobile-sheet-item.active {
  background: #f0f9ff;
  border-color: #38bdf8;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1);
}

/* Eye Selector Segmented Control */
.eye-toggle-btn {
  transition: all 0.16s ease;
  cursor: pointer;
}

.eye-toggle-btn.active-od {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

.eye-toggle-btn.active-os {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.28);
}

/* Reflex Status Badges */
.badge-with {
  background: #ccfbf1;
  color: #0f766e;
  border: 1px solid #5eead4;
}

.badge-against {
  background: #ffe4e6;
  color: #be123c;
  border: 1px solid #fda4af;
}

.badge-neutral {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-scissors {
  background: #fae8ff;
  color: #86198f;
  border: 1px solid #e879f9;
}

/* Optical Cross SVG container */
.optical-cross-svg {
  width: 100%;
  max-width: 175px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Modal animations */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
}

/* Subtle scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
