/* smart-seo-top-theme — Окно «Бесплатная консультация»
   Часть style.css (вынесено 2026-11-10 для скорости). Подключается условно: functions.php → sst_enqueue(). */
/* ═══════════════════════════════════════════════
   ОКНО «БЕСПЛАТНАЯ КОНСУЛЬТАЦИЯ» (inc/consult-modal.php)
   Открывается любым элементом с [data-consult]
═══════════════════════════════════════════════ */
.cm { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cm[hidden] { display: none; }
.cm-backdrop { position: absolute; inset: 0; background: rgba(5,8,14,.72); backdrop-filter: blur(4px); animation: cmFade .2s ease both; }
.cm-box {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg-sidebar, #252526); border: 1px solid rgba(255,255,255,.1); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: cmIn .25s cubic-bezier(.22,.68,0,1.15) both;
}
@keyframes cmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
body.cm-lock { overflow: hidden; }

.cm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 30px 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.cm-title { margin: 0; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.2; font-weight: 700; color: #fff; }
.cm-x { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: var(--text-secondary); cursor: pointer; transition: background .15s, color .15s; }
.cm-x:hover { background: rgba(255,255,255,.1); color: #fff; }

.cm-body { padding: 24px 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.cm-pick { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,107,53,.12), rgba(247,37,133,.08)); border: 1px solid rgba(255,107,53,.35); }
.cm-pick[hidden] { display: none; }
.cm-pick-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cm-pick-label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #FF8A5B; }
.cm-pick-name { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.3; }
.cm-pick-note { font-size: 12.5px; color: var(--text-secondary); }
.cm-pick-note[hidden] { display: none; }
.cm-pick-price { flex-shrink: 0; font-family: var(--font-code, 'JetBrains Mono', monospace); font-size: 18px; font-weight: 700; color: #fff; white-space: nowrap; }
@media (max-width: 560px) { .cm-pick { flex-direction: column; align-items: flex-start; gap: 8px; } }
.cm-sub { margin: 0; font-size: 18px; font-weight: 500; color: var(--text-primary); }

.cm-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cm-tab {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 0 16px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03);
  color: var(--text-primary); font: 500 16px/1 var(--font-ui); cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.cm-tab:hover { border-color: rgba(255,255,255,.25); }
.cm-tab[data-mode="telegram"] svg { color: #2AABEE; }
.cm-tab[data-mode="phone"] svg { color: #25D366; }
.cm-tab.is-active { background: linear-gradient(135deg, #FF6B35, #F72585); border-color: transparent; color: #fff; }
.cm-tab.is-active svg { color: #fff; }

.cm-field {
  position: relative; display: flex; align-items: center; min-height: 64px; padding: 0 16px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03);
  transition: border-color .15s, box-shadow .15s;
}
.cm-field[hidden] { display: none; }
.cm-field:focus-within { border-color: rgba(255,107,53,.7); box-shadow: 0 0 0 3px rgba(255,107,53,.15); }
.cm-field.is-invalid { border-color: #f48771; box-shadow: 0 0 0 3px rgba(244,135,113,.15); }
.cm-field input { flex: 1; min-width: 0; height: 62px; border: 0; outline: 0; background: transparent; color: #fff; font: 400 18px/1 var(--font-ui); padding: 0; }
.cm-field input::placeholder { color: rgba(255,255,255,.4); }

  position: absolute; top: calc(100% + 10px); left: -10px; z-index: 5; width: 320px;
  display: flex; flex-direction: column; background: #1e1e1e; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.55); overflow: hidden;
}

.cm-hint { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; color: var(--text-secondary); }
.cm-hint svg { color: #FFC23D; flex-shrink: 0; }

.cm-submit {
  display: inline-flex; align-items: center; justify-content: center; min-height: 64px; padding: 0 36px; margin-top: 4px;
  border: 0; border-radius: 16px; cursor: pointer; align-self: flex-start;
  background: linear-gradient(135deg, #FF6B35, #F72585); color: #fff; font: 700 18px/1 var(--font-ui);
  box-shadow: 0 8px 28px rgba(247,37,133,.3); transition: transform .15s, box-shadow .15s, opacity .15s;
}
.cm-submit:hover { transform: translateY(-1px); box-shadow: 0 12px 34px rgba(247,37,133,.42); }
.cm-submit[disabled] { opacity: .6; cursor: wait; transform: none; }
.cm-submit--ghost { background: rgba(255,255,255,.06); box-shadow: none; border: 1px solid rgba(255,255,255,.15); align-self: center; }

.cm-consent { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.cm-consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cm-check { flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.03); position: relative; transition: background .15s, border-color .15s; }
.cm-consent input:checked + .cm-check { background: linear-gradient(135deg, #FF6B35, #F72585); border-color: transparent; }
.cm-consent input:checked + .cm-check::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.cm-consent input:focus-visible + .cm-check { box-shadow: 0 0 0 3px rgba(255,107,53,.3); }
.cm-consent.is-invalid .cm-check { border-color: #f48771; box-shadow: 0 0 0 3px rgba(244,135,113,.2); }
.cm-consent a { color: #FF8A5B; text-decoration: none; }
.cm-consent a:hover { text-decoration: underline; color: #FF8A5B; }

.cm-msg { margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; background: rgba(244,135,113,.1); border: 1px solid rgba(244,135,113,.35); color: #f48771; }
.cm-msg[hidden] { display: none; }

/* Окно консультации: выпадашка стран не обрезается окном */
@media (min-width: 561px) and (min-height: 700px) {
  .cm-box { overflow: visible; max-height: none; }
}
.cm-done { padding: 40px 30px 36px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cm-done[hidden] { display: none; }
.cm-done-ico { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; border-radius: 50%; color: #4ec9b0; background: rgba(78,201,176,.12); border: 1px solid rgba(78,201,176,.35); }
.cm-done h3 { margin: 6px 0 0; font-size: 24px; color: #fff; }
.cm-done p { margin: 0 0 8px; color: var(--text-secondary); }

@media (max-width: 560px) {
  .cm { padding: 0; align-items: flex-end; }
  .cm-box { max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .cm-head { padding: 20px 18px 16px; }
  .cm-body { padding: 18px 18px 22px; gap: 14px; }
  .cm-tab, .cm-field { min-height: 56px; border-radius: 14px; }
  .cm-field input { height: 54px; font-size: 16px; }
  .cm-submit { align-self: stretch; min-height: 58px; font-size: 17px; }
  .cm-sub { font-size: 16px; }
}

/* Окно консультации — компактный вариант (2026-11-10) */
.cm-box { max-width: 500px; border-radius: 18px; }
.cm-head { padding: 18px 22px 14px; align-items: center; }
.cm-title { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.25; }
.cm-x { width: 34px; height: 34px; border-radius: 9px; }
.cm-body { padding: 16px 22px 20px; gap: 12px; }
.cm-pick { padding: 11px 14px; border-radius: 12px; gap: 12px; }
.cm-pick-label { font-size: 10.5px; }
.cm-pick-name { font-size: 15px; }
.cm-pick-note { font-size: 12px; }
.cm-pick-price { font-size: 15px; }
.cm-sub { font-size: 15px; }
.cm-tabs { gap: 10px; }
.cm-tab { min-height: 48px; border-radius: 12px; font-size: 15px; gap: 10px; }
.cm-tab svg { width: 18px; height: 18px; }
.cm-field { min-height: 50px; border-radius: 12px; padding: 0 14px; }
.cm-field input { height: 48px; font-size: 16px; }
.cm-hint { font-size: 13.5px; gap: 8px; }
.cm-hint svg { width: 14px; height: 14px; }
.cm-submit { align-self: stretch; min-height: 50px; padding: 0 24px; margin-top: 0; border-radius: 12px; font-size: 16px; }
.cm-consent { font-size: 12px; line-height: 1.5; gap: 10px; }
.cm-check { width: 20px; height: 20px; border-radius: 5px; }
.cm-consent input:checked + .cm-check::after { left: 6px; top: 2px; }
.cm-done { padding: 30px 22px 26px; }
@media (min-width: 561px) and (min-height: 600px) { .cm-box { overflow: visible; max-height: none; } }
@media (max-width: 560px) {
  .cm-box { border-radius: 18px 18px 0 0; }
  .cm-head { padding: 16px 16px 12px; }
  .cm-body { padding: 14px 16px 18px; gap: 11px; }
  .cm-tab { min-height: 46px; }
  .cm-field { min-height: 48px; }
  .cm-field input { height: 46px; }
  .cm-submit { min-height: 50px; }
}
.cm-field--msg { padding: 0; align-items: stretch; }
.cm-field--msg textarea { flex: 1; min-height: 88px; padding: 13px 14px; border: 0; outline: 0; resize: vertical; background: transparent; color: #fff; font: 400 15px/1.5 var(--font-ui); border-radius: 12px; }
.cm-field--msg textarea::placeholder { color: rgba(255,255,255,.4); }



/* Кнопка «Заполнить бриф» после заявки (inc/brief.php) */
.cm-brief { align-self: stretch; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 2px; padding: 14px; border-radius: 12px; background: rgba(229,192,123,.07); border: 1px solid rgba(229,192,123,.22); animation: cmBrief .45s cubic-bezier(.2,.7,.2,1) .15s both; }
.cm-brief[hidden] { display: none; }
.cm-brief .cm-brief-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(255,255,255,.75); }
.cm-brief-btn { align-self: stretch; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: #fff; }
.cm-brief-btn:hover { color: #fff; }
@keyframes cmBrief { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cm-brief { animation: none; } }

/* ═══ Поле номера WhatsApp с выбором страны — общий компонент SSTPhone (main.js) ═══
   Окно консультации, квиз, попапы скачивания. Хост задаёт рамку/фон, здесь — флаг, код, список стран. */
.sph-host { position: relative; display: flex; align-items: center; }
.sph-wrap { padding-top: 0 !important; padding-bottom: 0 !important; min-height: 42px; gap: 0; }
.sph-wrap:focus-within { border-color: var(--border-focus, #569CD6); }
.sph-in { flex: 1; min-width: 0; height: 40px; border: 0 !important; outline: 0; background: transparent !important; color: inherit; font: inherit; padding: 0 !important; margin: 0 !important; box-shadow: none !important; }
.sph-host input.sph-in::placeholder, .sph-host input[type="tel"]::placeholder { color: rgba(255,255,255,.4); }
.sph-cc { position: relative; flex: 0 0 auto; margin-right: 8px; }
.sph-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; border: 0; background: none; cursor: pointer; border-radius: 6px; transition: background-color .15s; }
.sph-btn:hover, .sph-btn[aria-expanded="true"] { background: rgba(255,255,255,.07); }
.sph-btn:focus-visible { outline: 2px solid #569CD6; outline-offset: 1px; }
.sph-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.sph-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--text-secondary, #9D9D9D); transition: transform .15s; }
.sph-btn[aria-expanded="true"] .sph-caret { transform: rotate(180deg); }
.sph-dial { flex: 0 0 auto; margin-right: 8px; color: var(--text-primary, #fff); font-variant-numeric: tabular-nums; }
.cm-field .sph-dial { font-size: 18px; }
.sph-drop { position: absolute; top: calc(100% + 10px); left: -10px; z-index: 30; width: 320px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; background: #1e1e1e; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.55); overflow: hidden; text-align: left; }
.sph-drop[hidden] { display: none; }
.sph-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); color: var(--text-secondary, #9D9D9D); }
.sph-search .sph-q { flex: 1; min-width: 0; width: auto; height: 32px; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: #fff; font: 400 14px/1 var(--font-ui, Inter, system-ui, sans-serif); }
.sph-search .sph-q::placeholder { color: rgba(255,255,255,.4); }
.sph-list { margin: 0; padding: 6px; list-style: none; max-height: min(290px, 42vh); overflow-y: auto; overscroll-behavior: contain; }
.sph-sep { height: 1px; margin: 6px 4px; background: rgba(255,255,255,.1); }
.sph-list li[role="option"] { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.3; color: var(--text-primary, #fff); outline: none; transition: background-color .12s; }
.sph-list li[role="option"] img { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; flex-shrink: 0; }
.sph-list li[role="option"]:hover, .sph-list li[role="option"]:focus, .sph-list li[aria-selected="true"] { background: rgba(255,107,53,.12); }
.sph-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sph-code { color: var(--text-secondary, #9D9D9D); font-variant-numeric: tabular-nums; }
.sph-empty { padding: 14px 16px; font-size: 14px; color: var(--text-secondary, #9D9D9D); }
.sph-empty[hidden] { display: none; }
@media (max-width: 560px) {
  .sph-drop { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; width: auto; max-width: none; max-height: 70vh; z-index: 10001; border-radius: 16px; }
  .sph-list { max-height: calc(70vh - 56px); }
  .sph-search .sph-q { font-size: 16px; }
}
