/* ============================================
   INSTINCT QUIZ — Styles
   ============================================ */

/* --- Quiz Container --- */
.quiz {
  min-height: 100vh;
  min-height: 100dvh;
  background: #0A0A0A;
  color: #ffffff;
  font-family: 'General Sans', -apple-system, system-ui, sans-serif;
  position: relative;
  overflow: hidden;
}

/* --- Progress Bar --- */
.quiz__progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 50;
}

.quiz__progress-bar {
  height: 100%;
  background: #7BF1A8;
  transition: width 0.4s ease;
  width: 0%;
}

/* --- Back Button --- */
.quiz__back {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 50;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.quiz__back:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* --- Steps Container --- */
.quiz__steps {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

.quiz__step {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(60px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 0;
}

.quiz__step.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.quiz__step.exit-left {
  opacity: 0;
  transform: translateX(-60px);
  pointer-events: none;
  z-index: 1;
}

.quiz__step-inner {
  width: 100%;
  max-width: 520px;
  padding: 80px 24px 60px;
  margin: 0 auto;
}

.quiz__step-inner--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  text-align: center;
}

/* --- Typography --- */
.quiz__title {
  font-family: 'General Sans', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2rem, 6vw, 3rem);
  text-transform: none;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.quiz__question {
  font-family: 'General Sans', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  line-height: 1.25;
  margin-bottom: 28px;
}

.quiz__subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 32px;
  max-width: 440px;
}

.quiz__dog-name {
  color: #7BF1A8;
}

.quiz__cta .quiz__dog-name {
  color: #0A0A0A;
}

/* --- Inputs --- */
.quiz__input {
  display: block;
  width: 100%;
  font-family: 'General Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 400;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.quiz__input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.quiz__input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.quiz__input--shake {
  animation: inputShake 0.4s ease;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.quiz__label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 10px;
  margin-top: 16px;
}

/* --- Buttons --- */
.quiz__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-align: center;
  font-family: 'General Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 36px;
  border-radius: 60px;
  border: none;
  cursor: pointer;
  background: #7BF1A8;
  color: #0A0A0A;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  margin-top: 24px;
}

.quiz__cta:hover {
  background: #9df5c2;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(123, 241, 168, 0.25);
}

.quiz__cta:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.quiz__skip {
  display: block;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: 'General Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 16px;
  padding: 8px 0;
  transition: color 0.2s;
}

.quiz__skip:hover {
  color: rgba(255, 255, 255, 0.7);
}

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

.quiz__time {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 20px;
}

/* --- Checkbox --- */
.quiz__checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  margin-top: 20px;
  padding: 12px 0;
  user-select: none;
}

.quiz__checkbox input {
  display: none;
}

.quiz__checkbox-mark {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}

.quiz__checkbox input:checked + .quiz__checkbox-mark {
  background: #7BF1A8;
  border-color: #7BF1A8;
}

.quiz__checkbox input:checked + .quiz__checkbox-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 10px;
  border: solid #0A0A0A;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* --- Breed Search --- */
.quiz__breed-search {
  position: relative;
  margin-bottom: 8px;
}

.quiz__breed-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  display: none;
}

.quiz__breed-results.open {
  display: block;
}

.quiz__breed-result {
  padding: 14px 18px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quiz__breed-result:last-child {
  border-bottom: none;
}

.quiz__breed-result:hover {
  background: rgba(255, 255, 255, 0.08);
}

.quiz__breed-result mark {
  background: none;
  color: #7BF1A8;
  font-weight: 600;
}

.quiz__breed-secondary {
  margin-top: 16px;
}

.quiz__confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 18px 32px;
  border-radius: 60px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-family: 'General Sans', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.2s, transform 0.2s;
}

.quiz__confirm-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.quiz__unknown-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-family: 'General Sans', sans-serif;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  transition: border-color 0.2s, color 0.2s;
}

.quiz__unknown-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
}

/* --- Option Cards --- */
.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz__option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'General Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 18px 20px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.quiz__option:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: #1A1A1A;
}

.quiz__option:active {
  transform: scale(0.98);
}

.quiz__option.selected {
  border-color: #7BF1A8;
  background: rgba(123, 241, 168, 0.08);
}

.quiz__option-text {
  display: block;
}

/* --- Loading Animation --- */
.quiz__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.quiz__loading-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  animation: quizSpin 2s linear infinite;
}

.quiz__loading-segment {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
}

.quiz__loading-segment:nth-child(1) { border-top-color: var(--color); transform: rotate(0deg); }
.quiz__loading-segment:nth-child(2) { border-top-color: var(--color); transform: rotate(60deg); }
.quiz__loading-segment:nth-child(3) { border-top-color: var(--color); transform: rotate(120deg); }
.quiz__loading-segment:nth-child(4) { border-top-color: var(--color); transform: rotate(180deg); }
.quiz__loading-segment:nth-child(5) { border-top-color: var(--color); transform: rotate(240deg); }
.quiz__loading-segment:nth-child(6) { border-top-color: var(--color); transform: rotate(300deg); }

@keyframes quizSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Results --- */
.quiz__results-title {
  font-family: 'General Sans', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  text-transform: none;
  margin-bottom: 8px;
}

.quiz__results-breed {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 32px;
}

.quiz__results-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.quiz__bar-row {
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
}

.quiz__bar {
  height: 40px;
  border-radius: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  width: 0;
  overflow: hidden;
}

.quiz__bar-label {
  font-family: 'General Sans', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0.03em;
  color: #0A0A0A;
  white-space: nowrap;
  padding: 0 14px;
}

.quiz__results-summary {
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 32px;
}

.quiz__results-summary strong {
  color: #ffffff;
  font-weight: 600;
}

.quiz__results-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.quiz__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
  font-family: 'General Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 60px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 4px;
}

.quiz__share-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.quiz__share-btn.copied {
  border-color: #7BF1A8;
  color: #7BF1A8;
}

/* --- Results step: allow scrolling for long content --- */
.quiz__step[data-step="8"] {
  align-items: flex-start;
  padding: 80px 24px 60px;
}

/* --- Results Email Capture --- */
.quiz__results-email {
  margin-top: 24px;
}

.quiz__results-email-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 32px;
}

.quiz__email-heading {
  font-family: 'General Sans', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  line-height: 1.3;
  margin-bottom: 8px;
}

.quiz__results-email-intro {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

/* --- Activity Preview Card --- */
.quiz__activity-preview {
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz__activity-preview-title {
  font-family: 'General Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.quiz__activity-preview-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.quiz__email-success {
  padding: 16px 0;
}

/* --- Email Form --- */
.quiz__email-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.quiz__email-form .quiz__cta {
  margin-top: 4px;
}

.quiz__success-title {
  font-family: 'General Sans', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.6rem;
  text-transform: none;
  margin-bottom: 12px;
  color: #7BF1A8;
}

/* --- Data notice & legal --- */
.quiz__data-notice {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 32px;
}

.quiz__data-notice a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.quiz__legal-text {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 16px;
  max-width: 400px;
}

.quiz__legal-text a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.quiz__consent-checkbox {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 0.88rem;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .quiz__step-inner {
    padding: 72px 20px 40px;
  }

  .quiz__title {
    font-size: 1.8rem;
  }

  .quiz__question {
    font-size: 1.3rem;
  }

  .quiz__option {
    padding: 16px 18px;
    font-size: 0.95rem;
  }

  .quiz__bar {
    height: 36px;
    min-width: 70px;
  }

  .quiz__bar-label {
    font-size: 0.72rem;
  }
}
