/* ════════════════════════════════════════════════════════════
   BRIEF GENERATOR, Styles
   Extends studio-elroy.css, do not duplicate base tokens here
   ════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────
   PROGRESS INDICATOR
   Sticky bar below the fixed nav (72px desktop, 64px mobile)
   ──────────────────────────────────────────────────────────── */

.brief-progress {
  position: sticky;
  top: 72px;
  z-index: 90;
  background: var(--white);
  border-bottom: 1px solid var(--light-grey);
  padding: 0;
}

.brief-progress-inner {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0 10px;
}

.brief-progress-counter {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid-grey);
  white-space: nowrap;
  flex-shrink: 0;
}

.brief-progress-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brief-progress-track {
  height: 1px;
  background: var(--light-grey);
  position: relative;
  overflow: hidden;
}

.brief-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--black);
  transition: width 0.4s ease;
}

/* ────────────────────────────────────────────────────────────
   FORM SECTIONS
   ──────────────────────────────────────────────────────────── */

.brief-section {
  padding: 80px 0 48px;
  border-top: 1px solid var(--light-grey);
}

.brief-section:first-of-type {
  border-top: none;
}

.section-header {
  margin-bottom: 48px;
}

.section-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--black);
  margin: 0;
}

/* ────────────────────────────────────────────────────────────
   QUESTIONS
   ──────────────────────────────────────────────────────────── */

.form-question {
  margin-bottom: 48px;
}

.form-question:last-of-type {
  margin-bottom: 0;
}

.question-label {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--black);
  margin-bottom: 8px;
}

.question-micro {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--dark-grey);
  margin-bottom: 20px;
}

.required-mark {
  color: var(--red);
  font-weight: 500;
  margin-left: 2px;
}

.question-optional {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-left: 8px;
  vertical-align: middle;
}

/* ────────────────────────────────────────────────────────────
   CUSTOM RADIO / CHECKBOX OPTION ROWS
   ──────────────────────────────────────────────────────────── */

.option-group {
  border-top: 1px solid var(--light-grey);
  margin-top: 4px;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--light-grey);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}

.option-row:hover {
  background: var(--light-grey);
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
}

/* Hide native inputs */
.option-row input[type="radio"],
.option-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom indicator, square for checkbox, circle-ish for radio */
.option-indicator {
  width: 16px;
  height: 16px;
  border: 1px solid var(--mid-grey);
  flex-shrink: 0;
  margin-top: 3px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.option-group:not(.checkbox-group) .option-indicator {
  border-radius: 50%;
}

.option-row.selected .option-indicator {
  background: var(--black);
  border-color: var(--black);
}

/* Checkmark for selected state */
.option-row.selected .option-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: var(--white);
  border-radius: 50%;
}

/* For radio, inner dot */
.option-group:not(.checkbox-group) .option-row.selected .option-indicator::after {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
}

/* For checkbox, checkmark tick */
.checkbox-group .option-row.selected .option-indicator::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 1.5px solid var(--white);
  border-bottom: 1.5px solid var(--white);
  transform: translate(-50%, -60%) rotate(-45deg);
  background: none;
  border-radius: 0;
}

.option-text {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--black);
  flex: 1;
}

/* Solo option row (outside .option-group, for "I don't know" companions) */
.option-row-solo {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0 4px;
  cursor: pointer;
  border-bottom: none;
}

.option-row-solo input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.option-row-solo:hover {
  background: none;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

.option-row-solo .option-indicator {
  width: 16px;
  height: 16px;
  border: 1px solid var(--mid-grey);
  flex-shrink: 0;
  margin-top: 3px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.option-row-solo.selected .option-indicator {
  background: var(--black);
  border-color: var(--black);
}

.option-row-solo.selected .option-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 5px;
  border-left: 1.5px solid var(--white);
  border-bottom: 1.5px solid var(--white);
  transform: translate(-50%, -60%) rotate(-45deg);
  background: none;
  border-radius: 0;
}

.option-row-solo .option-text {
  font-size: 14px;
  font-weight: 300;
  color: var(--dark-grey);
  line-height: 1.5;
}

/* "Other" text input that appears after its option row */
.other-input {
  display: none;
  width: 100%;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 300;
  padding: 12px 16px;
  border: 1px solid var(--mid-grey);
  border-top: none;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 0;
}

.other-input:focus {
  border-color: var(--black);
}

/* ────────────────────────────────────────────────────────────
   FLAG CALLOUTS
   Red-left-border callout for legal/safety notices
   ──────────────────────────────────────────────────────────── */

.flag-callout {
  border-left: 3px solid var(--red);
  background: var(--light-grey);
  padding: 16px 20px;
  margin: 16px 0 8px;
}

.flag-callout p {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--black);
  margin-bottom: 0;
}

.flag-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--black);
  margin-bottom: 6px !important;
}

/* ────────────────────────────────────────────────────────────
   DISCLAIMER BOX
   Used for budget (Q12) and permit (Q25) notices
   ──────────────────────────────────────────────────────────── */

.disclaimer-box {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--dark-grey);
  border: 1px solid var(--light-grey);
  background: var(--light-grey);
  padding: 14px 18px;
  margin-bottom: 20px;
}

/* Specific budget input (Q12) */
.specific-budget-input {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 4px 36px;
}

.budget-prefix {
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
  line-height: 1;
}

.specific-budget-input input {
  width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--mid-grey);
  background: var(--white);
  font-size: 15px;
  font-family: inherit;
  color: var(--black);
  outline: none;
  border-radius: 0;
}

.specific-budget-input input:focus {
  border-color: var(--black);
}

/* ────────────────────────────────────────────────────────────
   TEXTAREA
   ──────────────────────────────────────────────────────────── */

.brief-textarea {
  display: block;
  width: 100%;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  padding: 14px 16px;
  border: 1px solid var(--mid-grey);
  background: var(--white);
  color: var(--black);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s, opacity 0.15s;
  -webkit-text-fill-color: var(--black);
  color-scheme: light;
}

.brief-textarea:focus {
  border-color: var(--black);
}

.brief-textarea:disabled {
  cursor: not-allowed;
}

/* ────────────────────────────────────────────────────────────
   TEXT INPUT (Q14 feeling words)
   ──────────────────────────────────────────────────────────── */

.brief-input {
  display: block;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 300;
  padding: 14px 16px;
  border: 1px solid var(--mid-grey);
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s, opacity 0.15s;
  -webkit-text-fill-color: var(--black);
  color-scheme: light;
  width: 100%;
}

.brief-input:focus {
  border-color: var(--black);
}

.brief-input:disabled {
  cursor: not-allowed;
}

.feeling-words-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

/* ────────────────────────────────────────────────────────────
   FIELD ERROR (reuses .field-error from studio-elroy.css)
   ──────────────────────────────────────────────────────────── */

/* .field-error and .field-error.visible already defined in studio-elroy.css */
/* Just ensure spacing works in this context */

.form-question .field-error {
  margin-top: 10px;
}

/* ────────────────────────────────────────────────────────────
   FORM SUBMIT AREA
   ──────────────────────────────────────────────────────────── */

.form-submit-area {
  padding-top: 64px;
  border-top: 1px solid var(--light-grey);
  margin-top: 64px;
}

.form-submit-note {
  font-size: 13px;
  color: var(--dark-grey);
  margin-bottom: 24px;
}

.form-submit-btn {
  min-width: 220px;
}

.form-submit-sub {
  font-size: 12px;
  color: var(--mid-grey);
  margin-top: 16px;
}

/* ────────────────────────────────────────────────────────────
   TERMS OF SERVICE GATE
   ──────────────────────────────────────────────────────────── */

.tos-box {
  border: 1px solid var(--light-grey);
}

.tos-scroll {
  max-height: 480px;
  overflow-y: auto;
  padding: 40px 40px 32px;
  border-bottom: 1px solid var(--light-grey);
  scroll-behavior: smooth;
}

.tos-scroll p {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--black);
  margin-bottom: 16px;
}

.tos-update {
  font-size: 12px;
  color: var(--mid-grey);
  margin-bottom: 24px;
}

.tos-heading {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--black);
  margin: 28px 0 10px;
}

.tos-list {
  padding-left: 20px;
  margin-bottom: 16px;
}

.tos-list li {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--black);
  margin-bottom: 4px;
}

.tos-contact {
  font-size: 13px;
  color: var(--dark-grey);
  padding-top: 24px;
  border-top: 1px solid var(--light-grey);
  margin-top: 24px;
}

.tos-gate {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.tos-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.tos-checkbox-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tos-check-indicator {
  width: 18px;
  height: 18px;
  border: 1px solid var(--mid-grey);
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.tos-checkbox-row input:checked + .tos-check-indicator {
  background: var(--black);
  border-color: var(--black);
}

.tos-checkbox-row input:checked + .tos-check-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 5px;
  border-left: 1.5px solid var(--white);
  border-bottom: 1.5px solid var(--white);
  transform: translate(-50%, -60%) rotate(-45deg);
}

.tos-check-label {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--black);
  flex: 1;
}

/* ────────────────────────────────────────────────────────────
   PRE-SUBMISSION ACKNOWLEDGMENT
   ──────────────────────────────────────────────────────────── */

.acknowledge-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--light-grey);
}

.acknowledge-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--light-grey);
  cursor: pointer;
}

.acknowledge-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.acknowledge-indicator {
  width: 18px;
  height: 18px;
  border: 1px solid var(--mid-grey);
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.acknowledge-item input:checked + .acknowledge-indicator {
  background: var(--black);
  border-color: var(--black);
}

.acknowledge-item input:checked + .acknowledge-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 5px;
  border-left: 1.5px solid var(--white);
  border-bottom: 1.5px solid var(--white);
  transform: translate(-50%, -60%) rotate(-45deg);
}

.acknowledge-text {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--black);
  flex: 1;
}

.acknowledge-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 48px;
  flex-wrap: wrap;
}

/* ────────────────────────────────────────────────────────────
   LOADING SPINNER
   ──────────────────────────────────────────────────────────── */

.brief-spinner {
  width: 32px;
  height: 32px;
  border: 1px solid var(--light-grey);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ────────────────────────────────────────────────────────────
   PROCESSING SCREEN
   ──────────────────────────────────────────────────────────── */

.processing-screen {
  text-align: center;
}

.processing-error {
  color: var(--red);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.65;
  margin-top: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ────────────────────────────────────────────────────────────
   COMPLETE SCREEN, DOWNLOAD PAIR
   ──────────────────────────────────────────────────────────── */

.download-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.download-item {
  border: 1px solid var(--light-grey);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}

.download-eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid-grey);
  margin-bottom: 8px;
}

.download-name {
  font-size: 20px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 8px;
  line-height: 1.3;
}

.download-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--dark-grey);
  margin-bottom: 32px;
  flex-grow: 1;
}

/* ────────────────────────────────────────────────────────────
   RESPONSIVE
   ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .brief-progress {
    top: 64px;
  }

  .brief-section {
    padding: 56px 0 32px;
  }

  .tos-scroll {
    max-height: 360px;
    padding: 28px 24px;
  }

  .tos-gate {
    padding: 24px;
  }

  .feeling-words-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .download-pair {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .download-item {
    padding: 28px 24px;
  }

  .option-row:hover {
    background: none;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 600px) {
  .brief-progress-name {
    display: none;
  }

  .form-submit-btn {
    width: 100%;
  }

  .acknowledge-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .acknowledge-actions .btn,
  .acknowledge-actions .btn-outline {
    text-align: center;
    width: 100%;
  }
}
