/* =========================================================
   /brief — project brief questionnaire
   Uses tokens from style.css (--red, --ink, --paper, fonts)
   ========================================================= */

.brief-hero { padding-bottom: clamp(2rem, 4vw, 3.5rem); }

/* Progress bar under the header */
.brief-progress { position: fixed; left: 0; right: 0; top: var(--header-h); height: 3px; z-index: 40; background: rgba(12,12,12,.08); pointer-events: none; }
.brief-progress__bar { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }

.brief { position: relative; }
.brief .hp { position: absolute; left: -9999px; }
.brief-alert { background: var(--red); color: var(--white); padding: 1rem 1.2rem; font-weight: 600; margin-bottom: 2rem; }
.brief-alert a { border-bottom: 1px solid currentColor; }

/* Sections */
.brief-sec, .brief-send { border-top: 1px solid var(--ink); padding: clamp(2.5rem, 5vw, 4.5rem) 0; }
.brief-sec__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(1.5rem, 5vw, 6rem); align-items: start; }
.brief-sec__head { position: sticky; top: calc(var(--header-h) + 2rem); }
.brief-sec__num { display: block; font-family: var(--f-display); font-size: clamp(4rem, 9vw, 9rem); line-height: .82; color: var(--red); letter-spacing: -.01em; }
.brief-sec__head h2 { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(1.8rem, 3.2vw, 3rem); line-height: .95; margin-top: .6rem; }
.brief-sec__head p { margin-top: .8rem; max-width: 34ch; font-size: .95rem; line-height: 1.5; opacity: .75; }

.brief-sec__body { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem 1.6rem; }

/* Questions */
.bq { grid-column: 1 / -1; min-width: 0; border: 0; padding: 0; margin: 0; }
.bq--half { grid-column: auto; }
.bq[hidden] { display: none !important; }
.bq__label { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .75rem; padding: 0; }
.bq__req { color: var(--red); }
.bq__opt { font-size: .75rem; font-weight: 500; opacity: .55; margin-left: .3rem; }
.bq__help { font-size: .85rem; opacity: .7; margin: -.4rem 0 .8rem; }
.bq__group { font-size: .8rem; font-weight: 600; color: var(--red); margin: 1.1rem 0 .55rem; }
.bq__group:first-of-type { margin-top: 0; }

.bq input[type="text"], .bq input[type="email"], .bq input[type="tel"], .bq input[type="url"], .bq input[type="date"], .bq textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: .7rem 0;
}
.bq textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
.bq input::placeholder, .bq textarea::placeholder { color: rgba(12,12,12,.4); }
.bq input:focus, .bq textarea:focus { outline: none; border-bottom: 2px solid var(--red); padding-bottom: calc(.7rem - 1px); }

/* Choice chips (radio + checkbox) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; gap: .5rem; padding: .6rem .95rem; font-size: .92rem; line-height: 1.25;
  border: 1px solid rgba(12,12,12,.35); background: transparent; transition: background .25s, color .25s, border-color .25s;
}
.chip input[type="checkbox"] + span::before {
  content: ""; width: .8rem; height: .8rem; flex: none; border: 1px solid currentColor; transition: background .25s;
}
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip input[type="checkbox"]:checked + span::before {
  background: var(--red); border-color: var(--red);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.chip input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.chip input:disabled + span { opacity: .4; }

/* Errors */
.bq__err { font-size: .82rem; font-weight: 600; color: var(--red); margin-top: .5rem; min-height: 0; }
.bq__err:empty { display: none; }
.bq.is-err .bq__label { color: var(--red); }
.bq.is-err input, .bq.is-err textarea { border-bottom-color: var(--red); }
.bq.is-err .chip span { border-color: var(--red); }

/* Send */
.brief-count { font-weight: 600; opacity: 1 !important; }
.brief-consent { display: flex; gap: .8rem; align-items: flex-start; font-size: .92rem; line-height: 1.5; cursor: pointer; grid-column: 1 / -1; max-width: 60ch; }
.brief-consent input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--red); flex: none; }
.brief-consent a { border-bottom: 1px solid currentColor; }
.brief-consent__err { grid-column: 1 / -1; margin-top: -1.4rem; }
.brief-submit { grid-column: 1 / -1; justify-self: start; margin: 0; background: var(--ink); color: var(--white); border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 1rem; padding: 1.1rem 1.6rem; }
.brief-submit:hover { background: var(--red); }
.brief-submit:disabled { opacity: .6; cursor: wait; }

/* After sending */
.brief-next { list-style: none; counter-reset: n; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.brief-next li { counter-increment: n; padding: 1.8rem 1.6rem 1.8rem 0; line-height: 1.5; }
.brief-next li + li { padding-left: 1.6rem; border-left: 1px solid var(--ink); }
.brief-next li::before { content: counter(n, decimal-leading-zero); display: block; font-family: var(--f-display); font-size: 3rem; line-height: 1; color: var(--red); margin-bottom: 1rem; }
.brief-next strong { display: block; font-size: 1.1rem; margin-bottom: .3rem; }
.brief-done__more { margin-top: 2.5rem; font-size: 1rem; }
.brief-done__more a { border-bottom: 1px solid currentColor; }

@media (max-width: 900px) {
  .brief-sec__grid { grid-template-columns: 1fr; }
  .brief-sec__head { position: static; }
  .brief-sec__num { font-size: 4.5rem; }
  .brief-sec__body { grid-template-columns: 1fr; }
  .bq--half { grid-column: 1 / -1; }
  .brief-next { grid-template-columns: 1fr; }
  .brief-next li, .brief-next li + li { padding: 1.5rem 0; border-left: 0; border-bottom: 1px solid var(--ink); }
  .page-brief main, .page-brief .brief { padding-bottom: 4rem; }  /* room for the mobile call/WhatsApp bar */
}

@media (prefers-reduced-motion: reduce) {
  .brief-progress__bar, .chip span { transition: none; }
}
