/* ============================================================
   150 SHADES APP — app.150shades.com
   Quiz engine styles. Requires design-system.css
   ============================================================ */

/* ------------------------------------------------------------
   APP SHELL
   ------------------------------------------------------------ */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-overlay);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
  padding: var(--space-4) 0;
}

.app-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.app-logo {
  font-family: var(--font-headline);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.app-logo em { color: var(--accent-red); font-style: italic; }

/* ------------------------------------------------------------
   PROGRESS BAR
   ------------------------------------------------------------ */
.progress-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  max-width: 400px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-red);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  width: 0%;
}

.progress-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   QUIZ CONTAINER
   ------------------------------------------------------------ */
.quiz-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: var(--space-12) var(--space-4) var(--space-20);
}

/* ------------------------------------------------------------
   SECTION INTRO CARD
   ------------------------------------------------------------ */
.section-intro {
  width: 100%;
  max-width: 640px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-left: 3px solid var(--accent-red);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
  font-style: italic;
}

/* ------------------------------------------------------------
   QUESTION CARD
   ------------------------------------------------------------ */
.question-card {
  width: 100%;
  max-width: 640px;
  animation: fadeSlideIn var(--transition-base) ease;
}

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

.question-number {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: var(--space-4);
}

.question-text {
  font-family: var(--font-headline);
  font-size: var(--text-2xl);
  font-weight: 400;
  color: var(--text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-10);
}

/* ------------------------------------------------------------
   LIKERT SCALE
   ------------------------------------------------------------ */
.likert-scale {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.likert-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.likert-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.likert-options {
  display: flex;
  gap: var(--space-2);
  justify-content: space-between;
}

.likert-option {
  flex: 1;
}

.likert-option input[type="radio"] {
  display: none;
}

.likert-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.likert-option label:hover {
  border-color: var(--accent-red);
  color: var(--text-primary);
  background: var(--surface-elevated);
}

.likert-option input[type="radio"]:checked + label {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--white);
}

/* Scale value labels underneath */
.likert-value-row {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.likert-value-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  flex: 1;
}

/* Neutral center indicator */
.likert-option:nth-child(4) label {
  border-color: rgba(153, 153, 153, 0.3);
}

/* ------------------------------------------------------------
   QUESTION NAV
   ------------------------------------------------------------ */
.question-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.question-nav .btn--back {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  transition: color var(--transition-fast);
}

.question-nav .btn--back:hover {
  color: var(--text-secondary);
}

/* Skip (for context-only meta questions) */
.btn--skip {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-3);
}

/* ------------------------------------------------------------
   SAFETY MODAL
   ------------------------------------------------------------ */
.safety-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.safety-modal {
  width: 100%;
  max-width: 480px;
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl);
}

.safety-modal__icon {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}

.safety-modal__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.safety-modal__body {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.safety-modal__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.safety-modal__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--transition-fast);
}

.safety-modal__link:hover {
  border-color: var(--accent-red);
}

.safety-modal__link-text {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.safety-modal__link-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   RESULTS PAGE
   ------------------------------------------------------------ */
.results-container {
  max-width: 720px;
  margin-inline: auto;
  padding: var(--space-12) var(--space-4) var(--space-20);
}

.results-archetype {
  text-align: center;
  padding: var(--space-16) var(--space-4) var(--space-12);
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: var(--space-12);
}

.results-archetype__label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: var(--space-4);
}

.results-archetype__name {
  font-family: var(--font-headline);
  font-size: var(--text-5xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.results-archetype__tagline {
  font-family: var(--font-headline);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}

.results-archetype__description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 560px;
  margin-inline: auto;
}

/* Category bars */
.results-categories {
  margin-bottom: var(--space-12);
}

.results-section-title {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.category-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.category-bar__label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  width: 200px;
  flex-shrink: 0;
}

.category-bar__track {
  flex: 1;
  height: 8px;
  background: var(--surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.category-bar__fill {
  height: 100%;
  background: var(--accent-red);
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
  width: 0%;
}

.category-bar__pct {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* Share section */
.results-share {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  margin-bottom: var(--space-8);
}

.results-share__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.results-share__subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.share-url-box {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.share-url-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-url-input:read-only { cursor: default; }

/* Upgrade CTA on results */
.results-upgrade {
  background: linear-gradient(135deg, rgba(220,38,38,0.08) 0%, rgba(220,38,38,0.02) 100%);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
}

.results-upgrade__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.results-upgrade__subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.results-upgrade__features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-8);
}

.results-upgrade__feature {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-elevated);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .question-text {
    font-size: var(--text-xl);
  }

  .likert-options {
    gap: var(--space-1);
  }

  .likert-option label {
    height: 44px;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
  }

  .category-bar__label {
    width: 140px;
    font-size: var(--text-xs);
  }

  .results-archetype__name {
    font-size: var(--text-4xl);
  }
}
