:root {
  --ct-ink: #0B1220;
  --ct-text: #3B4554;
  --ct-muted: #5B6575;
  --ct-line: #DCE5F4;
  --ct-line-strong: #8193B2;
  --ct-soft: #F7F9FB;
  --ct-brand: #1046bb;
  --ct-brand-hover: #0c348c;
  --ct-brand-soft: #e7eefc;
  --ct-danger: #B42318;
  --ct-danger-ink: #8A1C12;
  --ct-danger-soft: #FDECEA;
  --ct-danger-line: #F3C3BD;
  --ct-success: #157A49;
  --ct-success-soft: #E6F5EC;
  --ct-success-line: #BFE3CD;
  --ct-radius: 20px;
  --ct-field-radius: 12px;
  --ct-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 12px 28px -18px rgba(16, 70, 187, 0.22);
}

html.ct-lock { overflow: hidden; }

.ct-block {
  --ct-block-top: clamp(56px, 6.5vw, 96px);
  padding: var(--ct-block-top) 0 clamp(56px, 6.5vw, 96px);
  scroll-margin-top: calc(var(--header-h, 68px) + 24px - var(--ct-block-top));
}
.ct-block[data-source="about"] { --ct-block-top: clamp(28px, 3.5vw, 48px); }
.ct-block--page { --ct-block-top: clamp(32px, 4vw, 56px); }
.ct-wrap { display: grid; gap: clamp(24px, 3vw, 32px); }
.ct-head { display: grid; gap: 12px; }
.ct-title {
  margin: 0;
  font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--ct-ink);
  text-wrap: balance;
  overflow-wrap: break-word;
}
.ct-block[data-source="home"] .ct-title {
  font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.ct-title:focus, .ct-dialog__title:focus, .ct-success:focus { outline: none; }
.ct-sub {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(15.5px, 0.9rem + 0.3vw, 18px);
  line-height: 1.65;
  color: var(--ct-muted);
  text-wrap: balance;
}
.ct-card {
  padding: clamp(20px, 3.2vw, 40px);
  background: #fff;
  border: 1px solid var(--ct-line);
  border-radius: var(--ct-radius);
  box-shadow: var(--ct-shadow);
}

.ct-form-wrap { display: grid; gap: 24px; min-width: 0; }
.ct-form { display: grid; gap: 24px; min-width: 0; margin: 0; }
.ct-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.ct-field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.ct-label { font: 600 14px/1.4 var(--font); color: var(--ct-ink); }
.ct-req { margin-left: 4px; color: var(--ct-danger); }
.ct-form .ct-input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--ct-line-strong);
  border-radius: var(--ct-field-radius);
  box-shadow: none;
  color: var(--ct-ink);
  font: 400 16px/1.4 var(--font);
  transition: border-color var(--t, 200ms), box-shadow var(--t, 200ms);
}
.ct-form .ct-input:hover { border-color: #5B6E92; }
.ct-form .ct-input:focus { border-color: var(--ct-brand); outline: 2px solid var(--ct-brand); outline-offset: 1px; box-shadow: none; }
.ct-form .ct-textarea { min-height: 120px; resize: vertical; }
.ct-form .ct-input[aria-invalid="true"], .ct-form .is-invalid .ct-input { border-color: var(--ct-danger); }
.ct-form .ct-input[aria-invalid="true"]:focus, .ct-form .is-invalid .ct-input:focus { outline-color: var(--ct-danger); }
.ct-hint, .ct-error { margin: 0; font-size: 13px; line-height: 1.5; }
.ct-hint { color: var(--ct-muted); }
.ct-error { color: var(--ct-danger); font-weight: 500; }
.ct-error:empty { display: none; }

.ct-topic {
  justify-self: start;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ct-brand-soft);
  color: var(--ct-brand-hover);
  font: 600 13.5px/1.4 var(--font);
}
.ct-topic__label { font-weight: 500; color: var(--ct-text); }

.ct-alert {
  padding: 12px 16px;
  background: var(--ct-danger-soft);
  border: 1px solid var(--ct-danger-line);
  border-radius: var(--ct-field-radius);
  color: var(--ct-danger-ink);
  font-size: 14px;
  line-height: 1.5;
}

.ct-captcha { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.ct-captcha__media { display: grid; gap: 4px; justify-items: start; }
.ct-captcha__img {
  display: block;
  width: 180px;
  max-width: 100%;
  height: 60px;
  background: var(--ct-soft);
  border: 1px solid var(--ct-line);
  border-radius: var(--ct-field-radius);
}
.ct-captcha__img:not([src]) { color: transparent; font-size: 0; content: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); }
.ct-captcha.is-loading .ct-captcha__img { opacity: 0.6; }
.ct-captcha__refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ct-brand);
  font: 600 13.5px/1.2 var(--font);
  cursor: pointer;
}
.ct-captcha__refresh:hover { color: var(--ct-brand-hover); text-decoration: underline; text-underline-offset: 3px; }
.ct-captcha__refresh:focus-visible { outline: 2px solid var(--ct-brand); outline-offset: 2px; }
.ct-captcha__refresh .hi { width: 16px; height: 16px; flex: none; }
.ct-captcha.is-loading .ct-captcha__refresh .hi { animation: ct-spin 0.9s linear infinite; }
.ct-captcha__field { flex: 1 1 160px; min-width: 0; }
.ct-form .ct-input--code { max-width: 240px; min-height: 60px; letter-spacing: 0.12em; text-transform: uppercase; }
.ct-dialog .ct-form .ct-textarea { min-height: 96px; }

.ct-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ct-check { position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 44px; }
.ct-check__label::before { content: ""; position: absolute; inset: 0; }
.ct-check__label a { position: relative; z-index: 1; }
.ct-field.is-invalid .ct-checkbox:not(:focus-visible) { outline: 2px solid var(--ct-danger); outline-offset: 1px; }
.ct-checkbox {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ct-brand);
  cursor: pointer;
}
.ct-checkbox:focus-visible { outline: 2px solid var(--ct-brand); outline-offset: 2px; }
.ct-check__label { font-size: 14px; line-height: 1.55; color: var(--ct-text); cursor: pointer; text-wrap: pretty; }
.ct-check__label a, .ct-check__label a:visited { color: var(--ct-brand); text-decoration: underline; text-underline-offset: 2px; }
.ct-check__label a:hover { color: var(--ct-brand-hover); }
.ct-check__label a:focus-visible { outline: 2px solid var(--ct-brand); outline-offset: 2px; border-radius: 4px; }

.ct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.ct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 14px;
  font: 700 15px/1.2 var(--font);
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t, 200ms), color var(--t, 200ms), border-color var(--t, 200ms), box-shadow var(--t, 200ms);
}
.ct-btn .hi { width: 18px; height: 18px; flex: none; }
.ct-btn:hover { text-decoration: none; }
.ct-btn:focus-visible { outline: 2px solid var(--ct-brand); outline-offset: 3px; }
.ct-btn[aria-busy="true"],
.ct-btn[aria-busy="true"]:disabled { opacity: 1; filter: none; cursor: progress; }
.ct-btn[aria-busy="true"] .hi { animation: ct-busy 0.8s ease-in-out infinite alternate; }
.ct-btn--primary, a.ct-btn--primary, a.ct-btn--primary:visited {
  background: var(--ct-brand);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(16, 70, 187, 0.75);
}
.ct-btn--primary:hover, a.ct-btn--primary:hover, .ct-btn--primary:focus-visible, a.ct-btn--primary:focus-visible, .ct-btn--primary[aria-busy="true"] {
  background: var(--ct-brand-hover);
  color: #fff;
}
.ct-btn--secondary, a.ct-btn--secondary, a.ct-btn--secondary:visited {
  background: #fff;
  color: var(--ct-brand);
  border-color: #C9D8F6;
}
.ct-btn--secondary:hover, a.ct-btn--secondary:hover, .ct-btn--secondary:focus-visible, a.ct-btn--secondary:focus-visible {
  background: var(--ct-brand-soft);
  color: var(--ct-brand-hover);
  border-color: var(--ct-brand);
}

.ct-success {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--ct-success-soft);
  border: 1px solid var(--ct-success-line);
  border-radius: 16px;
  color: var(--ct-ink);
}
.ct-success__ico {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--ct-success);
}
.ct-success__ico .hi { width: 24px; height: 24px; }
.ct-success__body { display: grid; gap: 4px; min-width: 0; }
.ct-success__title { margin: 0; font: 700 17px/1.35 var(--font); color: var(--ct-ink); }
.ct-success__text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ct-text); text-wrap: balance; }

.ct-topic[hidden], .ct-alert[hidden], .ct-success[hidden] { display: none; }

.ct-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 0;
  border-radius: var(--ct-radius);
  color: var(--ct-ink);
  box-shadow: 0 24px 64px -16px rgba(11, 18, 32, 0.4);
}
.ct-dialog--phone { width: min(460px, calc(100vw - 32px)); }
.ct-dialog::backdrop { background: rgba(11, 18, 32, 0.55); }
.ct-dialog__box {
  --ct-pad: clamp(20px, 3vw, 32px);
  display: grid;
  gap: 24px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: var(--ct-pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(var(--ct-pad) + 80px);
}
.ct-dialog .ct-actions {
  position: sticky;
  bottom: calc(-1 * var(--ct-pad));
  z-index: 2;
  margin: 0 calc(-1 * var(--ct-pad)) calc(-1 * var(--ct-pad));
  padding: 16px var(--ct-pad) var(--ct-pad);
  background: #fff;
  border-top: 1px solid var(--ct-line);
}
.ct-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ct-dialog__heading { display: grid; gap: 8px; min-width: 0; }
.ct-dialog__title {
  margin: 0;
  font: 800 clamp(20px, 1rem + 1vw, 26px)/1.25 var(--font);
  letter-spacing: -0.02em;
  color: var(--ct-ink);
  overflow-wrap: break-word;
}
.ct-dialog__sub { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ct-muted); text-wrap: balance; }
.ct-dialog:has([data-ct-success]:not([hidden])) .ct-dialog__sub { display: none; }
.ct-dialog__close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: var(--ct-muted);
  cursor: pointer;
}
.ct-dialog__close:hover { background: var(--ct-brand-soft); color: var(--ct-brand-hover); }
.ct-dialog__close:focus-visible { outline: 2px solid var(--ct-brand); outline-offset: 2px; }
.ct-dialog__close .hi { width: 22px; height: 22px; }

.ct-call { display: grid; gap: 16px; }
.ct-phone, a.ct-phone, a.ct-phone:visited {
  justify-self: start;
  max-width: 100%;
  font: 800 clamp(20px, 0.9rem + 2.4vw, 34px)/1.2 var(--font);
  letter-spacing: -0.01em;
  color: var(--ct-ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.ct-phone:hover { color: var(--ct-brand); }
.ct-phone:focus-visible { outline: 2px solid var(--ct-brand); outline-offset: 4px; border-radius: 6px; }
.ct-call__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ct-call__actions .ct-btn { flex: 1 1 160px; }
.ct-btn--tel { display: none; }
.ct-copy-status { margin: 0; min-height: 21px; font-size: 14px; line-height: 1.5; font-weight: 600; color: var(--ct-success); }
.ct-copy-status.is-error { color: var(--ct-danger); }

.lp-btn[data-contact-call]:focus-visible, .lp-btn[data-contact-write]:focus-visible {
  outline: 2px solid var(--ct-brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

@keyframes ct-spin { to { transform: rotate(360deg); } }
@keyframes ct-busy { to { transform: translateX(3px); opacity: 0.55; } }

@media (hover: none) and (pointer: coarse) {
  .ct-btn--tel { display: inline-flex; }
}

@media (max-width: 519.98px) {
  .ct-actions .ct-btn { width: 100%; }
  .ct-success { flex-direction: column; padding: 16px; gap: 12px; }
}

@media (min-width: 520px) {
  .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .ct-field--wide { grid-column: 1 / -1; }
}

@media (min-width: 915px) {
  .ct-check { min-height: 0; }
}

@media (min-width: 1200px) {
  .ct-wrap { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; column-gap: 48px; }
}

@media (max-width: 319.98px) {
  .ct-card { padding: 16px; border-radius: 16px; }
  .ct-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .ct-dialog__box { --ct-pad: 16px; max-height: calc(100dvh - 16px); }
  .ct-btn { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ct-captcha.is-loading .ct-captcha__refresh .hi,
  .ct-btn[aria-busy="true"] .hi { animation: none; }
  .ct-form .ct-input, .ct-btn { transition: none; }
}
