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

:root {
  --bg: #f6f5f2;
  --bg-card: #ffffff;
  --text: #141414;
  --text-muted: #6b6b6b;
  --text-light: #999;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.08);
  --accent-ring: rgba(99, 102, 241, 0.25);
  --border: #e8e6e1;
  --error: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 32px rgba(20, 20, 20, 0.06);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'DM Sans', system-ui, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body.is-page {
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

.container--wide {
  max-width: 800px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

.brand:hover {
  opacity: 0.85;
}

.brand__logo {
  display: block;
  width: auto;
  height: 36px;
  max-width: 180px;
  object-fit: contain;
}

/* Top bar */
.topbar {
  padding: 20px 0;
}

.topbar__inner {
  display: flex;
  justify-content: center;
}

/* Main layout */
.main {
  flex: 1;
  padding: 8px 0 64px;
}

.intro {
  text-align: center;
  margin-bottom: 36px;
}

.intro__photo {
  width: 100%;
  height: 200px;
  max-height: 200px;
  margin-bottom: 28px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.intro__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.intro__title {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 5vw, 2.625rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.intro__text {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* Quiz card */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow);
}

.quiz-card__progress {
  margin-bottom: 28px;
}

.quiz-card__progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quiz-card__step-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.quiz-card__step-count {
  font-size: 0.75rem;
  color: var(--text-light);
}

.quiz-card__bar {
  height: 3px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.quiz-card__bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  width: 25%;
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-step {
  display: none;
}

.quiz-step.is-active {
  display: block;
  animation: stepIn 0.35s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .quiz-step.is-active {
    animation: none;
  }

  .quiz-card__bar-fill,
  .btn,
  .option {
    transition: none;
  }
}

.quiz-step__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  line-height: 1.35;
}

.quiz-step__desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 22px;
}

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

.option {
  position: relative;
  cursor: pointer;
}

.option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.option__body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.option__flag {
  font-size: 1.25rem;
  line-height: 1;
}

.option:hover .option__body {
  border-color: #d4d2cc;
  transform: translateX(3px);
}

.option input:checked + .option__body {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.option input:focus-visible + .option__body {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.form-field {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-input.is-error {
  border-color: var(--error);
}

.form-error {
  display: none;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--error);
}

.form-error.is-visible {
  display: block;
}

.phone-input {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.phone-input:focus-within {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.phone-input.is-error {
  border-color: var(--error);
}

.phone-input__prefix {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: #efefec;
  border-right: 1.5px solid var(--border);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  flex-shrink: 0;
}

.phone-input__flag {
  font-size: 1.125rem;
  line-height: 1;
}

.phone-input__field {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text);
}

.phone-input__field:focus {
  outline: none;
}

.phone-input__field::placeholder {
  color: #aaa;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 24px;
  padding: 15px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a.btn {
  text-decoration: none;
  color: #fff;
}

a.btn:hover {
  color: #fff;
}

.form-note {
  margin-top: 12px;
  font-size: 0.6875rem;
  color: var(--text-light);
  line-height: 1.55;
  text-align: center;
}

.form-note a {
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 28px 0 32px;
  border-top: 1px solid var(--border);
}

.footer__inner {
  text-align: center;
}

.footer__company {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.footer__requisites {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.footer__link {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer__link:hover {
  color: var(--accent);
}

/* Subpages */
.page-main {
  flex: 1;
  padding: 16px 0 56px;
}

.page-nav {
  margin-bottom: 28px;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.page-back:hover {
  color: var(--accent);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 28px;
}

.legal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.legal h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 28px 0 10px;
}

.legal h2:first-child {
  margin-top: 0;
}

.legal p,
.legal li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 10px;
}

.legal ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.8125rem;
}

.legal th,
.legal td {
  border: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.legal th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

.legal-meta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Thank */
.thank-block {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.thank-block__ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.thank-block__title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 12px;
}

.thank-block__text {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.thank-block .btn {
  width: auto;
  min-width: 200px;
  margin-top: 0;
}

@media (max-width: 480px) {
  .quiz-card {
    padding: 24px 18px 22px;
  }

  .legal {
    padding: 24px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }

  .option:hover .option__body {
    transform: none;
  }
}
