@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette - Modern Futuristic Calm Glassmorphism for WHO-5 Well-Being Index */
  --bg-color: #0b1320;
  --bg-secondary: #0f1c2e;
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-hover-border: rgba(20, 184, 166, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-light: rgba(14, 165, 233, 0.15);
  --accent-color: #10b981;
  --accent-hover: #059669;
  --accent-gold: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  --glass-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.65), 0 0 20px rgba(14, 165, 233, 0.08);
  --btn-shadow: 0 4px 16px 0 rgba(14, 165, 233, 0.35);
  --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(14, 165, 233, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 82% 88%, rgba(16, 185, 129, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(15, 28, 46, 0.7) 0%, transparent 100%);
  background-attachment: fixed;
  padding: 1.5rem;
}

.container {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

/* Glassmorphism Card */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.8), rgba(16, 185, 129, 0.8), transparent);
}

.card:hover {
  border-color: var(--card-hover-border);
}

/* Header & Typography */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

h1 {
  font-size: 2.2rem;
  line-height: 1.25;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Badge Pill */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Instructions Box */
.instructions-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.75rem 0;
  text-align: left;
}

.instructions-box h3 {
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.instructions-box p {
  margin-bottom: 0.75rem;
  font-size: 0.98rem;
  color: #cbd5e1;
}

.instructions-box p:last-child {
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--btn-shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(14, 165, 233, 0.5);
  color: #ffffff;
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 16px 0 rgba(16, 185, 129, 0.35);
}

.btn-emerald:hover {
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.5);
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #cbd5e1;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  background: rgba(15, 23, 42, 0.9);
}

.form-group input::placeholder {
  color: #64748b;
}

/* Test Layout and Banner */
.instruction-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(16, 185, 129, 0.15));
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 12px;
  padding: 1.1rem 1.5rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Progress bar */
.progress-container {
  margin-bottom: 1.75rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: 100px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Question Section */
.question-text {
  font-size: 1.35rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.5;
  margin-bottom: 2rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Options Grid */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: #e2e8f0;
  font-size: 1.05rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.option-btn:hover {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.4);
  transform: translateX(4px);
  color: #ffffff;
}

.option-btn:active {
  transform: scale(0.99);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 0.95rem;
  color: #38bdf8;
  margin-right: 1rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.option-btn:hover .option-letter {
  background: #0ea5e9;
  color: #ffffff;
}

/* Reports & Results */
.report-card-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.report-section-title {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 0.6rem;
}

.result-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.result-banner-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.result-banner-subtitle {
  font-size: 1.05rem;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 1rem;
}

.result-motto {
  font-style: italic;
  color: #e2e8f0;
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border-left: 3px solid #10b981;
}

.user-details-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
}

.user-field-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 0.2rem;
}

.user-field-val {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.advice-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.advice-item {
  position: relative;
  padding-left: 1.75rem;
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.65;
}

.advice-item::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 0;
  color: #38bdf8;
  font-size: 1.1rem;
}

.concluding-note {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}

.concluding-note h4 {
  color: #34d399;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.concluding-note p {
  color: #e2e8f0;
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 0;
  font-style: italic;
}

/* Clinical Badge & Tables */
.score-display-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 14px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.score-main {
  text-align: left;
}

.score-num {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.score-denom {
  font-size: 1.1rem;
  color: #94a3b8;
  font-weight: 500;
}

.clinical-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.badge-low {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-norm {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-high {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.clinical-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin: 1.5rem 0;
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.clinical-table th,
.clinical-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.clinical-table th {
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.clinical-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.disclaimer-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.disclaimer-box p {
  color: #fcd34d;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

/* Utility Animations */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hidden {
  display: none !important;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #1e293b !important;
    padding: 0 !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
  }

  .card {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .card::before {
    display: none !important;
  }

  .actions,
  .btn,
  .option-btn:hover {
    display: none !important;
  }

  h1, h2, h3, h4 {
    color: #0f172a !important;
    -webkit-text-fill-color: initial !important;
  }

  p, li, span {
    color: #334155 !important;
  }

  .report-card-box,
  .user-details-card,
  .score-display-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
  }

  .clinical-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
  }

  .clinical-table td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
  }
}

/* Responsiveness */
@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .card {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .question-text {
    font-size: 1.15rem;
  }

  .option-btn {
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
  }

  .score-display-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
