/* ============================================================
   Попап со скидкой за подписку — <dialog class="sp26"> в footer.php.
   Макет Анатолия под дизайн подвала 2026, мокап — larne-crm
   docs/mockups/2026-10-29-subscribe-popup.html. Префикс sp26-.
   Показ и отправка — script.js (window.LarnePromoPopup).
   Правила с явными шрифтом, отступами и регистром: глобальные стили
   шаблона задают input, button и заголовкам своё.
   ============================================================ */

.sp26 {
  --sp26-ink:    #1d1b18;
  --sp26-ink-2:  #303030;
  --sp26-muted:  #7d7a75;
  --sp26-faint:  #b0b0b0;
  --sp26-line:   #d9d3c8;
  --sp26-bg:     #f7f5f1;
  --sp26-accent: #8a7a63;
  --sp26-err:    #b4453a;
  --sp26-sans:   'TT Norms', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  width: min(760px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--sp26-bg);
  color: var(--sp26-ink);
  font-family: var(--sp26-sans);
  -webkit-font-smoothing: antialiased;
  box-shadow: 0 30px 100px rgba(16, 14, 10, .25);
}
.sp26::backdrop {
  background: rgba(29, 27, 24, .5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sp26 *, .sp26 *::before, .sp26 *::after { box-sizing: border-box; }

.sp26__inner {
  display: grid;
  grid-template-columns: 43% 57%;
  min-height: 500px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sp26__photo { position: relative; overflow: hidden; background: #ccc4b9; }
.sp26__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 51% 50%;
}
.sp26__body {
  min-width: 0;
  padding: 34px 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sp26__step[hidden] { display: none; }

.sp26__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--sp26-ink-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sp26__close svg { width: 18px; height: 18px; transition: transform .45s cubic-bezier(.22, .61, .36, 1); }
.sp26__close:focus-visible { outline: 2px solid var(--sp26-accent); outline-offset: 2px; }
.sp26__close:focus-visible svg { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .sp26__close:hover svg { transform: rotate(180deg); } }

.sp26__title {
  margin: 0;
  font-family: var(--sp26-sans);
  font-size: 40px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: none;
  color: var(--sp26-ink);
}
.sp26__subtitle { margin: 8px 0 14px; font-size: 17px; line-height: 1.3; color: var(--sp26-ink); }
.sp26__description { margin: 0 0 20px; max-width: 34ch; font-size: 13px; line-height: 1.55; color: var(--sp26-muted); }

.sp26__fields { display: grid; gap: 14px; }
.sp26__field {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--sp26-muted);
}
.sp26__field em { margin-left: 6px; font-style: normal; color: var(--sp26-faint); }
.sp26__field input {
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 6px 0 8px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-bottom: 1px solid var(--sp26-line);
  border-radius: 0;
  background: transparent;
  font-family: var(--sp26-sans);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sp26-ink);
  transition: border-color .25s ease;
}
.sp26__field input::placeholder { color: var(--sp26-faint); }
.sp26__field input:focus { outline: none; border-bottom-color: var(--sp26-accent); }
.sp26__field input[aria-invalid="true"] { border-bottom-color: var(--sp26-err); }
.sp26__field input:-webkit-autofill {
  -webkit-text-fill-color: var(--sp26-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--sp26-bg) inset;
  box-shadow: 0 0 0 1000px var(--sp26-bg) inset;
}

.sp26__checks { display: grid; gap: 10px; margin: 18px 0; }
.sp26__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sp26-muted);
  cursor: pointer;
}
.sp26__check input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  display: grid;
  place-content: center;
  border: 1px solid var(--sp26-faint);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.sp26__check input:checked { background: var(--sp26-ink); border-color: var(--sp26-ink); }
.sp26__check input:checked::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.sp26__check input:focus-visible { outline: 2px solid var(--sp26-accent); outline-offset: 3px; }
.sp26__check input[aria-invalid="true"] { border-color: var(--sp26-err); }
.sp26__check a { color: inherit; text-decoration: underline; text-decoration-color: var(--sp26-line); text-underline-offset: 3px; }
.sp26__check a:hover { color: var(--sp26-ink); }

.sp26__submit {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 20px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--sp26-ink);
  border-radius: 0;
  background: var(--sp26-ink);
  color: #fff;
  font-family: var(--sp26-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.sp26__submit:hover { background: #000; }
.sp26__submit:disabled { opacity: .65; cursor: wait; }
.sp26__submit:focus-visible { outline: 2px solid var(--sp26-accent); outline-offset: 3px; }
.sp26__submit--ghost { background: transparent; color: var(--sp26-ink); }
.sp26__submit--ghost:hover { background: var(--sp26-ink); color: #fff; }

.sp26__status { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--sp26-err); overflow-wrap: anywhere; }
.sp26__status:empty { display: none; }
.sp26__foot { margin: 12px 0 0; font-size: 11px; line-height: 1.5; text-align: center; color: var(--sp26-faint); }
.sp26__status:not(:empty) + .sp26__foot { display: none; }

.sp26__step--done .sp26__title { font-size: 30px; letter-spacing: -.01em; }
.sp26__step--done .sp26__description { max-width: 36ch; margin: 14px 0 26px; font-size: 14px; color: var(--sp26-ink-2); }

@media (max-width: 620px) {
  .sp26 {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .sp26__inner {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    -webkit-overflow-scrolling: touch;
  }
  .sp26__photo { height: 150px; }
  .sp26__photo img { object-position: 50% 24%; }
  .sp26__close {
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(247, 245, 241, .92);
    touch-action: manipulation;
  }
  .sp26__body { padding: 22px 22px max(22px, env(safe-area-inset-bottom)); justify-content: flex-start; }
  .sp26__title { font-size: 34px; }
  .sp26__subtitle { margin: 6px 0 10px; font-size: 16px; }
  .sp26__description { margin-bottom: 16px; }
  /* 16px — iOS не увеличивает страницу при фокусе в поле */
  .sp26__field input { height: 46px; font-size: 16px; scroll-margin-block: 60px; }
  .sp26__check { min-height: 40px; font-size: 12px; line-height: 1.45; }
  .sp26__check input { flex-basis: 20px; width: 20px; height: 20px; }
  .sp26__submit { height: 48px; font-size: 11px; touch-action: manipulation; }
  .sp26__step--done .sp26__title { font-size: 26px; }
}
@media (max-width: 620px) and (max-height: 650px) {
  .sp26__photo { height: 112px; }
  .sp26__body { padding-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp26 * { transition: none !important; }
  .sp26__close:hover svg, .sp26__close:focus-visible svg { transform: none; }
}
