:root {
  color-scheme: light;
  --blue: #0867f7;
  --blue-dark: #0452d6;
  --ink: #071126;
  --muted: #66728e;
  --line: #dbe3ef;
  --white: #fff;
  --danger: #c93445;
  --shadow: 0 28px 80px rgba(18, 51, 96, .16);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: #f3f8ff;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(8, 103, 247, .32);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.potential-app { min-height: 100svh; }
.potential-form { min-height: 0; }

.potential-screen {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.potential-screen:not(.is-active) { display: none; }

.scene {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
}

.scene img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  background: #f5f9ff;
}

.screen-inner {
  width: min(100%, 1440px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(28px, 4.6vw, 72px) clamp(28px, 5.4vw, 84px);
  display: flex;
  flex-direction: column;
}

.brand {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.025em;
}

.brand b { color: #3c465c; font-weight: 600; }

.brand-mark {
  width: 30px;
  height: 28px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  transform: skewY(-28deg);
}

.brand-mark i {
  width: 7px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #5ba0ff, #0867f7);
}

.brand-mark i:nth-child(1) { height: 11px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 27px; }

.hero-card {
  width: min(540px, 45vw);
  margin: auto 0;
  padding: clamp(28px, 3vw, 42px);
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 28px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.08);
}

.badge {
  width: max-content;
  max-width: 100%;
  margin: 0 0 28px;
  padding: 9px 16px;
  color: var(--blue);
  border: 1px solid rgba(8, 103, 247, .1);
  border-radius: 999px;
  background: rgba(239, 246, 255, .84);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.badge span { margin-right: 5px; font-size: 9px; }

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 24px;
  font-size: clamp(43px, 4.15vw, 64px);
  line-height: .99;
  letter-spacing: -.058em;
}

h1 em { color: var(--blue); font-style: normal; }

.hero-lead {
  max-width: 520px;
  margin-bottom: 16px;
  color: #28354e;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.42;
}

.hero-note {
  max-width: 500px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.primary-button {
  min-height: 64px;
  padding: 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #fff;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #0878ff, #075ef0);
  box-shadow: 0 16px 30px rgba(8, 103, 247, .24);
  cursor: pointer;
  font-size: 18px;
  font-weight: 750;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary-button:hover { transform: translateY(-2px); box-shadow: 0 20px 38px rgba(8, 103, 247, .3); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: not-allowed; opacity: .5; transform: none; box-shadow: none; }
.primary-button[aria-busy="true"] { filter: saturate(.35); }

.time-note {
  margin: 14px 0 0 2px;
  color: #5b6680;
  font-size: 13px;
}

.time-note span { margin-right: 7px; color: #33425e; font-size: 18px; }

.potential-screen--step .screen-inner,
.potential-screen--success .screen-inner { justify-content: center; }

.quiz-card {
  width: min(650px, 51vw);
  padding: clamp(28px, 3.4vw, 48px);
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 28px;
  background: rgba(255, 255, 255, .91);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.08);
}

.progress-row {
  margin-bottom: 34px;
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  gap: 20px;
}

.back-button {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid #e8edf5;
  border-radius: 15px;
  background: rgba(255, 255, 255, .84);
  cursor: pointer;
  font-size: 25px;
}

.progress-copy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px 20px;
  color: #5c6882;
  font-size: 13px;
}

.progress-copy b { font-weight: 500; }

.progress-copy i {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ecf4;
}

.progress-copy i span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #0878ff, #0867f7);
}

.quiz-card h2 {
  margin-bottom: 30px;
  font-size: clamp(34px, 3.15vw, 48px);
  line-height: 1.07;
  letter-spacing: -.048em;
}

.field-block,
.organization-picker { margin-bottom: 24px; }

.field-block > label,
.organization-picker > label,
.messenger-fieldset > legend {
  margin: 0 0 9px;
  display: block;
  color: #18243b;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.input-shell { position: relative; }

.input-shell input {
  width: 100%;
  min-height: 60px;
  padding: 0 18px;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .88);
  outline: 0;
  font-size: 16px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input-shell input::placeholder { color: #99a3b7; }

.input-shell input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(8, 103, 247, .09);
}

.input-shell input:disabled { cursor: not-allowed; opacity: .65; }

.input-shell--search input { padding-left: 50px; padding-right: 48px; }

.input-icon {
  position: absolute;
  z-index: 2;
  top: 19px;
  left: 19px;
  width: 19px;
  height: 19px;
  border: 2px solid #71809b;
  border-radius: 50%;
  pointer-events: none;
}

.input-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #71809b;
  transform: rotate(45deg);
}

.clear-search {
  position: absolute;
  z-index: 3;
  top: 7px;
  right: 7px;
  width: 46px;
  height: 46px;
  color: #7b869b;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.input-shell--money input { padding-right: 52px; }

.input-shell--money > span {
  position: absolute;
  top: 17px;
  right: 20px;
  color: #68748a;
  font-size: 20px;
  font-weight: 700;
}

.field-hint {
  min-height: 18px;
  margin: 8px 2px 0;
  color: #75819a;
  font-size: 12px;
  line-height: 1.45;
}

.field-hint.is-error { color: var(--danger); }

.organization-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 7px);
  left: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid #dfe6f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 58px rgba(23, 49, 89, .2);
}

.organization-options { max-height: 268px; overflow-y: auto; overscroll-behavior: contain; }

.organization-option {
  width: 100%;
  min-height: 66px;
  padding: 11px 46px 11px 48px;
  position: relative;
  display: grid;
  gap: 3px;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid #edf1f6;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.organization-option::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 20px;
  width: 14px;
  height: 18px;
  border-radius: 9px 9px 9px 0;
  background: #9aa4b5;
  transform: rotate(-45deg);
}

.organization-option::after {
  content: "›";
  position: absolute;
  top: 17px;
  right: 18px;
  color: #98a1b2;
  font-size: 27px;
}

.organization-option:last-child { border-bottom: 0; }
.organization-option:hover,
.organization-option.is-active { background: #eef6ff; }
.organization-option.is-active::before { background: var(--blue); }
.organization-option strong { font-size: 14px; line-height: 1.35; }
.organization-option span { color: #748098; font-size: 12px; line-height: 1.4; }

.organization-attribution {
  margin: 0;
  padding: 8px 14px;
  color: #8a94a7;
  border-top: 1px solid #edf1f6;
  font-size: 10px;
  text-align: right;
}

.organization-selected {
  margin-top: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px 12px;
  border: 1px solid #dce8f8;
  border-radius: 17px;
  background: #f4f8fe;
}

.selected-pin {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--blue);
  font-size: 9px;
}

.organization-selected strong,
.organization-selected small { display: block; }
.organization-selected strong { font-size: 14px; }
.organization-selected small { margin-top: 2px; color: #748098; font-size: 12px; line-height: 1.4; }
.organization-selected button { color: var(--blue); border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.organization-selected a { grid-column: 2 / -1; color: var(--blue); font-size: 12px; font-weight: 650; text-decoration: none; }

.form-yandex-status {
  margin: -10px 0 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 5px;
  color: #7c879b;
  font-size: 10px;
}

.form-yandex-status button,
.form-yandex-status a { padding: 8px 0; color: var(--blue); border: 0; background: transparent; cursor: pointer; font: inherit; text-decoration: underline; }

.quiz-card > .primary-button { width: 100%; }

.messenger-fieldset { margin: 0 0 24px; padding: 0; border: 0; }

.messenger-options { margin-bottom: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.messenger-options button {
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #23304a;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .84);
  cursor: pointer;
  font-weight: 700;
}

.messenger-options button span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 9px;
  background: var(--blue);
  font-size: 12px;
}

.messenger-options button[data-messenger="max"] span { background: #7658ea; }
.messenger-options button[aria-pressed="true"] { color: var(--blue); border-color: var(--blue); background: #f0f6ff; }

.consent-checkbox {
  margin: 4px 0 16px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  color: #65718a;
  font-size: 11px;
  line-height: 1.45;
}

.consent-checkbox input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.consent-checkbox a { color: var(--blue); }

.form-honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.form-readiness {
  margin: 0 0 14px;
  padding: 11px 13px;
  color: #8b5700;
  border: 1px solid #f0d8ac;
  border-radius: 12px;
  background: #fff8eb;
  font-size: 11px;
}

.submit-note {
  margin: 12px auto 0;
  color: #727e96;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.form-status { min-height: 18px; margin: 9px 0 0; color: var(--danger); font-size: 12px; text-align: center; }

.success-card { text-align: left; }
.success-icon { width: 62px; height: 62px; margin-bottom: 25px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #2acb78, #0aaa5c); box-shadow: 0 14px 28px rgba(18, 175, 96, .24); font-size: 32px; }
.success-card .badge { margin-bottom: 18px; }
.success-card h2 { margin-bottom: 18px; }
.success-card > p:not(.badge) { max-width: 520px; color: #526078; font-size: 18px; line-height: 1.55; }
.request-number { margin-top: 24px; font-size: 13px !important; }

/* The shared cookie controls inherit the same light glass surface as the quiz. */
.cookie-banner {
  right: 16px;
  bottom: 16px;
  width: min(410px, calc(100vw - 32px));
  padding: 16px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 18px 48px rgba(18, 51, 96, .2);
  backdrop-filter: blur(22px) saturate(1.08);
}

.cookie-banner h2,
.cookie-dialog h2 { color: var(--ink); font-size: 16px; }

.cookie-banner p,
.cookie-dialog p { color: #59667f; font-size: 11px; line-height: 1.45; }

.cookie-banner a,
.cookie-dialog a { color: var(--blue); }

.cookie-actions { margin-top: 12px; grid-template-columns: 1.2fr .8fr; }

.cookie-button {
  min-height: 42px;
  padding: 8px 12px;
  color: #33415b;
  border-color: #dbe4f1;
  border-radius: 12px;
  background: rgba(247, 250, 255, .88);
  font-size: 11px;
}

.cookie-button:hover,
.cookie-button:focus-visible { color: var(--blue-dark); border-color: rgba(8, 103, 247, .4); background: #eef5ff; }

.cookie-button--primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #0878ff, #075ef0); }
.cookie-button--primary:hover,
.cookie-button--primary:focus-visible { color: #fff; border-color: transparent; background: linear-gradient(135deg, #0878ff, #0757df); }

.cookie-dialog { background: rgba(7, 17, 38, .46); backdrop-filter: blur(8px); }
.cookie-dialog__panel { color: var(--ink); border-color: rgba(255, 255, 255, .84); background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); }
.cookie-option { border-color: #dfe6f1; background: #f8fbff; }
.cookie-option small { color: #64718a; }
.cookie-option input { accent-color: var(--blue); }

@media (max-width: 1050px) and (min-width: 721px) {
  .screen-inner { padding-left: 38px; padding-right: 38px; }
  .hero-card { width: 49vw; }
  .quiz-card { width: 56vw; }
  h1 { font-size: 48px; }
}

@media (max-width: 720px) {
  body { background: #f7faff; }

  .potential-screen { min-height: 100svh; overflow-y: auto; }

  .scene { position: fixed; }

  .scene img {
    object-position: center top;
    background: #f5f9ff;
  }

  .screen-inner {
    min-height: 100svh;
    padding: 22px 16px max(20px, env(safe-area-inset-bottom));
  }

  .brand { font-size: 15px; }
  .brand-mark { width: 25px; height: 23px; }
  .brand-mark i { width: 6px; }
  .brand-mark i:nth-child(1) { height: 9px; }
  .brand-mark i:nth-child(2) { height: 15px; }
  .brand-mark i:nth-child(3) { height: 22px; }

  .hero-card {
    width: 100%;
    margin: clamp(235px, 31vh, 275px) 0 0;
    padding: 26px 22px 24px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 26px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 22px 60px rgba(28, 65, 109, .13);
    backdrop-filter: blur(18px);
  }

  .cookie-banner {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    padding: 14px;
    border-radius: 16px;
  }

  .cookie-banner h2 { margin-bottom: 5px; font-size: 14px; }
  .cookie-banner p { font-size: 10px; }
  .cookie-actions { margin-top: 10px; grid-template-columns: 1.2fr .8fr; }
  .cookie-button { min-height: 40px; padding: 7px 8px; font-size: 10px; }

  .badge { margin-bottom: 18px; padding: 8px 12px; font-size: 11px; }

  h1 { margin-bottom: 18px; font-size: clamp(35px, 10.4vw, 44px); line-height: 1.01; }
  .hero-lead { margin-bottom: 13px; font-size: 16px; }
  .hero-note { margin-bottom: 22px; font-size: 13px; }
  .primary-button { min-height: 58px; width: 100%; padding: 0 18px; border-radius: 15px; font-size: 16px; }
  .time-note { text-align: center; }

  .potential-screen--step .screen-inner,
  .potential-screen--success .screen-inner { justify-content: flex-start; }

  .quiz-card {
    width: 100%;
    margin-top: clamp(220px, 28vh, 260px);
    padding: 24px 20px;
    border-radius: 26px;
    background: rgba(255, 255, 255, .96);
  }

  .progress-row { margin-bottom: 26px; grid-template-columns: 46px 1fr; gap: 14px; }
  .back-button { width: 46px; height: 46px; border-radius: 14px; }
  .progress-copy { font-size: 12px; }
  .quiz-card h2 { margin-bottom: 25px; font-size: clamp(30px, 8.8vw, 39px); }
  .field-block, .organization-picker { margin-bottom: 21px; }
  .field-block > label, .organization-picker > label, .messenger-fieldset > legend { font-size: 13px; }
  .input-shell input { min-height: 56px; font-size: 16px; }
  .input-icon { top: 17px; }
  .organization-options { max-height: 240px; }
  .organization-selected { grid-template-columns: 30px 1fr; }
  .organization-selected button { grid-column: 2; justify-self: start; padding: 6px 0; }
  .organization-selected a { grid-column: 2; }
  .messenger-options button { min-height: 52px; padding: 0 6px; gap: 5px; font-size: 11px; }
  .consent-checkbox { font-size: 10px; }
  .success-card { margin-top: clamp(300px, 39vh, 390px); }

  .potential-screen--step .quiz-card { margin-top: clamp(110px, 14vh, 140px); padding-top: 20px; padding-bottom: 20px; }
  .potential-screen--step .progress-row { margin-bottom: 18px; }
  .potential-screen--step h2 { margin-bottom: 18px; }
  .potential-screen--step .field-block,
  .potential-screen--step .organization-picker { margin-bottom: 15px; }
  .potential-screen--step .input-shell input { min-height: 50px; }
  .potential-screen--step .quiz-card:has(.organization-selected:not([hidden])),
  .potential-screen--step .quiz-card:has(.messenger-contact:not([hidden])) { margin-top: 64px; }
}

@media (max-width: 380px) {
  .screen-inner { padding-left: 12px; padding-right: 12px; }
  .hero-card, .quiz-card { padding-left: 17px; padding-right: 17px; }
  h1 { font-size: 34px; }
  .quiz-card h2 { font-size: 29px; }
}

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