/* Fytoscopia — Premium Nature Scanner UI */

:root {
  --color-primary: #2d6a4f;
  --color-secondary: #52b788;
  --color-accent: #95d5b2;
  --color-bg: #f8fff8;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6a6a6a;
  --color-severity-low: #52b788;
  --color-severity-moderate: #d4a017;
  --color-severity-high: #c0392b;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeOut 0.8s ease-in-out 2s forwards;
}

.loading-screen .motto {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #fff;
  text-align: center;
  padding: 0 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* Welcome Banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  margin-bottom: 1.5rem;
}

.welcome-banner h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.welcome-banner .creator {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Guest CTA — prominent skip-login button in banner */
.guest-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.guest-cta-btn svg {
  width: 18px;
  height: 18px;
}
.guest-cta-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.8);
  transform: translateY(-1px);
}
.guest-cta-btn:active {
  transform: translateY(0);
}

/* Main Container */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  background: var(--color-surface);
  border-radius: 50px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.15);
  margin-bottom: 1.5rem;
  gap: 4px;
}

.mode-toggle button {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: var(--color-muted);
}

.mode-toggle button.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(45, 106, 79, 0.3);
}

.mode-toggle button:not(.active):hover {
  color: var(--color-primary);
}

/* Image Input Section */
.image-input-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
  .image-input-section {
    grid-template-columns: 1fr;
  }
}

.input-card {
  background: var(--color-surface);
  border: 2px dashed var(--color-accent);
  border-radius: 16px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.input-card:hover {
  border-color: var(--color-secondary);
  background: rgba(149, 213, 178, 0.05);
}

.input-card input[type="file"] {
  display: none;
}

.input-card .card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  color: var(--color-secondary);
}

.input-card .card-label {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.input-card .card-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* Camera Section */
.camera-container {
  background: var(--color-surface);
  border: 2px dashed var(--color-accent);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
  display: none;
}

.camera-container.active {
  display: block;
}

.camera-container video {
  width: 100%;
  max-height: 300px;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.camera-container canvas {
  display: none;
}

.camera-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Preview */
.preview-container {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  display: none;
}

.preview-container.active {
  display: block;
}

.preview-container img {
  max-width: 100%;
  max-height: 250px;
  border-radius: 12px;
  object-fit: cover;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: #1e4d3a;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-primary);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-secondary:hover {
  background: var(--color-secondary);
  color: #fff;
}

/* Analyze Button */
.analyze-section {
  margin-bottom: 1.5rem;
}

.analyze-section .btn-primary {
  position: relative;
}

.analyze-section .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.analyze-section .btn-primary.loading .spinner {
  display: block;
}

.analyze-section .btn-primary.loading .btn-text {
  opacity: 0.7;
}

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

/* Results Panel */
.results-panel {
  background: var(--color-surface);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.1);
  display: none;
  animation: slideUp 0.4s ease;
}

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

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

.results-panel .diagnosis-header {
  margin-bottom: 1.25rem;
}

.results-panel .diagnosis-label {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.results-panel .confidence-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.results-panel .confidence-label {
  font-size: 0.85rem;
  color: var(--color-muted);
  min-width: 80px;
}

.results-panel .confidence-bar {
  flex: 1;
  height: 8px;
  background: var(--color-accent);
  border-radius: 4px;
  overflow: hidden;
}

.results-panel .confidence-fill {
  height: 100%;
  background: var(--color-secondary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.results-panel .confidence-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  min-width: 45px;
  text-align: right;
}

.severity-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-badge.severity-low {
  background: rgba(82, 183, 136, 0.15);
  color: var(--color-severity-low);
}

.severity-badge.severity-moderate {
  background: rgba(212, 160, 23, 0.15);
  color: var(--color-severity-moderate);
}

.severity-badge.severity-high {
  background: rgba(192, 57, 43, 0.15);
  color: var(--color-severity-high);
}

.results-panel .recommendation {
  background: rgba(149, 213, 178, 0.1);
  border-left: 4px solid var(--color-secondary);
  padding: 1rem;
  border-radius: 0 12px 12px 0;
  margin: 1rem 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.results-panel .citations {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-accent);
}

.results-panel .citations-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.results-panel .citations-list {
  list-style: none;
}

.results-panel .citations-list li {
  margin-bottom: 0.5rem;
}

.results-panel .citations-list a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.results-panel .citations-list a:hover {
  text-decoration: underline;
}

.results-panel .citations-list .ext-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Mobile-first adjustments */
@media (max-width: 480px) {
  .welcome-banner h1 {
    font-size: 1.5rem;
  }

  .loading-screen .motto {
    font-size: 1.25rem;
  }

  .mode-toggle button {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  .results-panel .diagnosis-label {
    font-size: 1.2rem;
  }
}

/* Login Modal */
.login-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal-backdrop.hidden {
  display: none;
}

.login-modal {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(45, 106, 79, 0.25);
  animation: modalSlideUp 0.4s ease;
  position: relative;
  z-index: 10001;
}

.login-modal.hidden {
  display: none;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  margin-bottom: 1.5rem;
}

.login-icon {
  width: 56px;
  height: 56px;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

.login-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

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

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-input {
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease;
  width: 100%;
}

.login-input:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.login-submit {
  margin-top: 0.5rem;
}

.login-social-proof {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  background: #f0f7f4;
  border: 1px solid #d8edd9;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.social-proof-badge {
  display: flex;
  gap: 0.15rem;
  color: #f59e0b;
  margin-bottom: 0.15rem;
}

.social-proof-quote {
  font-size: 0.8rem;
  color: #2d6a4f;
  font-style: italic;
  line-height: 1.4;
}

.social-proof-author {
  font-size: 0.72rem;
  color: #74c69d;
  margin-top: 0.1rem;
}

.login-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.login-success.active {
  display: flex;
}

.login-success svg {
  width: 48px;
  height: 48px;
  color: var(--color-secondary);
}

.login-success p {
  color: var(--color-primary);
  font-weight: 500;
}

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.login-tab {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  background: transparent;
  color: var(--color-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.login-tab:not(.active):hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.login-error {
  background: rgba(192, 57, 43, 0.1);
  border-left: 4px solid var(--color-severity-high);
  padding: 0.75rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--color-severity-high);
  text-align: left;
}

.login-toggle-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
}

.link-btn:hover {
  color: var(--color-secondary);
}

/* App Footer */
.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-accent);
  margin-top: 2rem;
}

.app-footer p {
  max-width: 640px;
  margin: 0 auto;
}

/* Profile Modal */
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-modal-backdrop.hidden {
  display: none;
}

.profile-modal {
  background: var(--color-surface);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(45, 106, 79, 0.25);
  animation: modalSlideUp 0.4s ease;
  position: relative;
  z-index: 10003;
}

.profile-modal.hidden {
  display: none;
}

.profile-header {
  margin-bottom: 1.5rem;
}

.profile-icon {
  width: 56px;
  height: 56px;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

.profile-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

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

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-photo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.profile-photo-upload input[type="file"] {
  display: none;
}

.profile-photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.2s ease;
}

.profile-photo-preview:hover {
  background: var(--color-secondary);
}

.profile-photo-preview svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

.profile-photo-preview:not(:has(svg)) {
  background-size: cover;
  background-position: center;
}

.profile-photo-label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.profile-input {
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease;
  width: 100%;
}

.profile-input:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.profile-select {
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.2s ease;
  width: 100%;
  background: var(--color-surface);
  cursor: pointer;
}

.profile-select:focus {
  outline: none;
  border-color: var(--color-secondary);
}

.profile-radio-group {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.profile-radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--color-text);
}

.profile-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.profile-submit {
  margin-top: 0.5rem;
}

/* Profile Locked State */
.image-input-section.profile-locked,
.mode-toggle.profile-locked,
.analyze-section.profile-locked {
  pointer-events: none;
  opacity: 0.5;
  filter: grayscale(0.5);
}

/* Utility */
.hidden {
  display: none !important;
}

/* Demo mode */
.demo-trigger-wrap {
  text-align: center;
  margin-top: 1.25rem;
}
.demo-trigger-btn {
  background: none;
  border: none;
  color: #52b788;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}
.demo-trigger-btn:hover {
  color: #40916c;
}
.demo-gallery-section {
  padding: 2rem 0 0;
  display: none;
}
.demo-gallery-section.active {
  display: block;
}
.demo-gallery-label {
  font-size: 0.85rem;
  color: #6c757d;
  text-align: center;
  margin-bottom: 1rem;
  font-style: italic;
}
.demo-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.demo-gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: #e8f5e9;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.15s;
}
.demo-gallery-item:hover {
  border-color: #52b788;
  transform: scale(1.04);
}
.demo-gallery-item.selected {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45,106,79,0.3);
}
.demo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.demo-gallery-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}
.demo-gallery-note {
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ════════════════════════════════════════════════════════
   ONBOARDING FLOW
═══════════════════════════════════════════════════════ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 1000;
  overflow-y: auto;
  display: none;
}

.onboarding-screen {
  min-height: 100vh;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
}

/* Screen 1: Welcome */
#onboardingScreen1 {
  justify-content: center;
  gap: 2rem;
  text-align: center;
}

.onboarding-header {
  width: 100%;
  text-align: center;
}

.onboarding-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
}

.onboarding-logo svg {
  width: 72px;
  height: 72px;
}

.onboarding-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.onboarding-tagline {
  font-size: 1rem;
  color: var(--color-muted);
}

.onboarding-subtitle {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.onboarding-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.onboarding-features {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.onboarding-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  background: var(--color-surface);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.08);
}

.onboarding-feature-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(82, 183, 136, 0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-feature-icon svg {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
}

.onboarding-feature strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.onboarding-feature p {
  font-size: 0.8rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
}

.onboarding-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.onboarding-start-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

.onboarding-skip-link {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0.25rem;
  text-decoration: underline;
  transition: color 0.2s;
}

.onboarding-skip-link:hover {
  color: var(--color-text);
}

/* Screen 2: Mode selection */
#onboardingScreen2 {
  justify-content: flex-start;
  padding-top: 1.5rem;
}

.onboarding-back-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.onboarding-back-btn:hover {
  color: var(--color-text);
}

.onboarding-back-btn svg {
  width: 18px;
  height: 18px;
}

.onboarding-mode-cards {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 400px) {
  .onboarding-mode-cards {
    grid-template-columns: 1fr;
  }
}

.onboarding-mode-card {
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.15s;
  font-family: var(--font-body);
  color: var(--color-text);
}

.onboarding-mode-card:hover {
  border-color: var(--color-secondary);
  box-shadow: 0 4px 16px rgba(82, 183, 136, 0.2);
  transform: translateY(-2px);
}

.onboarding-mode-card:active {
  transform: translateY(0);
}

.onboarding-mode-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
}

.onboarding-mode-icon svg {
  width: 56px;
  height: 56px;
}

.onboarding-mode-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.onboarding-mode-card p {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.onboarding-mode-tip {
  display: block;
  font-size: 0.72rem;
  color: var(--color-secondary);
  font-weight: 500;
  line-height: 1.4;
}

/* Screen 3: Mock results + CTA */
#onboardingScreen3 {
  justify-content: flex-start;
  padding-top: 1.5rem;
}

.onboarding-results-card {
  width: 100%;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.12);
  margin-bottom: 1.25rem;
}

.onboarding-results-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}

.onboarding-results-mode-badge {
  background: rgba(45, 106, 79, 0.1);
  color: var(--color-primary);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  white-space: nowrap;
}

.onboarding-results-diagnosis {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.onboarding-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  gap: 1rem;
}

.onboarding-confidence {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.onboarding-confidence-label {
  font-size: 0.72rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.onboarding-confidence-bar {
  flex: 1;
  height: 7px;
  background: rgba(45, 106, 79, 0.15);
  border-radius: 4px;
  overflow: hidden;
}

.onboarding-confidence-fill {
  height: 100%;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  border-radius: 4px;
}

.onboarding-confidence-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  min-width: 32px;
  text-align: right;
}

.onboarding-severity-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.onboarding-recommendation {
  background: rgba(82, 183, 136, 0.06);
  border-left: 3px solid var(--color-secondary);
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 0.875rem;
  font-size: 0.825rem;
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: 0.875rem;
}

.onboarding-recommendation strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.onboarding-citations-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: 0.375rem;
}

.onboarding-citations-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.onboarding-citations-list li {
  margin-bottom: 0.3rem;
}

.onboarding-citations-list a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--color-primary);
  font-size: 0.775rem;
  text-decoration: none;
  transition: color 0.2s;
}

.onboarding-citations-list a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

.onboarding-cta-box {
  width: 100%;
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.06) 0%, rgba(82, 183, 136, 0.08) 100%);
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: center;
}

.onboarding-cta-box h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.onboarding-cta-box p {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.onboarding-cta-btn {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* ════════════════════════════════════════════════════════
   TESTIMONIALS SECTION
═══════════════════════════════════════════════════════ */
.testimonials-section {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1rem 0;
}

.testimonials-header {
  text-align: center;
  margin-bottom: 2rem;
}

.testimonials-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
}

.testimonials-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}

.testimonial-card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(45, 106, 79, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  border: 1px solid var(--color-accent);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.testimonial-card:hover {
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.14);
  transform: translateY(-2px);
}

.testimonial-stars {
  display: flex;
  gap: 0.2rem;
  color: #f59e0b;
}

.testimonial-stars svg {
  width: 16px;
  height: 16px;
}

.testimonial-quote {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-text);
  font-style: italic;
  margin: 0;
  flex: 1;
}

.testimonial-attribution {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--color-accent);
  padding-top: 0.75rem;
}

.testimonial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.testimonial-person {
  display: flex;
  flex-direction: column;
}

.testimonial-person strong {
  font-size: 0.875rem;
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.3;
}

.testimonial-person span {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.testimonials-note {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-align: center;
  font-style: italic;
  margin-top: 0.5rem;
}

/* ── Treatment Recommendation Panel ──────────────────────────────────── */

.treatment-recommendation-panel {
  background: var(--color-surface);
  border: 1px solid #d0e8dc;
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.treatment-panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.treatment-panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
}

.treatment-summary {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f0f9f4;
  border-radius: 8px;
  border-left: 3px solid var(--color-primary);
}

.treatment-section {
  margin-top: 0.75rem;
}

.treatment-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.treatment-steps-list {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
}

.treatment-steps-list li {
  counter-increment: step-counter;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.875rem;
  color: var(--color-text);
}

.treatment-steps-list li:last-child {
  border-bottom: none;
}

.treatment-steps-list li::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-timing {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-left: 0.25rem;
}

.treatment-materials-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.treatment-materials-list li {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 500;
}

.treatment-safety-info {
  margin-top: 0.75rem;
}

.safety-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.safety-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.safety-badge.safe {
  background: #e8f5e9;
  color: var(--color-primary);
  border: 1px solid #a5d6a7;
}

.safety-badge.caution {
  background: #fff8e1;
  color: #b7791f;
  border: 1px solid #f0c040;
}

.treatment-follow-up {
  margin-top: 0.75rem;
}

.follow-up-text {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 0.35rem;
}

.treatment-evidence {
  margin-top: 0.75rem;
}

.evidence-citations-list {
  list-style: none;
  padding: 0;
  margin-top: 0.5rem;
}

.evidence-citations-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.25rem 0;
}

.evidence-citations-list li a:hover {
  text-decoration: underline;
}

.ext-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
