* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 16px;
}

.container {
  max-width: 100%;
  padding: 0 16px;
}

.screen {
  display: none !important;
  min-height: 100vh;
  width: 100%;
}

.screen.active {
  display: block !important;
}

/* Welcome Screen - Full Width */
#welcome-screen {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 16px 60px;
  width: 100%;
}

.welcome-content {
  width: 100%;
  max-width: 600px;
}

.logo-section {
  text-align: center;
  margin-bottom: 24px;
}

.logo-section h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-light);
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-text {
  background: transparent;
  color: var(--text-light);
}

.invite-text {
  text-align: center;
  margin-top: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.time-estimate {
  text-align: center;
  margin-top: 20px;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* Assessment Header */
.assessment-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.header-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
  width: auto;
}

/* Assessment Container */
.assessment-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.intro-section {
  text-align: center;
}

.intro-section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.intro-section p {
  color: var(--text-light);
  margin-bottom: 12px;
}

.intro-section .note {
  font-size: 0.85rem;
  background: #fef3c7;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: left;
}

/* Question Card */
.question-card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.question-header {
  margin-bottom: 24px;
}

.section-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.question-header h3 {
  font-size: 1.125rem;
  line-height: 1.4;
}

.answer-options {
  margin-bottom: 24px;
}

.text-input,
.textarea-input,
.select-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}

.textarea-input {
  min-height: 100px;
  resize: vertical;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-option:hover {
  background: var(--border);
}

.checkbox-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checkbox-option span {
  font-size: 0.95rem;
}

.scale-container {
  text-align: center;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.scale-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.scale-btn {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.scale-btn:hover {
  border-color: var(--primary);
}

.scale-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.navigation-buttons {
  display: flex;
  gap: 12px;
}

.navigation-buttons .btn {
  flex: 1;
}

/* Step Complete */
.step-complete {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.step-complete h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.step-complete p {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Results Screen */
#results-screen {
  padding: 20px 16px 60px;
}

.results-header {
  text-align: center;
  margin-bottom: 24px;
}

.results-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.results-header p {
  color: var(--text-light);
}

.score-card {
  background: var(--card);
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.total-score {
  margin-bottom: 16px;
}

.score-number {
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.score-label {
  display: block;
  font-size: 1rem;
  color: var(--text-light);
  margin-top: 4px;
}

.interpretation {
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  background: var(--bg);
  border-radius: 8px;
  display: inline-block;
}

.category-scores {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.category {
  margin-bottom: 20px;
}

.category:last-child {
  margin-bottom: 0;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.cat-score {
  font-weight: 600;
  color: var(--primary);
}

.cat-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.cat-fill {
  height: 100%;
  background: var(--primary);
  transition: width 1s ease;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-content {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  max-width: 800px;
  width: 100%;
  position: relative;
  margin-bottom: 20px;
}

#assessment-detail {
  overflow-y: visible;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.invite-item {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.85rem;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  
  .logo-section h1 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 20px 16px;
    border-radius: 12px;
  }
  
  .question-card {
    padding: 20px 16px;
  }
  
  .question-header h3 {
    font-size: 1rem;
  }
  
  .scale-btn {
    width: 44px;
    height: 44px;
    font-size: 0.95rem;
  }
  
  .score-number {
    font-size: 3rem;
  }
  
  .cat-header span:first-child {
    font-size: 0.8rem;
  }
  
  .btn {
    padding: 14px 20px;
    font-size: 0.95rem;
  }
  
  .header-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Very Small Screens */
@media (max-width: 380px) {
  .scale-btn {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
  
  .scale-buttons {
    gap: 6px;
  }
  
  .checkbox-option {
    padding: 12px 14px;
  }
  
  .checkbox-option span {
    font-size: 0.9rem;
  }
}

/* Prevent zoom on inputs (iOS) */
@media screen and (max-width: 640px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Loading spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* File upload */
.file-upload {
  text-align: center;
}

.file-upload input {
  display: none;
}

.file-label {
  display: inline-block;
  padding: 20px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s;
}

.file-label:hover {
  border-color: var(--primary);
}
