/* ===== CSS Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #14b8a6;
  --primary-dark: #0d9488;
  --secondary: #06b6d4;
  --accent: #f472b6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --critical: #dc2626;

  --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 50%, #e0e7ff 100%);
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

/* ===== Modal Styles ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 40px 40px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.modal-logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 10px;
}

.modal-body {
  padding: 30px 40px;
}

.disclaimer-icon {
  text-align: center;
  color: var(--primary);
  margin-bottom: 20px;
}

.disclaimer-text {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.disclaimer-note {
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  padding: 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  margin-top: 20px;
}

.disclaimer-note p {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.modal-footer {
  padding: 20px 40px 40px;
  text-align: center;
}

/* ===== Container & Layout ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.container.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  max-width: 250px;
  height: auto;
  margin-bottom: 20px;
  animation: fadeInDown 0.8s ease;
}

.main-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  animation: fadeInUp 0.8s ease 0.4s both;
}

/* ===== Step Indicator ===== */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  padding: 0 20px;
  animation: fadeIn 0.8s ease 0.6s both;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.step::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: -1;
}

.step:first-child::before {
  display: none;
}

.step.active {
  opacity: 1;
}

.step.completed .step-number {
  background: var(--success);
  border-color: var(--success);
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.step.active .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.step-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== Form Card ===== */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  display: none;
  animation: slideInUp 0.5s ease;
}

.form-card.active {
  display: block;
}

.card-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.card-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* ===== Form Elements ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.3s ease;
  background: white;
  color: var(--text-primary);
}

.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(20, 184, 166, 0.1);
}

.contact-fields {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.contact-fields.active {
  max-height: 500px;
}

/* ===== Quiz Questions ===== */
.quiz-questions {
  margin-bottom: 30px;
}

.question-item {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease both;
}

.question-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.question-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: block;
  font-size: 16px;
}

.question-item select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.question-item select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.radio-group {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

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

.conditional-field {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.conditional-field.active {
  max-height: 400px;
}

.conditional-field input,
.conditional-field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-top: 8px;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary {
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 2px solid var(--border);
}

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

.button-group {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 30px;
}

/* ===== Results Styles ===== */
.results-container {
  text-align: center;
}

.results-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
}

.results-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
}

.results-score {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

.score-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
}

.score-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.score-value {
  font-size: 28px;
  font-weight: 700;
}

.results-message {
  background: white;
  padding: 24px;
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  margin: 20px 0;
  text-align: left;
}

.results-message h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.results-message p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.risk-low {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.risk-low .results-icon {
  background: #10b981;
  color: white;
}

.risk-low .results-message {
  border-color: #10b981;
}

.risk-moderate {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.risk-moderate .results-icon {
  background: #f59e0b;
  color: white;
}

.risk-moderate .results-message {
  border-color: #f59e0b;
}

.risk-high {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.risk-high .results-icon {
  background: #ef4444;
  color: white;
}

.risk-high .results-message {
  border-color: #ef4444;
}

.risk-critical {
  background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
  color: #7f1d1d;
}

.risk-critical .results-icon {
  background: #dc2626;
  color: white;
}

.risk-critical .results-message {
  border-color: #dc2626;
}

.emergency-contact {
  background: #fee2e2;
  border: 2px solid #ef4444;
  padding: 20px;
  border-radius: var(--radius-lg);
  margin: 20px 0;
}

.emergency-contact h3 {
  color: #991b1b;
  margin-bottom: 12px;
}

.emergency-contact p {
  color: #7f1d1d;
  font-weight: 600;
  font-size: 18px;
}

/* ===== Footer ===== */
.footer {
  margin-top: 60px;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl);
  color: white;
  text-align: center;
}

.footer-content p {
  margin-bottom: 10px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.footer-links a:hover {
  opacity: 0.8;
}

.footer-note {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 16px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .main-title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 16px;
  }

  .form-card {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .step-indicator {
    padding: 0;
  }

  .step-label {
    font-size: 10px;
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .button-group {
    flex-direction: column;
  }

  .results-score {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 20px;
  }
}
