/* Формы «Ранний доступ» / «Обратный звонок» — окно поверх страницы в стилистике сайта */

html.zm-lock { overflow: hidden; }

/* Окно */
.zm-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: #f7f5f1;
  color: #183c2e;
  box-shadow: 0 30px 80px rgba(16, 42, 32, .35);
  overflow: hidden;
}
.zm-modal:not([open]) { display: none; }
.zm-modal::backdrop { background: rgba(16, 42, 32, .55); backdrop-filter: blur(4px); animation: zm-fade .25s ease both; }
.zm-modal[open] { animation: zm-rise .42s var(--s-ease, cubic-bezier(.16, 1, .3, 1)) both; display: flex; flex-direction: column; }
@keyframes zm-fade { from { opacity: 0; } }
@keyframes zm-rise { from { opacity: 0; transform: translateY(24px) scale(.985); } }

.zm-modal__panel { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 28px 40px 40px; }
.zm-modal__close {
  position: absolute; top: 20px; right: 20px; z-index: 3;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid #cbd6cb; border-radius: 50%; background: #fff; color: #183c2e; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.zm-modal__close svg { width: 20px; height: 20px; }
.zm-modal__close:hover { background: #183c2e; border-color: #183c2e; color: #D0FA98; }

.zm-badge {
  display: inline-block; margin: 8px 0 0; padding: 6px 12px; border-radius: 6px;
  background: #D0FA98; color: #183c2e; font-size: 1.2rem; font-weight: 600; line-height: 1.3;
}
.zm-title { margin: 14px 0 0; font-size: clamp(2.6rem, 4.4vw, 3.6rem); font-weight: 750; line-height: 1.1; letter-spacing: -.035em; color: #183c2e; }
.zm-lead { margin: 14px 0 0; font-size: 1.6rem; line-height: 1.55; color: #536858; max-width: 52ch; }

.zm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.zm-single { margin-top: 16px; }
.zm-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-top: 0; }
.zm-form > .zm-field { margin-top: 16px; }
.zm-field__label { font-size: 1.3rem; font-weight: 600; color: #183c2e; }
.zm-field--req .zm-field__label > span::after { content: " *"; color: #57734a; }
.zm-field em { margin-left: 6px; font-style: normal; font-weight: 400; color: #536858; }
.zm-field input, .zm-field select, .zm-field textarea {
  width: 100%; height: 54px; padding: 0 14px; border: 1px solid #cbd6cb; border-radius: 10px;
  background: #fff; color: #183c2e; font: inherit; font-size: 1.6rem; line-height: 1.3;
  transition: border-color .2s, box-shadow .2s;
}
.zm-field textarea { height: auto; min-height: 92px; padding: 14px; resize: vertical; }
.zm-field select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23183c2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.zm-field input::placeholder, .zm-field textarea::placeholder { color: #8a9b8f; }
.zm-field input:hover, .zm-field select:hover, .zm-field textarea:hover { border-color: #9db3a4; }
.zm-field input:focus-visible, .zm-field select:focus-visible, .zm-field textarea:focus-visible { outline: 2px solid #183c2e; outline-offset: -2px; border-color: #183c2e; }
.zm-field [aria-invalid="true"] { border-color: #b3261e; box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }

/* Формат оплаты */
.zm-pay { margin: 24px 0 0; padding: 0; border: 0; min-width: 0; }
.zm-pay legend { padding: 0; margin-bottom: 10px; font-size: 1.3rem; font-weight: 600; color: #183c2e; }
.zm-pay__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zm-pay__item { position: relative; display: block; cursor: pointer; }
.zm-pay__item input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.zm-pay__card {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 44px 14px 16px;
  border: 1px solid #cbd6cb; border-radius: 12px; background: #fff; transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.zm-pay__card b { font-size: 1.5rem; font-weight: 650; line-height: 1.3; }
.zm-pay__card small { font-size: 1.25rem; line-height: 1.45; color: #536858; }
.zm-pay__card::after {
  content: ""; position: absolute; top: 15px; right: 14px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid #9db3a4; background: #fff; transition: all .2s;
}
.zm-pay__item:hover .zm-pay__card { border-color: #183c2e; }
.zm-pay__item input:checked + .zm-pay__card { border-color: #183c2e; background: #edf3e8; box-shadow: 0 0 0 1px #183c2e inset; }
.zm-pay__item input:checked + .zm-pay__card::after { border-color: #183c2e; background: #D0FA98; box-shadow: 0 0 0 4px #183c2e inset; }
.zm-pay__item input:focus-visible + .zm-pay__card { outline: 2px solid #183c2e; outline-offset: 3px; }
.zm-note { margin: 12px 0 0; font-size: 1.25rem; line-height: 1.5; color: #536858; }

.zm-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.zm-consent { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; font-size: 1.25rem; line-height: 1.5; color: #536858; cursor: pointer; }
.zm-consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: #183c2e; cursor: pointer; }
.zm-consent a { color: #183c2e; text-decoration: underline; text-underline-offset: 2px; }
.zm-consent a:hover { color: #57734a; }
.zm-consent.is-invalid { color: #b3261e; }

.zm-status { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: #fdecea; color: #8c1d18; font-size: 1.4rem; line-height: 1.45; }
.zm-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; margin-top: 20px; padding: 0 24px;
  border: 0; border-radius: 12px; background: #D0FA98; color: #183c2e; font: inherit; font-size: 1.5rem; font-weight: 650; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.zm-submit .s-icon { width: 1.8rem; height: 1.8rem; transition: transform .25s var(--s-ease, ease); }
.zm-submit:hover:not(:disabled) { background: #183c2e; color: #D0FA98; }
.zm-submit:hover .s-icon { transform: translateX(3px); }
.zm-submit:disabled { opacity: .6; cursor: wait; }

/* Успех */
.zm-success { padding: 56px 0 8px; text-align: left; }
.zm-success[hidden], .zm-form[hidden], .zm-status[hidden] { display: none; }
.zm-success__mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #D0FA98; color: #183c2e; animation: zm-pop .5s var(--s-ease, ease) both; }
.zm-success__mark svg { width: 34px; height: 34px; }
.zm-success .zm-title { margin-top: 24px; }
@keyframes zm-pop { from { transform: scale(.4); opacity: 0; } }

@media only screen and (max-width: 640px) {
  .zm-modal { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .zm-modal__panel { padding: 20px 20px 28px; }
  .zm-modal__close { top: 14px; right: 14px; }
  .zm-grid, .zm-pay__grid { grid-template-columns: 1fr; }
  .zm-field input, .zm-field select { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .zm-modal[open], .zm-modal::backdrop, .zm-success__mark { animation: none; }
}

.zm-form .zm-title, .zm-success .zm-title { padding-right: 52px; }
.zm-pay legend em { margin-left: 6px; font-style: normal; font-weight: 400; color: #536858; }
