/* ================================================================
   ASSESSMENT QUIZ — Dark Theme Stylesheet
   Dental Practice Scorecard Quiz for Compass Dental
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* --- Base Reset for Quiz --- */
.aq-container *,
.aq-container *::before,
.aq-container *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================================================================
   1. PROGRESS BAR
   ================================================================ */

.aq-progress {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 12px 24px;
  background: #0a0f1a;
}

.aq-progress__bar {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.aq-progress__fill {
  height: 100%;
  background: #0097a7;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.aq-progress__label,
.aq-progress__text {
  display: block;
  text-align: center;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ================================================================
   2. QUIZ CONTAINER
   ================================================================ */

.aq-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #ffffff;
  line-height: 1.6;
}

/* ================================================================
   3. STEPS
   ================================================================ */

.aq-step {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.aq-step--active {
  display: block;
  opacity: 1;
}

/* ================================================================
   4. CONTACT FORM
   ================================================================ */

.aq-contact {
  background: #111927;
  border-radius: 16px;
  padding: 32px;
}

.aq-contact__title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.aq-contact__subtitle {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 28px;
}

.aq-contact__field {
  margin-bottom: 20px;
}

.aq-contact__label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.aq-contact__label--optional,
.aq-contact__optional {
  font-weight: 400;
  color: #64748b;
  font-size: 13px;
}

.aq-contact__required {
  color: #0097a7;
}

.aq-contact__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: #ffffff;
  background: #0e1525;
  border: 2px solid #1e293b;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.aq-contact__input::placeholder {
  color: #64748b;
}

.aq-contact__input:focus {
  border-color: #0097a7;
  box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.15);
}

.aq-contact__input--error {
  border-color: #ef4444;
}

.aq-contact__error {
  font-size: 13px;
  color: #ef4444;
  margin-top: 6px;
  display: none;
}

.aq-contact__error--visible {
  display: block;
}

/* ================================================================
   5. QUESTION CARD
   ================================================================ */

.aq-question {
  background: #111927;
  border-radius: 16px;
  padding: 32px;
}

.aq-question__number {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.aq-question__text {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 28px;
}

.aq-question__description {
  font-size: 15px;
  color: #94a3b8;
  margin-top: -16px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ================================================================
   6. OPTION BUTTONS
   ================================================================ */

.aq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aq-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  text-align: left;
  background: #0e1525;
  border: 2px solid #1e293b;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease,
              background-color 0.2s ease,
              box-shadow 0.2s ease;
  position: relative;
}

.aq-option:hover {
  border-color: #0097a7;
  box-shadow: 0 0 12px rgba(0, 151, 167, 0.12);
}

.aq-option:focus-visible {
  border-color: #0097a7;
  box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.2);
}

.aq-option--selected {
  border-color: #0097a7;
  background: rgba(0, 151, 167, 0.1);
  border-left-width: 4px;
}

.aq-option--selected::after {
  content: '\2713';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  color: #0097a7;
}

/* ================================================================
   7. YES/NO BINARY OPTIONS
   ================================================================ */

.aq-options--binary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.aq-options--binary .aq-option {
  justify-content: center;
  text-align: center;
}

/* ================================================================
   8. OPEN TEXT / TEXTAREA
   ================================================================ */

.aq-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: #ffffff;
  background: #0e1525;
  border: 2px solid #1e293b;
  border-radius: 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.aq-textarea::placeholder {
  color: #64748b;
}

.aq-textarea:focus {
  border-color: #0097a7;
  box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.15);
}

/* ================================================================
   9. NAVIGATION & BUTTONS
   ================================================================ */

.aq-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 16px;
}

.aq-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0097a7;
  background: rgba(0, 151, 167, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 12px;
  margin-bottom: 16px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.aq-back:hover {
  background: rgba(0, 151, 167, 0.2);
  color: #ffffff;
}

.aq-back:focus-visible {
  outline: 2px solid #0097a7;
  outline-offset: 2px;
}

.aq-container .aq-btn,
a.aq-btn,
button.aq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 32px;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  min-width: 160px;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1;
}

.aq-container .aq-btn--primary,
a.aq-btn--primary,
button.aq-btn--primary {
  color: #ffffff;
  background-color: #0097a7;
}

.aq-container .aq-btn--primary:hover,
a.aq-btn--primary:hover,
button.aq-btn--primary:hover {
  background-color: #00838f;
  box-shadow: 0 4px 20px rgba(0, 151, 167, 0.3);
  color: #ffffff;
}

.aq-container .aq-btn--primary:focus-visible {
  outline: 2px solid #0097a7;
  outline-offset: 2px;
}

.aq-container .aq-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.aq-container .aq-btn--outline,
a.aq-btn--outline {
  color: #0097a7;
  background-color: transparent;
  border: 2px solid #0097a7;
}

.aq-container .aq-btn--outline:hover,
a.aq-btn--outline:hover {
  background-color: rgba(0, 151, 167, 0.1);
  color: #ffffff;
}

/* ================================================================
   10. RESULTS SECTION
   ================================================================ */

.aq-results {
  text-align: center;
}

/* --- Score Gauge --- */

.aq-gauge {
  margin-bottom: 32px;
}

.aq-gauge__score {
  font-size: 48px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  margin-bottom: 8px;
}

.aq-gauge__score span {
  font-size: 24px;
  font-weight: 400;
  color: #64748b;
}

.aq-gauge__bar {
  width: 100%;
  height: 16px;
  background: #1e293b;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.aq-gauge__fill {
  height: 100%;
  border-radius: 8px;
  width: 0%;
  transition: width 0.15s ease-out;
}

.aq-gauge__fill--animate {
  transition: width 1s ease-out;
  width: var(--score-pct, 0%);
}

.aq-gauge__fill--high {
  background: #10b981;
}

.aq-gauge__fill--medium {
  background: #f59e0b;
}

.aq-gauge__fill--low {
  background: #ef4444;
}

.aq-gauge__tier {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.aq-gauge__tier--high {
  color: #10b981;
}

.aq-gauge__tier--medium {
  color: #f59e0b;
}

.aq-gauge__tier--low {
  color: #ef4444;
}

/* --- Results Headline --- */

.aq-headline {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* --- Insight Cards --- */

.aq-insights {
  text-align: left;
  margin-bottom: 32px;
}

.aq-insights__title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
}

.aq-insight {
  background: #111927;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  border-left: 4px solid #0097a7;
}

.aq-insight:last-child {
  margin-bottom: 0;
}

.aq-insight__title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.aq-insight__text {
  font-size: 15px;
  color: #94a3b8;
  line-height: 1.55;
}

/* --- Next Step CTA --- */

.aq-nextstep {
  background: #111927;
  border-radius: 16px;
  padding: 32px;
  margin-top: 32px;
}

.aq-nextstep__title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
}

.aq-nextstep__text {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 24px;
  line-height: 1.55;
}

.aq-nextstep__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aq-nextstep .aq-btn {
  width: 100%;
}

/* ================================================================
   11. LOADING SPINNER
   ================================================================ */

.aq-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.aq-spinner__circle {
  width: 40px;
  height: 40px;
  border: 3px solid #1e293b;
  border-top-color: #0097a7;
  border-radius: 50%;
  animation: aq-spin 0.8s linear infinite;
}

.aq-spinner__text {
  font-size: 15px;
  color: #94a3b8;
  margin-top: 16px;
}

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

/* ================================================================
   13. ANIMATIONS
   ================================================================ */

.aq-fade-in {
  animation: aq-fadeIn 0.3s ease forwards;
}

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

.aq-gauge-fill {
  width: 0%;
}

.aq-gauge-fill--animate {
  transition: width 1s ease-out;
  width: var(--score-pct, 0%);
}

/* ================================================================
   12. RESPONSIVE — Mobile (max-width: 640px)
   ================================================================ */

@media (max-width: 640px) {
  .aq-container {
    padding: 16px;
  }

  .aq-progress {
    padding: 10px 16px;
  }

  .aq-contact,
  .aq-question {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .aq-contact__title,
  .aq-question__text {
    font-size: 20px;
  }

  .aq-options--binary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .aq-nav {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .aq-btn {
    width: 100%;
  }

  .aq-back {
    align-self: flex-start;
  }

  .aq-gauge__score {
    font-size: 40px;
  }

  .aq-headline {
    font-size: 22px;
  }

  .aq-nextstep {
    padding: 24px 20px;
  }

  .aq-nextstep__actions {
    flex-direction: column;
  }
}
