@font-face {
  font-family: 'Forma DJR Text';
  src: url('../fonts/FormaDJRCyrillicText-Light-Testing.woff2') format('woff2'),
       url('../fonts/FormaDJRCyrillicText-Light-Testing.woff') format('woff'),
       url('../fonts/Forma DJR Text-Light-Desktop.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Forma DJR Text';
  src: url('../fonts/FormaDJRCyrillicText-Regular-Testing.woff2') format('woff2'),
       url('../fonts/FormaDJRCyrillicText-Regular-Testing.woff') format('woff'),
       url('../fonts/Forma DJR Text-Regular-Desktop.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --transition-duration: .25s;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Forma DJR Text';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100%;
}

/* важно: фон html прозрачный, чтобы везде тянулся фон body */
html {
  background: transparent;
}

body {
  margin: 0;
  padding: 0 0 var(--safe-bottom);
  line-height: 1.4;
  color: rgba(255, 255, 255, .9);
  background-image: url("../images/backgrounds/background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  position: relative;
}

@media (max-width: 768px) {
  body {
    background-image: url("../images/backgrounds/background1.jpg");
  }
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  z-index: 100;
}

.app-header .wordmark {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  text-shadow: none;
  text-decoration: none;
}

.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  position: relative;
}

body[data-page="results"] .app-main {
  display: block;
  padding: 0;
}

.brand-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0 20px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  opacity: .35;
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .brand-mark {
    width: 56px;
    height: 56px;
  }
}

.brand-caption {
  font-size: 12px;
  color: rgba(255, 255, 255, .8);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.hero > * + * {
  margin-top: 16px;
}

.eyebrow {
  font-weight: 300;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .85);
}

.card,
.quiz-card,
.analysis-card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  padding: 24px;
}

.cta-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 360px;
  gap: 12px;
}

.pill {
  display: block;
  width: 100%;
  padding: 12px 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: transparent;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--transition-duration),
    box-shadow var(--transition-duration);
}

.pill:hover,
.pill:focus {
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .18);
  outline: none;
}

body[data-page="simple-quiz"] .quiz-wrap,
body[data-page="deep-quiz"] .quiz-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

body[data-page="simple-quiz"] .progress-label,
body[data-page="deep-quiz"] .progress-label {
  font-size: 14px;
  letter-spacing: .02em;
  color: rgba(255, 255, 255, .9);
  margin-bottom: 12px;
  text-align: center;
}

body[data-page="simple-quiz"] .quiz-card,
body[data-page="deep-quiz"] .quiz-card {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  padding: 24px;
}

body[data-page="simple-quiz"] .quiz-question,
body[data-page="deep-quiz"] .quiz-question {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
}

body[data-page="simple-quiz"] .option-pill {
  width: 100%;
  padding: 10px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: transparent;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0;
  cursor: pointer;
  text-align: center;
  transition:
    background var(--transition-duration),
    outline var(--transition-duration);
}

body[data-page="simple-quiz"] .option-pill + .option-pill {
  margin-top: 8px;
}

body[data-page="simple-quiz"] .option-pill:hover,
body[data-page="simple-quiz"] .option-pill:focus {
  background: rgba(255, 255, 255, .12);
  outline: 2px solid rgba(255, 255, 255, .18);
  outline-offset: 2px;
}

body[data-page="simple-quiz"] .hint-link,
body[data-page="deep-quiz"] .hint-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .9);
  margin-top: 8px;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

body[data-page="simple-quiz"] .hint-text,
body[data-page="deep-quiz"] .hint-text {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, .8);
}

body[data-page="simple-quiz"] .inline-error,
body[data-page="deep-quiz"] .inline-error {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 80, 80, .9);
}

body[data-page="simple-quiz"] .back-pill,
body[data-page="deep-quiz"] .back-pill {
  margin-top: 16px;
}

body[data-page="simple-quiz"] .back-pill,
body[data-page="deep-quiz"] .back-pill,
body[data-page="deep-quiz"] .cta-pill {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: transparent;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0;
  cursor: pointer;
  text-align: center;
  transition:
    background var(--transition-duration),
    box-shadow var(--transition-duration);
}

body[data-page="deep-quiz"] .cta-pill {
  flex: 1;
  margin-left: 8px;
}

body[data-page="simple-quiz"] .back-pill:hover,
body[data-page="deep-quiz"] .back-pill:hover,
body[data-page="deep-quiz"] .cta-pill:hover,
body[data-page="simple-quiz"] .back-pill:focus,
body[data-page="deep-quiz"] .back-pill:focus,
body[data-page="deep-quiz"] .cta-pill:focus {
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .18);
  outline: none;
}

body[data-page="deep-quiz"] .textarea-pill {
  width: 100%;
  height: 130px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  resize: vertical;
  font-size: 14px;
  margin-bottom: 8px;
}

body[data-page="deep-quiz"] .textarea-pill::placeholder {
  color: rgba(255, 255, 255, .55);
}

/* результаты: общие элементы (кроме layout ароматов, они в results_v10.css) */

body[data-page="results"] .bars {
  margin-top: 24px;
  margin-bottom: 24px;
}

body[data-page="results"] .result-bar {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
}

body[data-page="results"] .bar-label {
  width: 80px;
  font-weight: 500;
  text-align: left;
}

body[data-page="results"] .bar-track {
  flex: 1;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: transparent;
  border-radius: 999px;
  overflow: hidden;
}

body[data-page="results"] .bar-fill {
  height: 100%;
  background: rgba(255, 255, 255, .9);
  border-radius: inherit;
  width: 0%;
  transition: width 900ms cubic-bezier(.2, .7, .2, 1);
}

body[data-page="results"] .bar-value {
  width: 48px;
  text-align: right;
  font-weight: 500;
}

body[data-page="results"] .disclaimer {
  font-size: 12px;
  color: rgba(255, 255, 255, .8);
  margin-top: 24px;
}

body[data-page="results"] .analysis-card {
  margin-top: 24px;
  padding: 20px;
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

body:not([data-page="results"]) .results-root,
body:not([data-page="results"]) .results-hero,
body:not([data-page="results"]) .fragrance-screen {
  display: none !important;
}

body[data-page="results"] .results-hero {
  min-height: calc(100svh - var(--header-h, 72px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 48px);
  width: 100%;
  grid-column: 1 / -1;
  float: none;
}

body[data-page="results"] .results-hero .hero-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
}

body[data-page="results"] .results-hero .insight-pill {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .95rem;
}

body[data-page="results"] .results-hero,
body[data-page="results"] .results-hero * {
  float: none;
}

body[data-page="results"] .results-root {
  scroll-snap-type: y proximity;
  overflow: visible;
}

@supports (scroll-snap-type: y proximity) {
  body[data-page="results"] {
    scroll-behavior: smooth;
  }
}

/* layout ароматов перенесен в results_v10.css */

/* финальный CTA на странице результатов (структура, не фон) */

body[data-page="results"] .brand-cta {
  min-height: calc(100svh - var(--footer-h, 120px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  text-align: center;
  color: #fff;
}

body[data-page="results"] .brand-cta a {
  color: #fff;
  text-decoration: underline;
  font-size: clamp(18px, 2.2vw, 24px);
}

/* оверлей загрузки */

#loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  z-index: 1000;
}

#loading-overlay .loader-text {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

/* === Кнопки навигации в deep-quiz: ровные и одного размера === */

body.assessment-page[data-page="deep-quiz"] .quiz-wrap > div:last-child {
  /* контейнер с двумя кнопками */
  max-width: 560px;
  width: 100%;
  margin: 24px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

body.assessment-page[data-page="deep-quiz"] .quiz-wrap .back-pill,
body.assessment-page[data-page="deep-quiz"] .quiz-wrap .cta-pill {
  flex: 1 1 0;   /* обе кнопки занимают по половине строки */
  width: auto;   /* перебиваем возможный width: 100% */
  margin: 0;     /* убираем лишние отступы, все контролирует gap */
}

/* На очень узких экранах стекаем кнопки в колонку, но они остаются равными */

@media (max-width: 480px) {
  body.assessment-page[data-page="deep-quiz"] .quiz-wrap > div:last-child {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  body.assessment-page[data-page="deep-quiz"] .quiz-wrap .back-pill,
  body.assessment-page[data-page="deep-quiz"] .quiz-wrap .cta-pill {
    width: 100%;
  }
}
