/* =========================================================
   Страница брифа. Дополняет style.css — токены и кнопки оттуда.
   Все отступы кратны 4.
   ========================================================= */

/* тёмная тема для нативных контролов: выпадающий список, календарь, скроллбары */
.brief-page { background: var(--bg); color-scheme: dark; }
/* display у .btn и других классов не должен перебивать атрибут hidden */
.brief-page [hidden] { display: none !important; }

/* ——— шапка ——— */
.bhead { border-bottom: 1px solid var(--hair); background: rgba(10, 10, 11, 0.9); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 30; }
.bhead__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; }
.bhead__in { justify-content: flex-start; }

.bmain { padding-block: 32px 120px; }

/* ——— прогресс ——— */
.steps-nav { margin-bottom: 32px; }
.steps-nav ol { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.steps-nav button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--dim);
  font-size: 13.5px; transition: color 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.steps-nav button span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 500; flex: none;
}
.steps-nav button:hover { color: var(--text); }
.steps-nav button.is-done { color: var(--muted); }
.steps-nav button.is-done span { background: rgba(255, 90, 31, 0.2); color: var(--orange-2); }
.steps-nav button.is-current { color: var(--text); border-color: var(--orange); background: rgba(255, 90, 31, 0.08); }
.steps-nav button.is-current span { background: var(--orange); color: #14100d; }
.steps-nav__bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.steps-nav__bar i { display: block; height: 100%; width: 16%; border-radius: 999px; background: var(--grad); transition: width 0.6s var(--ease); }

/* ——— раскладка ——— */
.blayout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }

/* ——— форма ——— */
.bform { min-width: 0; }
.pane { animation: paneIn 0.5s var(--ease) both; }
@keyframes paneIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pane .h2 { margin-bottom: 12px; }
.pane__lead { color: var(--muted); max-width: 60ch; margin-bottom: 32px; }

/* вопрос */
.q { display: grid; gap: 12px; padding-block: 24px; border-top: 1px solid var(--hair); }
.q:first-of-type { border-top: 0; padding-top: 0; }
.q__title { font-family: var(--font-display); font-weight: 500; font-size: 16.5px; line-height: 1.35; color: var(--text); }
.q__title b { color: var(--orange); font-weight: 500; }
.q__hint { font-size: 14px; color: var(--dim); margin-top: -4px; max-width: 78ch; text-wrap: pretty; }
.q__note { font-size: 13.5px; color: var(--orange-2); padding: 12px 16px; border-radius: var(--r-md); background: rgba(255, 90, 31, 0.08); border: 1px solid rgba(255, 90, 31, 0.28); }
.q__error { font-size: 13.5px; color: #ff6b6b; }
/* ошибка отправки брифа — заметнее обычной подписи под полем */
.send-error { margin-top: 16px; padding: 12px 16px; border-radius: var(--r-md); background: rgba(255, 107, 107, 0.08); border: 1px solid rgba(255, 107, 107, 0.3); }
.q[hidden], [data-when][hidden] { display: none; }
[data-when] { display: grid; gap: 12px; }

/* поля */
.brief-page input[type="text"], .brief-page input[type="url"], .brief-page input[type="email"],
.brief-page input[type="tel"], .brief-page input[type="date"], .brief-page textarea, .brief-page select {
  width: 100%; padding: 12px 16px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hair-2); color: var(--text);
  outline: none; font-size: 15.5px;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.brief-page textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.brief-page ::placeholder { color: #5e5e5e; }
.brief-page input:focus, .brief-page textarea:focus, .brief-page select:focus {
  border-color: var(--orange); background: rgba(255, 255, 255, 0.06); box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.15);
}
.brief-page .is-invalid { border-color: #ff5252; }
.brief-page select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239b9b9b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.brief-page select option { background: var(--surface-2); color: var(--text); }
.brief-page input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }

.rows { display: grid; gap: 12px; }
.rows--2 { grid-template-columns: 1fr 1fr; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }

/* варианты-карточки */
.opts { display: grid; gap: 12px; }
.opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt__box {
  display: grid; gap: 4px; height: 100%; padding: 16px;
  border-radius: var(--r-md); border: 1px solid var(--hair-2); background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.opt__box b { font-weight: 500; font-size: 15px; }
.opt__box i { font-style: normal; font-size: 13px; color: var(--dim); }
.opt:hover .opt__box { border-color: rgba(255, 255, 255, 0.24); }
.opt input:checked + .opt__box { border-color: var(--orange); background: rgba(255, 90, 31, 0.1); }
.opt input:checked + .opt__box b { color: var(--orange-2); }
.opt input:focus-visible + .opt__box { box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.2); }

/* чипы-галочки */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbox { cursor: pointer; }
.chipbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.chipbox span {
  display: inline-block; padding: 8px 16px; border-radius: 999px; font-size: 14.5px; color: var(--muted);
  border: 1px solid var(--hair-2); background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease), color 0.4s var(--ease);
}
.chipbox:hover span { color: var(--text); }
.chipbox input:checked + span { border-color: var(--orange); background: rgba(255, 90, 31, 0.12); color: var(--orange-2); }
.chipbox input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.chipbox input:focus-visible + span { box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.2); }

.check--inline { padding: 0; font-size: 14.5px; }

/* ——— экран проверки ——— */
.review { display: grid; gap: 16px; margin-bottom: 32px; }
.review__group { border-radius: var(--r-lg); border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.03); padding: 24px; }
.review__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.review__head h3 { font-family: var(--font-display); font-weight: 500; font-size: 17px; }
.review__edit { font-size: 13.5px; color: var(--orange-2); border-bottom: 1px solid rgba(255, 138, 61, 0.35); cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0; }
.review__edit:hover { border-bottom-color: var(--orange-2); }
.review dl { display: grid; gap: 12px; }
.review dt { font-size: 13.5px; color: var(--dim); }
.review dd { margin: 0; font-size: 15px; color: var(--text); white-space: pre-line; }
.review dd.is-empty { color: #5e5e5e; }

.terms { border-radius: var(--r-lg); border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.03); padding: 24px; }
.terms__title { font-family: var(--font-display); font-weight: 500; font-size: 17px; margin-bottom: 16px; }
.terms__list { display: grid; gap: 12px; margin-bottom: 24px; }
.terms__list li { position: relative; padding-left: 20px; font-size: 14.5px; color: var(--muted); }
.terms__list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.consents { display: grid; gap: 16px; padding-top: 24px; border-top: 1px solid var(--hair); }
.consents .check { padding: 0; align-items: flex-start; font-size: 14.5px; color: var(--muted); }
.consents .check b { color: var(--orange); font-weight: 500; }
.consents .check i { font-style: normal; color: var(--dim); }
.consents .check.is-invalid .check__box { border-color: #ff5252; }

/* ——— экран успеха ——— */
/* На этом шаге карточка заказа скрыта, поэтому раскладка схлопывается в одну
   колонку — иначе колонка в 320 px осталась бы пустой и сдвинула экран влево. */
.blayout.is-done { grid-template-columns: minmax(0, 1fr); }
.pane--done {
  text-align: center; padding-block: 48px;
  min-height: calc(100vh - 224px);
  display: flex; flex-direction: column; justify-content: center;
}
.done__icon { width: 72px; height: 72px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; margin: 0 auto 24px; box-shadow: 0 16px 40px -16px rgba(255, 90, 31, 0.8); }
.done__icon svg { width: 32px; height: 32px; fill: none; stroke: #14100d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pane--done .pane__lead { margin-inline: auto; }
.done__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 24px; }
.done__note { font-size: 14px; color: var(--dim); max-width: 48ch; margin-inline: auto; }

/* ——— нижняя панель ——— */
.bbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--hair); }
.bbar__hint { font-size: 13.5px; color: var(--dim); }
.bbar.is-hidden { display: none; }

/* ——— боковая карточка ——— */
.bside { position: sticky; top: 96px; }
.bside__in { border-radius: var(--r-lg); border: 1px solid var(--hair); background: linear-gradient(180deg, var(--surface-2), var(--surface)); padding: 24px; display: grid; gap: 16px; }
.bside__label { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.bside .q { padding: 0; border: 0; gap: 8px; }
.bside .q__title { font-size: 14px; color: var(--muted); font-family: var(--font-body); }
/* итог — отдельная плашка, а не линия во всю ширину карточки */
.bside__total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: rgba(255, 90, 31, 0.1); border: 1px solid rgba(255, 90, 31, 0.28);
}
.bside__total span { font-size: 14px; color: var(--muted); }
.bside__total b { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; color: var(--orange-2); white-space: nowrap; }
.bside__total b small { font-family: var(--font-body); font-weight: 500; font-size: 0.7em; color: var(--muted); margin-right: 4px; }
.bside__list { display: grid; gap: 8px; }
.bside__list li { position: relative; padding-left: 20px; font-size: 13.5px; color: var(--muted); }
.bside__list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 4px; border-left: 1.5px solid var(--orange); border-bottom: 1.5px solid var(--orange); transform: rotate(-45deg); }
.bside__note { font-size: 13px; color: var(--dim); }

/* кнопка под карточкой заказа: лежит внутри .bside, поэтому прилипает вместе с ней */
.bside__tg { width: 100%; margin-top: 12px; justify-content: space-between; }
/* самолётик белый — подпись на кнопке остаётся тёмной */
.bside__tg .btn__icon { color: #fff; }

/* ——— адаптив ——— */
@media (max-width: 1024px) {
  .blayout { grid-template-columns: 1fr; }
  .bside { position: static; order: -1; }
  .bside__in { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
  .bside__label, .bside__total, .bside__note { grid-column: 1 / -1; }
  .bside__list { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .bmain { padding-block: 24px 96px; }
  .steps-nav ol { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .steps-nav ol::-webkit-scrollbar { display: none; }
  .steps-nav button { white-space: nowrap; }
  .opts--2, .opts--3 { grid-template-columns: 1fr; }
  .rows--2 { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .bside__in { grid-template-columns: 1fr; }
  .bside__list { grid-template-columns: 1fr; }
  .bbar {
    position: sticky; bottom: 0; margin-top: 24px;
    background: rgba(10, 10, 11, 0.92); backdrop-filter: blur(20px);
    padding: 16px 0; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
  }
  .bbar__hint { display: none; }
  .bbar .btn { flex: 1; justify-content: center; }
  .bbar .btn--primary { justify-content: space-between; }
  .done__actions .btn { width: 100%; justify-content: space-between; }
}
