/* =========================================================
   Questionário de briefing
   ========================================================= */

.page-questionario {
  overflow-x: clip;
}

.page-questionario .site-header {
  background: rgba(10, 7, 18, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.page-questionario .header-inner,
.page-questionario .footer-inner,
.page-questionario .q-hero .container {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.q-hero {
  padding: calc(var(--header-h) + 2.75rem) 0 2rem;
}

.q-hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  max-width: 16ch;
  margin-bottom: 0.85rem;
}

.q-hero-lead {
  max-width: 52ch;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.q-progress-wrap {
  max-width: 36rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(20, 15, 31, 0.72);
}

.q-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
}

.q-progress-meta span {
  color: var(--muted);
}

.q-progress-meta strong {
  color: var(--accent-strong);
}

.q-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.q-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--btn), var(--accent));
  transition: width 0.35s var(--ease);
}

.q-save-note {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.q-form {
  padding-bottom: 4rem;
  display: grid;
  gap: 1.25rem;
}

.q-section {
  padding: 1.5rem 1.25rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 180px at 100% 0%, rgba(76, 29, 149, 0.16), transparent 60%),
    var(--bg-elevated);
}

.q-section-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.35rem;
}

.q-section-head h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  margin-bottom: 0.25rem;
}

.q-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.q-step {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.8rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-strong);
  background: rgba(59, 7, 100, 0.45);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.q-grid {
  display: grid;
  gap: 1rem;
}

.q-stack {
  display: grid;
  gap: 1rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field-spaced {
  margin-top: 1.15rem;
}

.q-form input:focus,
.q-form textarea:focus {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.q-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
}

.q-form,
.q-section,
.q-submit-card,
.q-stack,
.q-grid,
.q-choice-list,
.q-chips {
  max-width: 100%;
  min-width: 0;
}

.q-form input,
.q-form textarea {
  max-width: 100%;
}

.q-fieldset legend {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(240, 235, 248, 0.88);
}

.q-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.q-chip {
  position: relative;
  cursor: pointer;
  max-width: 100%;
}

.q-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.q-chip span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease),
    box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.q-chip:hover span {
  border-color: rgba(196, 181, 253, 0.4);
  background: rgba(76, 29, 149, 0.22);
}

.q-chip input:focus-visible + span {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.q-chip input:checked + span {
  background: var(--btn);
  border-color: rgba(196, 181, 253, 0.4);
  color: var(--btn-text);
  box-shadow: 0 8px 20px rgba(59, 7, 100, 0.35);
}

/* Listas de escolha (substitui select nativo) */
.q-choice-list {
  display: grid;
  gap: 0.55rem;
}

.q-choice-list--stack {
  grid-template-columns: 1fr;
  max-width: 28rem;
}

.q-choice {
  position: relative;
  cursor: pointer;
  display: block;
  max-width: 100%;
  min-width: 0;
}

.q-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.q-choice span {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: 0.8rem 1rem 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(196, 181, 253, 0.16);
  background: linear-gradient(135deg, rgba(36, 18, 64, 0.55), rgba(14, 8, 28, 0.72));
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.q-choice span::before {
  content: "";
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid rgba(196, 181, 253, 0.45);
  background: transparent;
  box-shadow: inset 0 0 0 0 var(--accent-strong);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

.q-choice:hover span {
  border-color: rgba(196, 181, 253, 0.4);
  background: linear-gradient(135deg, rgba(59, 7, 100, 0.45), rgba(20, 15, 31, 0.85));
  transform: translateY(-1px);
}

.q-choice input:focus-visible + span {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.q-choice input:checked + span {
  border-color: rgba(196, 181, 253, 0.55);
  background: linear-gradient(135deg, rgba(76, 29, 149, 0.72), rgba(59, 7, 100, 0.55));
  box-shadow: 0 10px 28px rgba(59, 7, 100, 0.35);
  color: #fff;
}

.q-choice input:checked + span::before {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  box-shadow: inset 0 0 0 3px rgba(10, 7, 18, 0.85);
}

.q-colors {
  display: grid;
  gap: 1rem;
  margin-top: 1.15rem;
}

.q-color-field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.q-color-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0.65rem;
  align-items: center;
}

.q-color-row input[type="color"] {
  width: 56px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.q-color-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.q-color-row input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.q-color-row input[type="color"]:not(.is-set) {
  opacity: 0.55;
}

.q-color-row input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.q-color-row input[type="text"]::placeholder {
  color: rgba(155, 147, 168, 0.75);
  text-transform: none;
  letter-spacing: 0.02em;
}

.q-submit {
  padding: 0.5rem 0 1rem;
}

.q-submit-card {
  padding: 1.75rem 1.35rem;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(124, 58, 237, 0.22), transparent 55%),
    var(--bg-elevated);
  box-shadow: var(--shadow);
}

.q-submit-card h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.q-submit-card > p {
  color: var(--muted);
  max-width: 48ch;
}

.q-submit-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.4rem;
  max-width: 28rem;
}

.q-submit-actions .q-btn-main,
.q-submit-actions .q-btn-secondary {
  width: 100%;
  justify-content: center;
}

.q-submit-actions .q-btn-secondary {
  border: 1px solid var(--line);
}

.q-btn-clear {
  justify-self: start;
  margin-top: 0.25rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.q-btn-clear:hover,
.q-btn-clear:focus-visible {
  color: var(--accent-strong);
}

@media (min-width: 720px) {
  .q-section {
    padding: 1.85rem 1.7rem;
  }

  .q-grid {
    grid-template-columns: 1fr 1fr;
  }

  .q-colors {
    grid-template-columns: 1fr 1fr;
  }

  .q-choice-list {
    grid-template-columns: 1fr 1fr;
  }

  .q-choice-list--stack {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .q-hero {
    padding-top: calc(var(--header-h) + 3.5rem);
  }

  .q-form {
    gap: 1.5rem;
  }
}
