/* ============================================================
   Qadamio Quiz — чистый CSS (без Tailwind)
   Токены перенесены один в один из tailwind.config.js
   ============================================================ */

:root {
  --ink: #13221B;
  --graphite: #59675E;
  --canvas: #F7F9F5;

  --brand-50: #EEFDF2;
  --brand-100: #D8F9E1;
  --brand-200: #B4F1C5;
  --brand-300: #82E4A1;
  --brand-400: #48CE77;
  --brand-500: #20B45A;
  --brand-600: #159447;
  --brand-700: #14763C;
  --brand-800: #145F35;
  --brand-900: #124E2E;

  --shadow-soft: 0 24px 80px rgba(29, 79, 48, 0.10);
  --shadow-card: 0 12px 36px rgba(29, 79, 48, 0.08);
  --shadow-glow: 0 18px 48px rgba(32, 180, 90, 0.25);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);

  --soft-grid: linear-gradient(rgba(22, 84, 48, 0.05) 1px, transparent 1px),
               linear-gradient(90deg, rgba(22, 84, 48, 0.05) 1px, transparent 1px);
  --page-glow: radial-gradient(circle at 82% 10%, rgba(130, 228, 161, 0.30), transparent 34%),
               radial-gradient(circle at 10% 25%, rgba(216, 249, 225, 0.72), transparent 36%);

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html { min-width: 320px; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input { font: inherit; }

::selection { background: var(--brand-200); color: var(--brand-900); }

h1, p, span, label { margin: 0; }

svg { display: block; }

/* ---------- каркас страницы ---------- */
.page-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--canvas);
  background-image: var(--page-glow);
}

.page-grid {
  display: flex;
  flex: 1;
  align-items: center;
  background-image: var(--soft-grid);
  background-size: 48px 48px;
  padding-block: 40px;
}

.container-page {
  margin-inline: auto;
  width: 100%;
  max-width: 72rem;
  padding-inline: 20px;
}

.panel {
  border-radius: 28px;
  border: 1px solid rgba(180, 241, 197, 0.8);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.panel--start { margin-inline: auto; max-width: 56rem; overflow: hidden; }
.panel--question { margin-inline: auto; max-width: 48rem; padding: 20px; }
.panel--reg { margin-inline: auto; max-width: 42rem; padding: 20px; }
.panel--thanks { margin-inline: auto; max-width: 48rem; padding: 24px; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--brand-200);
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.eyebrow__dot {
  height: 6px;
  width: 6px;
  border-radius: 999px;
  background: var(--brand-500);
  flex-shrink: 0;
}

.icon { width: 1.25rem; height: 1.25rem; }
.icon--sm { width: 1rem; height: 1rem; }

/* ---------- кнопки ---------- */
.primary-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid var(--brand-400);
  background: linear-gradient(to right, var(--brand-500), var(--brand-600));
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow-glow);
  transition: transform .2s, background .2s;
  cursor: pointer;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(to right, var(--brand-600), var(--brand-700));
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: var(--brand-200);
  background: var(--brand-200);
  color: rgba(255, 255, 255, 0.8);
  box-shadow: none;
  transform: none;
}

.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 6px var(--brand-200);
}

/* ---------- логотип / хедер / футер ---------- */
.header {
  border-bottom: 1px solid var(--brand-100);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px;
}

.header__inner--compact { padding-block: 16px; }

.logo { display: inline-flex; align-items: center; gap: 12px; }

.logo__mark {
  position: relative;
  display: grid;
  place-items: center;
  height: 44px;
  width: 44px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.logo__dot {
  position: absolute;
  right: -4px;
  top: -4px;
  height: 20px;
  width: 20px;
  border-radius: 999px;
  background: rgba(130, 228, 161, 0.7);
}

.logo__glyph { position: relative; height: 24px; width: 24px; }

.logo__img {
  display: block;
  flex-shrink: 0;
  height: 48px;
  width: 48px;
  object-fit: contain;
}

.logo__text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.header__badge {
  display: none;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--brand-100);
  background: var(--brand-50);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-800);
}

.footer {
  border-top: 1px solid var(--brand-100);
  background: rgba(255, 255, 255, 0.7);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block: 20px;
  font-size: 0.75rem;
  color: var(--graphite);
}

/* ============================================================
   СТАРТ
   ============================================================ */
.start__box { position: relative; padding: 36px 24px; }

.start__blur {
  position: absolute;
  right: 0;
  top: 0;
  height: 176px;
  width: 176px;
  border-radius: 999px;
  background: rgba(180, 241, 197, 0.45);
  filter: blur(64px);
}

.start__content { position: relative; }

.start__title {
  margin-top: 24px;
  max-width: 48rem;
  font-size: 2.25rem;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.055em;
  color: var(--ink);
}

.start__lead {
  margin-top: 20px;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.75rem;
  color: var(--graphite);
}

.start__steps {
  margin-top: 32px;
  display: grid;
  gap: 12px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--brand-100);
  background: rgba(238, 253, 242, 0.65);
  padding: 16px;
}

.step__icon {
  display: grid;
  height: 40px;
  width: 40px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

.step__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--brand-600);
}

.step__title {
  margin-top: 2px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
  color: var(--ink);
}

.start__cta { margin-top: 32px; width: 100%; }

/* ============================================================
   ВОПРОС
   ============================================================ */
.progress__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-700);
}

.progress__track {
  margin-top: 12px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--brand-100);
}

.progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brand-400), var(--brand-600));
  transition: width .3s;
}

.question__title {
  margin-top: 32px;
  font-size: 1.875rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.options {
  margin-top: 28px;
  display: grid;
  gap: 12px;
}

.option {
  display: flex;
  min-height: 64px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 16px;
  border: 1px solid var(--brand-100);
  background: #fff;
  padding: 16px;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .2s, background .2s, box-shadow .2s;
  cursor: pointer;
}

.option:hover {
  border-color: var(--brand-300);
  background: rgba(238, 253, 242, 0.6);
}

.option--selected {
  border-color: var(--brand-400);
  background: var(--brand-50);
  color: var(--brand-900);
  box-shadow: 0 8px 24px rgba(32, 180, 90, 0.12);
}

.option__check {
  display: grid;
  height: 24px;
  width: 24px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--brand-200);
  background: #fff;
  color: transparent;
}

.option--selected .option__check {
  border-color: var(--brand-500);
  background: var(--brand-500);
  color: #fff;
}

.question__foot {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

.question__next { width: 100%; }

/* ============================================================
   РЕГИСТРАЦИЯ
   ============================================================ */
.reg__title {
  margin-top: 20px;
  font-size: 1.875rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.reg__lead {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.75rem;
  color: var(--graphite);
}

.reg__form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-label { display: block; }

.field-label__text {
  margin-bottom: 8px;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ink);
}

.field {
  height: 56px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--brand-100);
  background: #fff;
  padding-inline: 16px;
  font-size: 1rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color .2s;
}

.field::placeholder { color: #94a3b8; }
.field:hover { border-color: var(--brand-200); }
.field:focus { border-color: var(--brand-400); }
.field:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 6px var(--brand-200);
}

.consent {
  display: flex;
  cursor: pointer;
  align-items: flex-start;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid var(--brand-100);
  background: rgba(238, 253, 242, 0.55);
  padding: 16px;
}

.consent__box {
  margin-top: 2px;
  height: 20px;
  width: 20px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--brand-300);
  accent-color: var(--brand-600);
}

.consent__box:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-300);
}

.consent__text {
  font-size: 0.875rem;
  line-height: 1.5rem;
  color: var(--graphite);
}

.reg__submit { width: 100%; }

/* ============================================================
   СПАСИБО
   ============================================================ */
.thanks__icon {
  margin-inline: auto;
  display: grid;
  height: 64px;
  width: 64px;
  place-items: center;
  border-radius: 24px;
  background: var(--brand-600);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.thanks__eyebrow { margin-top: 24px; }

.thanks__title {
  margin-top: 20px;
  font-size: 2.25rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.thanks__text {
  margin-inline: auto;
  margin-top: 16px;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.75rem;
  color: var(--graphite);
}

/* ============================================================
   АНИМАЦИИ
   ============================================================ */
.animate-fadeUp { animation: fadeUp .38s ease-out both; }

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

@keyframes pulseSoft {
  0%, 100% { opacity: .45; }
  50% { opacity: .9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (min-width: 640px) {
  .container-page { padding-inline: 28px; }
  .page-grid { padding-block: 56px; }

  .header__badge { display: inline-flex; }

  .panel--question { padding: 32px; }
  .panel--reg { padding: 32px; }
  .panel--thanks { padding: 40px; }

  .start__box { padding: 48px 40px; }
  .start__title { font-size: 3rem; }
  .start__lead { font-size: 1.125rem; }
  .start__steps { grid-template-columns: repeat(2, 1fr); }
  .start__cta { width: auto; }

  .question__title { font-size: 2.25rem; }
  .option { padding-inline: 20px; }
  .question__next { width: auto; min-width: 11rem; }

  .reg__title { font-size: 2.25rem; }

  .thanks__title { font-size: 3rem; }
  .thanks__text { font-size: 1.125rem; }

  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .container-page { padding-inline: 40px; }
  .page-grid { padding-block: 80px; }

  .start__box { padding: 56px; }
  .start__title { font-size: 3.75rem; }

  .panel--question { padding: 40px; }
  .panel--reg { padding: 40px; }
  .panel--thanks { padding: 48px; }

  .thanks__title { font-size: 3rem; }
}

/* ============================================================
   ПРЕЛОАДЕР
   ============================================================ */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(247, 249, 245, 0.82);
  backdrop-filter: blur(4px);
}

#loader img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
}

/* ============================================================
   ОШИБКИ ВАЛИДАЦИИ
   ============================================================ */
.error {
  display: none;
  margin-top: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #d92d20;
}

.error.active {
  display: block;
}

.field-label:has(.error.active) .field {
  border-color: #f97066;
  box-shadow: 0 0 0 3px rgba(240, 68, 56, 0.12);
}

/* ============================================================
   УНИВЕРСАЛЬНОЕ МОДАЛЬНОЕ ОКНО
   ============================================================ */
.universal-modal-open {
  overflow: hidden;
}

.universal-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(19, 34, 27, 0.55);
  backdrop-filter: blur(4px);
  animation: fadeUp 0.25s ease-out both;
}

.universal-modal-content {
  position: relative;
  width: 100%;
  max-width: 26rem;
  border-radius: 24px;
  border: 1px solid rgba(180, 241, 197, 0.8);
  background: #fff;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.universal-modal-content p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.universal-modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  height: 28px;
  width: 28px;
  cursor: pointer;
  border-radius: 999px;
  background: var(--brand-50);
}

.universal-modal-close::before,
.universal-modal-close::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  height: 2px;
  width: 14px;
  background: var(--brand-700);
  border-radius: 2px;
}

.universal-modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.universal-modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
