/* SECURECHECK — формы заявки и правовые страницы */

/* ---------- Общая страница ---------- */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(40px, 6vh, 72px) 24px clamp(48px, 8vh, 96px);
}

.page-head { max-width: 620px; margin-bottom: 40px; }

.page-head h1 {
  font-family: 'Manrope', 'Manrope Fallback', sans-serif;
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.025em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
  text-wrap: balance;
}

.page-head p { color: var(--text-soft); font-size: 15.5px; max-width: 560px; }

/* ---------- Раскладка «форма + пояснение» ---------- */
.lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 28px;
  align-items: start;
}

.form-card {
  padding: clamp(24px, 3.4vw, 36px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: #060c14;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.field .req { color: var(--accent-soft); }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: #04090f;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  padding: 12px 14px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

.field input::placeholder,
.field textarea::placeholder { color: #5d6d80; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, .2); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #05101a;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238494a8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.field .hint { font-size: 12px; color: var(--muted); }

.field-hint { font-size: 12px; color: var(--muted); }
.field-hint.is-ok { color: #86efac; }
.field-hint.is-bad { color: #fca5a5; }

.field.is-valid input { border-color: rgba(134, 239, 172, .45); }

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #f87171; }

.field-error {
  font-size: 12.5px;
  color: #fca5a5;
  display: none;
}

.field.has-error .field-error { display: block; }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* согласие */
.consent {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 4px;
  cursor: pointer;
}

.consent-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.consent-box {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .22);
  background: #04090f;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

.consent-box svg {
  width: 12px;
  height: 12px;
  color: #04121c;
  opacity: 0;
  transform: scale(.55);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}

.consent:hover .consent-box { border-color: rgba(125, 211, 252, .55); }

.consent-input:checked + .consent-box {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-input:checked + .consent-box svg { opacity: 1; transform: none; }

.consent-input:focus-visible + .consent-box {
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

.consent.has-error .consent-box { border-color: #f87171; }

.consent-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
}

.consent a { color: var(--accent-soft); text-underline-offset: 3px; }

.consent-error { grid-column: 1 / -1; margin-top: -6px; }
.consent.has-error + .consent-error { display: block; }

.form-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}

.form-note { font-size: 12.5px; color: var(--muted); }

/* статус отправки */
.form-status {
  grid-column: 1 / -1;
  display: none;
  padding: 13px 16px;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.5;
}

.form-status.is-error {
  display: block;
  color: #fecaca;
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .35);
}

.form-status.is-ok {
  display: block;
  color: #bbf7d0;
  background: rgba(34, 197, 94, .1);
  border: 1px solid rgba(34, 197, 94, .3);
}

.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- Боковая колонка ---------- */
.lead-aside {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
}

.lead-aside h2 {
  font-family: 'Manrope', 'Manrope Fallback', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.lead-aside ol {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 14px;
}

.lead-aside li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
}

.lead-aside li::before {
  content: counter(step);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  padding-top: 2px;
}

.aside-meta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 13px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.aside-meta a { color: var(--text-soft); text-decoration: none; }
.aside-meta a:hover { color: var(--accent-soft); }

/* ---------- Правовая страница ---------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 6vh, 72px) 24px clamp(56px, 9vh, 110px);
}

.legal h1 {
  font-family: 'Manrope', 'Manrope Fallback', sans-serif;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  color: #fff;
  margin-bottom: 10px;
}

.legal .updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 34px;
}

.legal h2 {
  font-family: 'Manrope', 'Manrope Fallback', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 34px 0 12px;
  letter-spacing: -.01em;
}

.legal p,
.legal li { color: var(--text-soft); font-size: 15px; line-height: 1.7; }

.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0 16px 20px; display: grid; gap: 8px; }
.legal ul + p { margin-top: 14px; }

.legal a { color: var(--accent-soft); text-underline-offset: 3px; }

.legal .note {
  margin-top: 36px;
  padding: 16px 18px;
  border-left: 2px solid var(--accent);
  background: rgba(56, 189, 248, .06);
  font-size: 14px;
  color: var(--text-soft);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: none;
}

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

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .lead-layout { grid-template-columns: minmax(0, 1fr); }
  .lead-aside { order: 2; }
}

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Кастомный список (select) ---------- */
.select { position: relative; }

.select-ready .select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.select-trigger {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  text-align: left;
  background: #04090f;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}

.select-ready .select-trigger { display: flex; }

.select-trigger:hover { border-color: rgba(255, 255, 255, .22); background: #050e17; }

.select-trigger:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-color: transparent;
}

.select-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #8494a8;
  transition: transform .22s var(--ease), color .2s var(--ease);
}

.select.is-open .select-chevron { transform: rotate(180deg); color: var(--accent-soft); }

.select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #060d15;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .9);
  max-height: 264px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
}

.select.is-open .select-menu { opacity: 1; visibility: visible; transform: none; }
.select-menu[hidden] { display: none; }

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 14.5px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}

.select-option + .select-option { margin-top: 2px; }

.select-option.is-active { background: rgba(56, 189, 248, .12); color: #fff; }
.select-option[aria-selected="true"] { color: #fff; }

.select-option[aria-selected="true"]::after {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Кнопки формы ---------- */
.btn svg { transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset;
}

.btn-primary:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset,
              0 12px 26px -16px rgba(56, 189, 248, .95);
}

.btn.is-loading { cursor: progress; }

.btn.is-loading::before {
  content: '';
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(4, 18, 28, .3);
  border-top-color: #04121c;
  animation: btn-spin .7s linear infinite;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

.form-status strong { font-weight: 700; }

.form-status.is-ok:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 4px; }

/* ---------- Смета из конструктора на странице заявки ---------- */
.estimate {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(56, 189, 248, .07);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
}


/* ---------- смета без формы: расчёт и кнопки отправки ---------- */
.estimate-card {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
  border: 1px solid rgba(125, 211, 252, .22);
  border-radius: 12px;
  background: rgba(56, 189, 248, .05);
}

.estimate-card__label {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.estimate-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.estimate-lines li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.estimate-lines li > span { color: var(--muted); flex: 0 0 auto; }

.estimate-lines li > b {
  font-weight: 500;
  color: #e6f4ff;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.estimate-total {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.estimate-total > span { font-size: 13px; color: var(--muted); }

.estimate-total > b {
  font-family: 'Manrope', 'Manrope Fallback', sans-serif;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
}

.estimate-total > em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--accent-soft);
}

.estimate-card__hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.estimate-card__hint a { color: var(--accent-soft); text-underline-offset: 3px; }

.estimate-actions { margin-top: 18px; }

@media (max-width: 620px) {
  .estimate-actions { flex-direction: column; align-items: stretch; }
  .estimate-actions .btn { width: 100%; justify-content: center; }
}


/* ---------- отправка: блок аккуратно сворачивается ---------- */
.mail-fold {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .45s cubic-bezier(.16, 1, .3, 1),
              opacity .28s ease;
}

.mail-fold__inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 18px;
}

.mail-fold.is-folded {
  grid-template-rows: 0fr;
  opacity: 0;
}

/* ---------- сцена: ожидание / получено / не пришло ---------- */
.mail-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  margin-top: 22px;
  padding: 30px 22px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  animation: stage-in .42s cubic-bezier(.16, 1, .3, 1) both;
}

.mail-stage[hidden] { display: none; }

.mail-stage__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 380px;
}

.mail-stage.is-sent .mail-stage__text { color: #d7fbe4; }
.mail-stage.is-failed .mail-stage__text { color: #fecdd3; }

/* иконка: круг и знак всегда по центру одного бокса 64×64 */
.mail-stage__icon {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
}

.mail-icon {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  opacity: 0;
  pointer-events: none;
}

.mail-ring {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 164;
  stroke-dashoffset: 164;
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.mail-tick,
.mail-cross {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dashoffset: 48;
}

/* ожидание */
.mail-stage.is-waiting .mail-icon--waiting { opacity: 1; }

.mail-ring--track { stroke: rgba(125, 211, 252, .16); }

.mail-ring--spin {
  stroke: #7dd3fc;
  stroke-dasharray: 62 102;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 7px rgba(125, 211, 252, .45));
  animation: ring-spin 1.15s linear infinite;
}

/* получено */
.mail-stage.is-sent .mail-icon--sent { opacity: 1; }
.mail-stage.is-sent .mail-ring--ok {
  stroke: #86efac;
  stroke-dasharray: 164;
  animation: ring-draw .5s ease forwards;
}
.mail-stage.is-sent .mail-tick {
  stroke: #86efac;
  stroke-dasharray: 44;
  animation: mark-draw .4s .3s cubic-bezier(.65, 0, .35, 1) forwards;
}
.mail-stage.is-sent .mail-icon--sent {
  filter: drop-shadow(0 0 9px rgba(134, 239, 172, .45));
  animation: icon-pop .32s .55s ease both;
}

/* не пришло */
.mail-stage.is-failed .mail-icon--failed { opacity: 1; }
.mail-stage.is-failed .mail-ring--bad {
  stroke: #fb7185;
  stroke-dasharray: 164;
  animation: ring-draw .5s ease forwards;
}
.mail-stage.is-failed .mail-cross {
  stroke: #fb7185;
  stroke-width: 3.4;
  stroke-dasharray: 48;
  animation: mark-draw .42s .3s cubic-bezier(.65, 0, .35, 1) forwards;
}
.mail-stage.is-failed .mail-icon--failed {
  filter: drop-shadow(0 0 9px rgba(251, 113, 133, .35));
  animation: icon-pop .32s .55s ease both;
}

@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }

@keyframes stage-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@keyframes icon-pop {
  0%   { transform: scale(.86); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@media (max-width: 620px) {
  .mail-stage { padding: 26px 18px; }
  .mail-stage__icon { width: 56px; height: 56px; }
  .mail-icon { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .mail-fold, .mail-stage, .mail-icon { transition: none; animation: none !important; }
  .mail-ring, .mail-tick, .mail-cross { animation: none !important; stroke-dashoffset: 0; }
}
