/* ============================================================
   Квиз-подбор квартиры uyutcity.ru — окно поверх сайта.
   Цвета и шрифты — фирменные с сайта (ui-kit): красный #de2c37, графит #231f20,
   RotondaC для заголовков, Open Sans для текста. Префикс uq- — чтобы не задеть стили сайта.
   Узнаваемая деталь — прогресс вязаными стежками, как в логотипе.
   Шкала: 14 / 17 / 24 / 32 / 40 на компьютере, 13 / 16 / 20 / 24 / 28 на телефоне.
   ============================================================ */
@font-face { font-family: 'UQ Rotonda'; font-weight: 700; font-style: normal; font-display: swap; src: url('/Content/fonts/RotondaC-Bold.woff2') format('woff2'); }
@font-face { font-family: 'UQ Open Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('/Content/fonts/OpenSans.woff2') format('woff2'); }
@font-face { font-family: 'UQ Open Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('/Content/fonts/OpenSans-Semibold.woff2') format('woff2'); }

html.uq-lock, html.uq-lock body { overflow: hidden; }
.uq-modal, .uq-modal *, .uq-modal *::before, .uq-modal *::after { box-sizing: border-box; }
.uq-modal {
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; padding: 24px;
  font-family: 'UQ Open Sans', Arial, sans-serif; font-size: 17px; font-weight: 400; color: #231f20; line-height: 1.4;
}
.uq-modal[hidden] { display: none; }
/* Сбросы общих стилей сайта: на uyutcity.ru у тегов свои отступы и шрифт (p — padding-bottom 30px и Open-Sans 100, h2 — padding 30px,
   input — margin-bottom 20px, a — inline-block, header до 1000px — height 68px; замер на боевом 14.09.2026).
   Специфичность (0,1,0): выше тегов сайта, а классы квиза ниже по файлу их перебивают. */
.uq-modal :where(h2, p, figure, input, a) { margin: 0; padding: 0; font: inherit; }
.uq-modal :where(a) { display: inline; }
.uq-modal :where(header) { height: auto; }
.uq-modal :where(button) { font: inherit; color: inherit; }
.uq-backdrop { position: absolute; inset: 0; background: rgba(35, 31, 32, 0.62); }
.uq-modal :focus-visible { outline: 3px solid #231f20; outline-offset: 2px; }
.uq-modal .uq-dialog:focus, .uq-modal .uq-title:focus { outline: none; }

.uq-dialog {
  position: relative; display: grid; grid-template-columns: 38% minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  width: min(1040px, 100%); height: min(660px, 100%);
  background: #ffffff; border-radius: 10px; overflow: hidden; box-shadow: 0 30px 80px rgba(35, 31, 32, 0.35);
}

/* ---------- Фото комплекса ---------- */
.uq-photo { position: relative; min-height: 0; background: #f4f4f4; }
.uq-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% center; }
.uq-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(35, 31, 32, 0.82) 0%, rgba(35, 31, 32, 0.3) 30%, rgba(35, 31, 32, 0) 52%); }
.uq-photo-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 4px; padding: 24px 26px; color: #ffffff; }
.uq-photo-name { font-family: 'UQ Rotonda', Arial, sans-serif; font-weight: 700; font-size: 24px; line-height: 1.15; }
.uq-photo-meta { font-size: 14px; }

/* ---------- Правая часть ---------- */
.uq-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.uq-head { display: flex; align-items: center; gap: 16px; padding: 20px 28px 0; }
.uq-logo { display: block; height: 32px; width: auto; }
.uq-count { margin-left: auto; font-size: 14px; font-weight: 600; color: #6e6869; }
.uq-close {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-right: -6px;
  background: #ffffff; color: #231f20; border: 2px solid #ededed; border-radius: 50%; cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.uq-close:hover { border-color: #de2c37; color: #de2c37; }
.uq-close svg { width: 16px; height: 16px; }

/* Прогресс: ряд вязаных стежков (SVG «V» из двух лепестков). Отвеченный — красный, текущий — светлый, впереди — серый. */
.uq-stitches { display: flex; gap: 2px; padding: 16px 28px 0; }
.uq-stitch { display: block; width: 26px; height: 24px; fill: #e6e2e2; transition: fill 0.3s ease; }
.uq-stitch.current { fill: #f1a9ae; }
.uq-stitch.done { fill: #de2c37; }
.uq-is-intro .uq-stitches { visibility: hidden; }

.uq-stage { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 24px; -webkit-overflow-scrolling: touch; }
.uq-inner { width: 100%; }
.uq-is-intro .uq-inner { margin-block: auto; }

/* ---------- Тексты ---------- */
.uq-title { font-family: 'UQ Rotonda', Arial, sans-serif; font-weight: 700; font-size: 32px; line-height: 1.12; max-width: 22ch; text-wrap: balance; }
.uq-title--intro { font-size: 40px; }
.uq-lead { margin-top: 16px; max-width: 44ch; font-size: 17px; line-height: 1.55; color: #3d3738; }
.uq-intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 30px; }
.uq-meta { font-size: 14px; color: #6e6869; }
.uq-sub { margin-top: 10px; max-width: 54ch; font-size: 17px; line-height: 1.5; color: #3d3738; }

/* ---------- Варианты ответа ---------- */
.uq-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.uq-options--list { grid-template-columns: minmax(0, 1fr); }
.uq-option {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 62px; padding: 12px 18px;
  text-align: left; background: #ffffff; color: #231f20; border: 2px solid #e6e2e2; border-radius: 10px; cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.uq-option:hover { border-color: #de2c37; }
.uq-option-label { font-weight: 600; font-size: 17px; line-height: 1.3; }
.uq-option-hint { font-size: 14px; line-height: 1.35; color: #6e6869; }
.uq-option.selected { background: #de2c37; border-color: #de2c37; color: #ffffff; }
.uq-option.selected .uq-option-hint { color: #ffffff; }
.uq-nav { margin-top: 14px; min-height: 32px; }
.uq-back { padding: 6px 0; background: none; border: 0; font-size: 14px; font-weight: 600; color: #6e6869; cursor: pointer; }
.uq-back:hover { color: #231f20; }

/* ---------- Кнопка ---------- */
.uq-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 14px 34px;
  background: #de2c37; color: #ffffff; border: 0; border-radius: 30px; cursor: pointer; text-decoration: none;
  font-family: 'UQ Open Sans', Arial, sans-serif; font-weight: 600; font-size: 17px; transition: background-color 0.2s ease;
}
.uq-btn:hover { background: #c4232e; }
.uq-btn:active { background: #ba1d27; }
.uq-btn:disabled { opacity: 0.6; cursor: default; }
.uq-btn--sm { min-height: 46px; padding: 10px 24px; font-size: 16px; }

/* ---------- Финал ---------- */
.uq-form { display: grid; gap: 12px; margin-top: 18px; }
.uq-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.uq-chip { position: relative; }
.uq-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.uq-chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px; cursor: pointer;
  border: 2px solid #e6e2e2; border-radius: 30px; font-size: 17px; font-weight: 600;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.uq-chip span:hover { border-color: #de2c37; }
.uq-chip input:checked + span { background: #de2c37; border-color: #de2c37; color: #ffffff; }
.uq-chip input:focus-visible + span { outline: 3px solid #231f20; outline-offset: 2px; }
.uq-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.uq-field { display: flex; flex-direction: column; min-width: 0; }
.uq-field input {
  width: 100%; min-width: 0; min-height: 54px; padding: 12px 18px; background: #ffffff; color: #231f20;
  border: 2px solid #c3c3c3; border-radius: 8px; font-family: 'UQ Open Sans', Arial, sans-serif; font-weight: 600; font-size: 17px;
}
.uq-field input::placeholder { color: #767071; font-weight: 400; }
.uq-field input:focus { outline: none; border-color: #de2c37; }
.uq-form .uq-btn { width: 100%; }
.uq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.uq-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.uq-consent { font-size: 14px; line-height: 1.45; color: #6e6869; }
.uq-consent a { color: #231f20; text-decoration: underline; text-underline-offset: 2px; }
.uq-error { display: none; margin-top: 6px; font-size: 14px; color: #b3141f; }
.uq-chips-wrap.invalid .uq-error, .uq-field.invalid .uq-error { display: block; }
.uq-field.invalid input { border-color: #b3141f; }
.uq-success, .uq-failure { display: none; font-size: 17px; font-weight: 600; }
.uq-success { color: #1f7a3d; }
.uq-failure { color: #b3141f; }
.uq-success.visible, .uq-failure.visible { display: block; }
.uq-form.sent .uq-chips-wrap, .uq-form.sent .uq-fields, .uq-form.sent .uq-consent, .uq-form.sent .uq-btn { display: none; }
.uq-debug { display: none; padding: 10px 12px; font-size: 14px; line-height: 1.5; color: #5a4300; background: #fff6d6; border: 1px dashed #d9b64a; border-radius: 8px; }
.uq-debug.visible { display: block; }

/* ---------- Экраны поуже ---------- */
@media (max-width: 1023px) {
  .uq-dialog { grid-template-columns: 32% minmax(0, 1fr); }
  .uq-title { font-size: 28px; }
  .uq-title--intro { font-size: 34px; }
}
@media (max-width: 767px) {
  .uq-modal { padding: 0; font-size: 16px; }
  .uq-dialog { width: 100%; height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); border-radius: 0; }
  .uq-photo { grid-row: 1; display: none; }
  .uq-main { grid-row: 2; }
  .uq-is-intro .uq-photo { display: block; height: 34vh; }
  .uq-is-intro .uq-stitches { display: none; }
  .uq-is-intro .uq-inner { margin-block: 0; }
  .uq-photo-cap { padding: 16px 18px; }
  .uq-photo-name { font-size: 20px; }
  .uq-photo-meta { font-size: 13px; }
  .uq-head { padding: 12px 16px 0; }
  .uq-logo { height: 26px; }
  .uq-count { font-size: 13px; }
  .uq-stitches { padding: 12px 16px 0; }
  .uq-stage { padding: 14px 16px 18px; }
  .uq-title { font-size: 24px; }
  .uq-title--intro { font-size: 28px; }
  .uq-lead { margin-top: 12px; font-size: 16px; }
  .uq-meta { font-size: 13px; }
  .uq-intro-actions { margin-top: 22px; }
  .uq-intro-actions .uq-btn { width: 100%; }
  .uq-options { gap: 8px; margin-top: 18px; }
  .uq-option { min-height: 56px; padding: 10px 14px; }
  .uq-option-label { font-size: 16px; }
  .uq-option-hint { font-size: 13px; }
  .uq-back { font-size: 16px; }
  .uq-sub { font-size: 16px; }
  .uq-form { gap: 10px; margin-top: 14px; }
  .uq-chip span { min-height: 42px; padding: 8px 14px; font-size: 16px; }
  .uq-field input { min-height: 50px; padding: 10px 14px; font-size: 16px; }
  .uq-btn { font-size: 16px; }
  .uq-form .uq-btn { min-height: 50px; }
  .uq-consent, .uq-error, .uq-debug { font-size: 13px; }
  .uq-nav { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .uq-option, .uq-btn, .uq-close, .uq-chip span, .uq-stitch { transition: none; }
}
