/* intake_improved.css - Complete improved stylesheet */

/* =========================================
   BASE & RESET
========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #f9fafb;
}

/* =========================================
   HERO SECTION
========================================= */
.nat-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.nat-hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.nat-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.nat-hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.nat-tagline {
  font-size: 18px;
  opacity: 0.95;
  margin-bottom: 24px;
  line-height: 1.6;
}

.availability-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px 24px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  margin-top: 24px;
}

.availability-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.availability-text {
  font-size: 14px;
}

/* =========================================
   QUIZ CONTAINER
========================================= */
.quiz-container {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Progress Bar */
.quiz-progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Questions */
.quiz-question {
  display: none;
}

.quiz-question.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

.quiz-question h3 {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.quiz-question-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* =========================================
   FORM ELEMENTS
========================================= */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-option:hover {
  border-color: #667eea;
  background: #f9fafb;
}

.quiz-option input[type="radio"],
.quiz-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.quiz-option input[type="radio"]:checked,
.quiz-option input[type="checkbox"]:checked {
  accent-color: #667eea;
}

.quiz-option-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.5;
}

/* Text Inputs */
.email-input,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.email-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
  font-size: 14px;
}

/* =========================================
   RANGE SLIDERS (IMPROVED)
========================================= */
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  outline: none;
  margin: 8px 0;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #667eea;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease;
}

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

.range-value {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.3;
}

.range-label-min,
.range-label-mid,
.range-label-max {
  flex: 1;
  text-align: center;
}

.range-label-min {
  text-align: left;
}

.range-label-max {
  text-align: right;
}

/* =========================================
   BUTTONS
========================================= */
.quiz-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.quiz-btn-next {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.quiz-btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.quiz-btn-next:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  transform: none;
}

.quiz-btn-back {
  background: #f3f4f6;
  color: #374151;
}

.quiz-btn-back:hover {
  background: #e5e7eb;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

/* =========================================
   SYSTEM MESSAGES (IMPROVED)
========================================= */
#systemMsg {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.system-msg-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

.system-msg-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.system-msg-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

.system-msg-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

/* =========================================
   AUTOSAVE INDICATOR (NEW)
========================================= */
.autosave-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #10b981;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.autosave-indicator.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* =========================================
   HARD STOP SCREEN (IMPROVED)
========================================= */
.hard-stop-content {
  text-align: left;
}

.hard-stop-content h4 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 20px 0 10px;
}

.hard-stop-content p {
  line-height: 1.6;
  color: #4b5563;
  margin-bottom: 12px;
}

.resource-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.emergency-btn,
.support-btn {
  display: block;
  padding: 14px 20px;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.emergency-btn {
  background: #dc2626;
  color: white;
}

.emergency-btn:hover {
  background: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.support-btn {
  background: #3b82f6;
  color: white;
}

.support-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.help-text {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  color: #4b5563;
  margin-top: 16px;
}

details {
  margin-top: 16px;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

summary:hover {
  background: #f3f4f6;
}

details[open] summary {
  margin-bottom: 12px;
}

/* =========================================
   REPEATER ITEMS
========================================= */
.repItem {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.repItem:hover {
  border-color: #d1d5db;
}

.repRemove {
  background: #fee2e2;
  color: #991b1b;
  padding: 6px 12px;
  font-size: 13px;
}

.repRemove:hover {
  background: #fecaca;
}

/* =========================================
   CONDITIONAL BOXES
========================================= */
#consultRecommendedBox,
#dentalDetailsBox,
#fhOnsetBox,
#mhBridge,
#medRepeaterBox {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
}

.clusterBlock {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  margin-top: 12px;
}

/* =========================================
   MOBILE OPTIMIZATIONS
========================================= */
@media (max-width: 768px) {
  .nat-hero {
    padding: 40px 20px;
  }

  .nat-hero h1 {
    font-size: 32px;
  }

  .nat-tagline {
    font-size: 16px;
  }

  .quiz-container {
    padding: 20px;
  }

  .quiz-question h3 {
    font-size: 22px;
  }

  .quiz-nav {
    flex-direction: column-reverse;
  }

  .quiz-btn {
    width: 100%;
  }

  .autosave-indicator {
    top: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}

/* Mobile-specific touch targets */
.mobile-optimized input[type="checkbox"],
.mobile-optimized input[type="radio"] {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
}

.mobile-optimized .quiz-option {
  min-height: 48px;
  padding: 12px;
}

.mobile-optimized input[type="range"]::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
}

.mobile-optimized input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
}

/* =========================================
   ACCESSIBILITY
========================================= */
.field-errors {
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

/* Focus visible styles */
*:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #667eea;
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .quiz-option {
    border-width: 3px;
  }

  .quiz-btn {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================
   PRINT STYLES
========================================= */
@media print {
  .nat-hero,
  .quiz-nav,
  #saveBtn,
  #resetBtn,
  #copyResumeBtn,
  .autosave-indicator {
    display: none !important;
  }

  .quiz-question {
    display: block !important;
    page-break-inside: avoid;
  }

  .quiz-container {
    box-shadow: none;
  }
}

/* =========================================
   UTILITY CLASSES
========================================= */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
