:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: #fff;
  background: #1d3447;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html, body, #root { min-height: 100%; margin: 0; }

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

.page-shell {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.page-shell::before,
.page-shell::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.page-shell::before {
  background-color: #425a6c;
  background-image: var(--background-image);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.page-shell::after {
  background-color: rgb(6 18 31 / var(--overlay-opacity, 0.48));
}

.site-header,
.site-footer {
  flex-shrink: 0;
  background: rgb(10 24 38 / 22%);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.site-header {
  border-bottom: 1px solid rgb(255 255 255 / 25%);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  padding: 20px 32px;
}

.header-title {
  white-space: pre-line;
  max-width: 1100px;
  margin: 0;
  padding: 0 150px;
  font-size: clamp(18px, 2.1vw, 27px);
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 9px rgb(0 0 0 / 35%);
}

.language-switcher {
  position: absolute;
  right: 32px;
  top: 50%;
  display: flex;
  gap: 5px;
  transform: translateY(-50%);
}

.language-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 27px;
  padding: 4px 6px;
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 5px;
  background: rgb(9 22 35 / 23%);
  color: white;
  font: inherit;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.language-flag {
  display: block;
  flex: none;
  width: 16px;
  height: 11px;
  object-fit: cover;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 1px;
}
.language-code { line-height: 1; white-space: nowrap; }

.language-button:hover:not(:disabled),
.language-button.is-active {
  background: rgb(255 255 255 / 20%);
  border-color: white;
}

.language-button.is-active { box-shadow: inset 0 -2px 0 white; }
.language-button:disabled { opacity: 0.45; cursor: not-allowed; }

.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.hero {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: clamp(70px, 13vh, 150px) 24px 96px;
  text-align: center;
}

.hero-content { width: min(100%, 720px); }

.hero-title {
  white-space: pre-line;
  margin: 0 0 18px;
  font-size: clamp(30px, 4.5vw, 56px);
  font-weight: 720;
  line-height: 1.15;
  text-shadow: 0 3px 15px rgb(0 0 0 / 40%);
}

.hero-description {
  max-width: 610px;
  margin: 0 auto;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
  text-wrap: pretty;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgb(0 0 0 / 70%);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  min-height: 59px;
  margin-top: 36px;
  padding: 14px 28px;
  border: 2px solid white;
  border-radius: 6px;
  background: rgb(11 28 43 / 38%);
  color: white;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: rgb(255 255 255 / 20%);
  transform: translateY(-2px);
}

/* Общий макет внутренних страниц: без рамки, с заголовком по центру
   и большим текстом, выровненным по ширине. Главная страница не меняется. */
.inner-page {
  flex: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: clamp(48px, 8vh, 96px) 24px 88px;
}

.inner-page-content {
  width: min(100%, 860px);
}

.inner-page-title {
  margin: 0 0 28px;
  font-size: clamp(25px, 3.3vw, 40px);
  font-weight: 720;
  line-height: 1.3;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-shadow: 0 3px 15px rgb(0 0 0 / 40%);
}

.inner-page-description {
  margin: 0;
  font-size: clamp(16px, 1.65vw, 19px);
  line-height: 1.8;
  text-align: justify;
  text-justify: inter-word;
  white-space: pre-wrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  text-shadow: 0 2px 12px rgb(0 0 0 / 70%);
}

.inner-page-actions {
  text-align: center;
}

/* Дополнительный текст и вторая кнопка под основным действием. */
.secondary-section { margin-top: 30px; }
.secondary-description {
  max-width: 610px;
  margin: 0 auto;
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.55;
  text-wrap: pretty;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgb(0 0 0 / 75%);
}
.secondary-button {
  min-width: 190px;
  min-height: 47px;
  margin-top: 18px;
  padding: 10px 22px;
  font-size: 15px;
}

.language-button:focus-visible,
.primary-button:focus-visible,
.footer-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.site-footer {
  border-top: 1px solid rgb(255 255 255 / 28%);
  padding: 16px clamp(20px, 3.3vw, 50px) 18px;
}

.footer-content {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.footer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  margin-top: 10px;
  padding: 5px 13px;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 5px;
  background: rgb(11 28 43 / 26%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease;
}
.footer-button:hover { background: rgb(255 255 255 / 20%); }

.animate-in { animation: rise-in 850ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}

.status-message {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  color: white;
  text-align: center;
}

@media (max-width: 640px) {
  .header-inner {
    min-height: 119px;
    align-items: flex-end;
    padding: 55px 18px 18px;
  }

  .header-title { padding: 0; font-size: 18px; }
  .language-switcher { top: 10px; right: 16px; transform: none; gap: 5px; }
  .language-button { min-height: 26px; padding: 4px 5px; font-size: 10px; }
  .language-flag { width: 15px; height: 10px; }
  .hero { padding: 80px 22px 80px; }
  .hero-description { font-size: 17px; }
  .primary-button { width: min(100%, 300px); min-width: 0; }
  .site-footer { padding-top: 18px; padding-bottom: 22px; }
  .footer-content { font-size: 11px; }
  .secondary-section { margin-top: 26px; }
  .secondary-description { font-size: 15px; }
  .secondary-button { min-height: 45px; }
  .inner-page { padding: 50px 20px 72px; }
  .inner-page-title { margin-bottom: 22px; }
  .inner-page-description { font-size: 16px; line-height: 1.75; }
}

@media (prefers-reduced-motion: reduce) {
  .animate-in { animation: none; }
  .primary-button, .language-button, .footer-button { transition: none; }
}

/* Анкета на /next. Стили главной страницы не меняем. */
.survey {
  width: 100%;
  margin-top: 36px;
}

.survey-question + .survey-question { margin-top: 30px; }

.survey-question-title {
  margin-bottom: 14px;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.5;
  font-weight: 700;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px rgb(0 0 0 / 60%);
}

.survey-options { display: grid; gap: 10px; }

.survey-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 15px;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 8px;
  background: rgb(7 21 36 / 27%);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.survey-option:hover,
.survey-option:has(input:checked) {
  border-color: rgb(255 255 255 / 84%);
  background: rgb(255 255 255 / 14%);
}

.survey-option-input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: #bfe6ff;
  cursor: pointer;
}

.survey-option-label {
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.survey-comment {
  display: block;
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 8px;
  outline: none;
  background: rgb(5 18 32 / 38%);
  color: white;
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
}

.survey-comment::placeholder { color: rgb(255 255 255 / 65%); }
.survey-comment:focus-visible,
.contact-input:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.survey-error {
  margin: 13px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffe4db;
}
.survey-error:empty { display: none; }

.survey-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}
.survey-actions .primary-button { margin-top: 0; cursor: pointer; font-family: inherit; }
.survey-actions button.primary-button { background: rgb(19 77 92 / 67%); }
.survey-actions button.primary-button:hover { background: rgb(37 105 117 / 85%); }

/* Нативный dialog: фокус и закрытие по Escape обеспечивает браузер. */
.contact-modal {
  width: min(94vw, 740px);
  max-width: 740px;
  max-height: min(88vh, 850px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 12px;
  background: #f6f7f9;
  color: #172330;
  box-shadow: 0 25px 90px rgb(0 0 0 / 52%);
}
.contact-modal::backdrop { background: rgb(0 0 0 / 68%); backdrop-filter: blur(4px); }
.contact-modal-panel { position: relative; }
.contact-modal-close {
  position: absolute;
  z-index: 2;
  right: 11px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgb(255 255 255 / 90%);
  color: #192d3b;
  font-family: Arial, sans-serif;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.contact-modal-close:hover { background: #e9eef5; }
.contact-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-right: 44px;
  background: #e9edf2;
  border-bottom: 1px solid #c6d0da;
}
.contact-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  min-height: 68px;
  padding: 12px 6px;
  border: none;
  border-right: 1px solid #c6d0da;
  background: transparent;
  color: #273744;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.contact-tab.is-active { background: white; box-shadow: inset 0 -3px 0 #398bbd; }
.contact-tab-icon { display: block; flex: none; width: 25px; height: 25px; object-fit: contain; }
.contact-tab-name { overflow-wrap: anywhere; }
.contact-modal-body { padding: clamp(22px, 5vw, 46px); }
.contact-modal-title {
  margin: 0;
  font-size: clamp(21px, 3vw, 26px);
  text-align: center;
  line-height: 1.3;
  font-weight: 750;
}
.contact-modal-description {
  max-width: 530px;
  margin: 14px auto 28px;
  font-size: 16px;
  line-height: 1.55;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.contact-modal-description:empty { display: none; }
.contact-input-label {
  display: block;
  margin: 25px auto 9px;
  max-width: 510px;
  font-size: 15px;
  font-weight: 650;
}
.contact-input {
  display: block;
  width: 100%;
  max-width: 510px;
  height: 52px;
  padding: 10px 15px;
  margin: 0 auto;
  border: 1px solid #9aa8b4;
  border-radius: 7px;
  background: white;
  color: #172330;
  font: inherit;
  font-size: 17px;
}
.contact-form-message {
  min-height: 23px;
  max-width: 510px;
  margin: 10px auto 0;
  color: #a32922;
  font-size: 14px;
  line-height: 1.45;
}
.contact-form-message.is-success { color: #176339; }
.contact-modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}
.contact-submit.primary-button {
  min-width: 170px;
  min-height: 48px;
  margin: 0;
  padding: 10px 21px;
  border: 0;
  border-radius: 7px;
  background: #245a76;
  color: white;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
}
.contact-submit.primary-button:hover { background: #17435c; }
.contact-tab:focus-visible,
.contact-modal-close:focus-visible,
.contact-submit:focus-visible { outline: 3px solid #398bbd; outline-offset: 2px; }

@media (max-width: 640px) {
  .survey { margin-top: 27px; }
  .survey-question + .survey-question { margin-top: 23px; }
  .survey-option { padding: 12px 13px; }
  .survey-option-label { font-size: 15px; }
  .survey-actions { gap: 11px; }
  .survey-actions .primary-button { width: 100%; }
  .contact-modal { width: calc(100vw - 24px); max-height: 90vh; border-radius: 10px; }
  .contact-tabs { padding-right: 38px; }
  .contact-tab { flex-direction: column; gap: 4px; min-height: 69px; padding: 9px 2px; font-size: 12px; }
  .contact-tab-icon { width: 23px; height: 23px; }
  .contact-modal-close { right: 6px; top: 7px; }
  .contact-modal-body { padding: 22px 18px; }
  .contact-input-label { margin-top: 22px; }
  .contact-modal-actions { margin-top: 18px; }
  .contact-submit.primary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .survey-option { transition: none; }
}

/* Последующие экраны диалога подтверждения контакта. */
.contact-tabs[hidden] { display: none; }
.contact-modal-step { max-width: 510px; margin-inline: auto; }
.contact-summary-label {
  margin: 24px 0 7px;
  font-size: 15px;
  text-align: center;
  color: #506070;
}
.contact-summary-value {
  margin: 0;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
  user-select: text;
}
.contact-error-detail {
  margin: 24px 0;
  color: #9b2922;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.contact-modal-actions-split { justify-content: space-between; align-items: center; gap: 12px; }
.contact-secondary-button {
  min-width: 110px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid #8c9daa;
  border-radius: 7px;
  background: transparent;
  color: #273744;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.contact-secondary-button:hover { background: #e9eef5; }
.contact-secondary-button:focus-visible { outline: 3px solid #398bbd; outline-offset: 2px; }
.contact-submit:disabled, .contact-tab:disabled { opacity: 0.65; cursor: wait; }
@media (max-width: 640px) {
  .contact-modal-actions-split { flex-direction: column-reverse; }
  .contact-modal-actions-split .primary-button,
  .contact-modal-actions-split .contact-secondary-button { width: 100%; }
}

/* Поле для свободного текста второго шага (тот же стиль, что и у input). */
.contact-textarea {
  min-height: 100px;
  height: auto;
  resize: vertical;
  line-height: 1.5;
}
.contact-textarea:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.footer-content {
  flex: 1;
  min-width: 0;
}

.footer-right {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: right;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Для мобильных устройств */
@media (max-width: 640px) {
  .site-footer {
    flex-wrap: wrap;
  }

  .footer-right {
    flex-basis: 100%;
    font-size: 11px;
    text-align: right;
  }
}

/* Gmail: отдельный шаг после успешного /api/demo/start. */
.contact-gmail-form { max-width: 600px; }
.contact-gmail-intro {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(0, 1.4fr);
  align-items: center;
  column-gap: clamp(20px, 4vw, 48px);
  margin: 34px 0 38px;
}
.contact-gmail-logo {
  display: block;
  width: clamp(95px, 14vw, 150px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}
.contact-gmail-info {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.contact-gmail-form .contact-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.contact-gmail-form .contact-textarea {
  max-width: 100%;
  min-height: 84px;
}
.contact-gmail-form .contact-form-message { max-width: 100%; }

@media (max-width: 640px) {
  .contact-gmail-intro {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
    margin: 24px 0 26px;
  }
  .contact-gmail-logo { width: 105px; }
  .contact-gmail-info { text-align: center; font-size: 15px; }
}
