/* Hallmark · page: /comecar/ "Começar um projeto" · macrostructure: page head card over a stepped form with a running summary (the conversation window's "Ficha do projeto" as the model) · design-system: design.md + paginas/interior.css
 * Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V4 · contrast: ink on crema 17.4:1, muted on crema-2 5.7:1, accent errors 6:1 · states: default, hover, focus-visible, active, disabled, busy, error, done
 * Only what is this page's own: the progress track, the question, the review, the summary and the done state. The
 * fields, choice pills, notices, panel and rows come from interior.css. */

.pg--comecar .pg-body { padding-top: clamp(var(--space-lg), 2.6vw, 40px); }
.brief-alt { display: inline-flex; align-items: center; min-height: 24px; color: var(--color-on-night); font-weight: var(--wght-ui); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
@media (pointer: coarse) { .brief-alt { display: inline-flex; align-items: center; min-height: 44px; } }

/* Progress: "Etapa 1 de 5 · O projeto" over five segments; done and current segments in ink */
.brief-progress { margin-bottom: clamp(var(--space-md), 2.4vw, 36px); }
.brief-step-label { color: var(--color-ink-2); font-size: var(--text-sm); font-weight: var(--wght-ui); line-height: 1.4; }
.brief-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-3xs); margin: var(--space-xs) 0 0; padding: 0; list-style: none; }
.brief-track li { position: relative; min-width: 0; padding-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.3; }
.brief-track li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--radius-pill); background: var(--color-rule); transform-origin: left center; }
.brief-track li::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: var(--radius-pill); background: var(--color-ink); transform: scaleX(0); transform-origin: left center; transition: transform 520ms var(--ease-out); }
.brief-track li.is-complete::after, .brief-track li[aria-current="step"]::after { transform: scaleX(1); }
.brief-track li.is-complete { color: var(--color-ink-2); }
.brief-track li[aria-current="step"] { color: var(--color-ink); font-weight: var(--wght-ui); }
.brief-track-num { font-variant-numeric: tabular-nums; margin-right: 6px; }
/* The names are read out (the label above says the current one); on screen the five segments are enough */
.brief-track { margin-top: var(--space-2xs); }
.brief-track li { padding-top: 0; height: 3px; font-size: 0; }
.brief-track li > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Reserve the enhanced form's natural layout before its deferred script runs, without exposing unfinished UI. */
@media (scripting: enabled) {
  body:not(.brief-enhanced) .brief-progress[hidden] { display: block !important; visibility: hidden; }
}
@media (scripting: enabled) and (min-width: 64rem) {
  body:not(.brief-enhanced) .brief-summary-answers[hidden] { display: block !important; visibility: hidden; }
}

/* One question at a time */
.brief-q {
  margin-bottom: var(--space-sm);
  overflow-wrap: anywhere;
  font-size: clamp(1.75rem, 1.15rem + 1.6vw, 3rem);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: -0.025em;
  line-height: 1.02;
  text-wrap: balance;
}
.brief-q:focus { outline: none; }
.brief-step > .fld + .fld-row, .brief-step > .fld-row + .fld { margin-top: var(--space-lg); }
.brief-choices { gap: var(--space-xs) var(--space-2xs); }
@media (max-width: 39.99rem) { .brief-choices .choice { flex: 1 1 100%; } }
.brief-privacy { margin-top: var(--space-lg); max-width: 60ch; }
.brief-privacy a { color: inherit; }
/* Without the script every step shows, one under the other; with it one at a time, arriving with a short rise */
.brief-step + .brief-step { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px solid var(--color-rule); }
.brief-enhanced .brief-step + .brief-step { margin-top: 0; padding-top: 0; border-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  .brief-enhanced .brief-step:not([hidden]) { animation: brief-in 520ms var(--ease-out) both; }
}
@keyframes brief-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } }

/* The service picked on another page, and the errors */
.brief-service { margin-bottom: var(--space-lg); }
.brief-service > p:first-child { font-weight: var(--wght-ui); }
.brief-error-summary { margin-bottom: var(--space-lg); }
.brief-error-summary > p { color: var(--color-accent); font-weight: var(--wght-ui); }

/* Status line while sending, and when the server refuses */
.brief-status { margin-top: var(--space-lg); }
#brief-form[data-state="error"] .brief-status { border-color: var(--color-accent); background: var(--color-paper); color: var(--color-ink); }
#brief-form[data-state="sending"] .brief-status { border-color: var(--color-rule-strong); }
.brief-form-busy .brief-actions .btn { cursor: progress; }
.brief-form-busy .brief-actions .btn--go { opacity: 0.72; }

/* Voltar and Continuar on one line; on phones Continuar takes the rest of the row */
.brief-actions { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.brief-actions .btn--go { min-width: 12rem; }
@media (max-width: 39.99rem) {
  .brief-actions { gap: var(--space-xs); }
  .brief-actions .btn--go { min-width: 0; }
  .brief-actions .brief-back { padding: 0 var(--space-md); }
}

/* Review: one ruled group per step, "Editar" on the right */
.brief-review-group { padding-block: var(--space-md); border-top: 1px solid var(--color-rule); }
.brief-review-group:first-of-type { border-top: 2px solid var(--color-ink); }
.brief-review-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.brief-review-heading h3 { font-size: var(--text-title); font-weight: var(--wght-ui); letter-spacing: var(--track-title); line-height: 1.2; }
.brief-review-group p { margin-top: var(--space-2xs); max-width: 60ch; color: var(--color-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.brief-review-group dl { margin: var(--space-2xs) 0 0; }
.brief-review-group dl > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding-block: var(--space-2xs); }
.brief-review-group dt { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); }
.brief-review-group dd { margin: 0; font-weight: var(--wght-ui); overflow-wrap: anywhere; }
@media (min-width: 40rem) {
  .brief-review-group dl > div { grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-md); align-items: baseline; }
}

/* Done */
.brief-done { padding-block: var(--space-md) var(--space-xl); }
.brief-done-title {
  font-size: var(--text-display-l);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: var(--track-display);
  line-height: 1;
}
.brief-done-title:focus { outline: none; }
.brief-done-text { margin-top: var(--space-md); max-width: 45ch; color: var(--color-ink-2); font-size: var(--text-lead); line-height: 1.5; }
.brief-done-links { margin-top: var(--space-lg); }

/* The running summary, written in as the answers come (the "Ficha do projeto" of the conversation window) */
.brief-summary .rows dd { font-size: 1rem; }
.brief-summary-answers + .panel-part { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.brief-promise-title { font-size: 1.375rem; font-weight: var(--wght-display); font-stretch: var(--wdth-display); letter-spacing: -0.02em; line-height: 1.1; }
.brief-promise p, .brief-other p { margin-top: var(--space-2xs); color: var(--color-ink-2); font-size: 1rem; line-height: 1.5; }
.brief-other p { margin-top: 0; }
@media (max-width: 63.99rem) {
  /* Phones and tablets: the review shows the whole request; the aside keeps only the promise and the other way in */
  .brief-summary-answers { display: none; }
  .brief-summary-answers + .panel-part { margin-top: 0; padding-top: 0; border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .brief-track li::after { transition: none; }
}
