/* KARAKTER design system: the lead funnel (includes/lead-funnel.html), on the
   home page and in the client portal's profile setup. Tokens only; held to 7:1
   in both themes by scripts/test-funnel-contrast-unit.js. */

.funnel {
  padding: var(--ds-space-9) 0;
  background: var(--ds-bg);
  color: var(--ds-fg);
  border-top: 1px solid var(--ds-border);
}

.funnel .container {
  max-width: calc(var(--ds-max) + 2 * var(--ds-gutter));
  margin: 0 auto;
  padding: 0 var(--ds-gutter);
}

.funnel-wrap {
  max-width: 800px;
  margin: 0 auto;
}

.funnel-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-7);
  text-align: center;
}

.funnel .tag {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ds-accent-fg);
}

.funnel .section-h2 {
  text-wrap: balance;
  font-family: var(--ds-font-display);
  font-size: 80px;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ds-fg);
}

.funnel .section-h2 em {
  display: block;
  margin-bottom: 0.14em;
  font-family: var(--ds-font-serif);
  font-style: italic;
  line-height: 1.22;
  letter-spacing: 0;
  text-transform: none;
}

.funnel .section-h2 strong {
  font-weight: 400;
}

.funnel .body-text {
  max-width: 34em;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ds-fg-muted);
}

.quiz-container {
  position: relative;
  padding: var(--ds-space-7);
  background: var(--ds-surface);
  color: var(--ds-fg);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
}

.quiz-progress {
  display: flex;
  gap: var(--ds-space-2);
  margin-bottom: var(--ds-space-7);
}

.quiz-prog-bar {
  flex: 1;
  height: 2px;
  background: var(--ds-border);
  transition: background-color var(--ds-base) var(--ds-ease);
}

.quiz-prog-bar.active {
  background: var(--ds-accent);
}

.quiz-step {
  display: none;
}

.quiz-step.active {
  display: block;
}

.quiz-q {
  margin-bottom: var(--ds-space-5);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ds-fg);
}

.quiz-hint {
  margin: calc(-1 * var(--ds-space-3)) 0 var(--ds-space-5);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ds-fg-muted);
}

.quiz-options,
.prop-type-options,
.sell-gate-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-6);
}

.quiz-options-goal .quiz-opt:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.quiz-opt,
.prop-type-opt,
.sell-gate-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ds-space-1);
  min-height: var(--ds-target);
  padding: var(--ds-space-4);
  border: 1px solid var(--ds-control-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  color: var(--ds-fg);
  font-family: var(--ds-font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--ds-fast) var(--ds-ease), background-color var(--ds-fast) var(--ds-ease);
}

.prop-type-opt,
.sell-gate-opt {
  align-items: center;
  text-align: center;
}

.quiz-opt:hover,
.prop-type-opt:hover,
.sell-gate-opt:hover {
  border-color: var(--ds-border-strong);
}

.quiz-opt.selected,
.prop-type-opt.selected,
.sell-gate-opt.selected,
.area-opt.selected {
  position: relative;
  border-color: var(--ds-border-strong);
  background: var(--ds-accent-subtle);
  box-shadow: inset 0 0 0 1px var(--ds-border-strong);
}

.quiz-opt.selected::after,
.prop-type-opt.selected::after,
.sell-gate-opt.selected::after {
  content: '\2713';
  position: absolute;
  top: var(--ds-space-3);
  right: var(--ds-space-3);
  font-size: 15px;
  font-weight: 700;
  color: var(--ds-fg);
}

.quiz-opt-icon,
.sell-gate-icon {
  display: inline-flex;
  margin-bottom: var(--ds-space-2);
  color: var(--ds-accent-fg);
}

.quiz-opt-label,
.prop-type-label,
.sell-gate-label {
  display: block;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ds-fg);
}

.quiz-opt-sub,
.prop-type-sub,
.sell-gate-sub {
  display: block;
  max-width: none;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ds-fg-muted);
}

.prop-type-svg {
  display: block;
  width: 100px;
  height: 72px;
  color: var(--ds-fg);
}

.prop-type-svg .pt-accent {
  stroke: var(--ds-accent-fg);
}

.prop-type-svg .pt-accent-fill {
  fill: var(--ds-accent-fg);
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-4);
}

.quiz-nav--spaced {
  margin-top: var(--ds-space-6);
}

.quiz-back {
  display: inline-flex;
  align-items: center;
  min-height: var(--ds-target);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ds-fg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.quiz-back:hover {
  color: var(--ds-accent-fg);
}

/* The funnel's own primary button, restated as the design-system primary. */
.funnel .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  min-height: var(--ds-target);
  padding: 0 var(--ds-space-5);
  border: 1px solid var(--ds-inverse);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-inverse);
  color: var(--ds-on-inverse);
  font-family: var(--ds-font-sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--ds-fast) var(--ds-ease);
}

.funnel .btn-primary:hover {
  background: var(--ds-inverse-hover);
  border-color: var(--ds-inverse-hover);
}

.quiz-error {
  margin: 0 0 var(--ds-space-4);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
  color: var(--ds-danger);
}

/* Fields */
.quiz-form,
.sell-detail-grid {
  display: grid;
  gap: var(--ds-space-4);
  margin-bottom: var(--ds-space-6);
}

.sell-detail-grid {
  grid-template-columns: 1fr 1fr;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-2);
}

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

.form-label,
.opt-section-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ds-fg);
}

.form-label-note {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ds-fg-muted);
}

.form-input,
.form-select {
  width: 100%;
  min-height: var(--ds-target);
  padding: 0 var(--ds-space-4);
  border: 1px solid var(--ds-control-border);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-surface);
  color: var(--ds-fg);
  font-family: var(--ds-font-sans);
  font-size: 17px;
  outline: 0;
  appearance: none;
  transition: border-color var(--ds-fast) var(--ds-ease), box-shadow var(--ds-fast) var(--ds-ease);
}

.form-select {
  padding-right: var(--ds-space-7);
  background-image: var(--ds-chevron);
  background-position: calc(100% - var(--ds-space-4)) 50%;
  background-size: 12px 8px;
  background-repeat: no-repeat;
}

.form-textarea {
  min-height: 112px;
  padding: var(--ds-space-3) var(--ds-space-4);
  line-height: 1.6;
  resize: vertical;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--ds-focus);
  box-shadow: inset 0 0 0 1px var(--ds-focus);
}

.form-input::placeholder {
  color: var(--ds-fg-muted);
  opacity: 1;
}

.form-consent {
  display: flex;
  gap: var(--ds-space-3);
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ds-fg-muted);
}

.form-consent input,
.check-opt input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ds-inverse);
}

/* Banners */
.sell-banner,
.optional-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--ds-space-3);
  margin-bottom: var(--ds-space-6);
  padding: var(--ds-space-4) var(--ds-space-5);
  border-left: 2px solid var(--ds-accent);
  border-radius: var(--ds-radius-sm);
  background: var(--ds-accent-subtle);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ds-fg);
}

.sell-banner strong,
.optional-banner strong {
  display: block;
  margin-bottom: 2px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ds-fg);
}

.sell-banner-icon,
.optional-icon {
  display: inline-flex;
  color: var(--ds-accent-fg);
}

/* Optional preferences */
.optional-section {
  margin-bottom: var(--ds-space-6);
}

.opt-section-label {
  margin-bottom: var(--ds-space-3);
}

.opt-hint {
  margin: 0 0 var(--ds-space-3);
  font-size: 15px;
  color: var(--ds-fg-muted);
}

.comm-section {
  margin-bottom: var(--ds-space-3);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
}

.comm-sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-space-3);
  min-height: var(--ds-target);
  padding: 0 var(--ds-space-4);
  background: var(--ds-surface-alt);
  border-bottom: 1px solid var(--ds-border);
  color: var(--ds-fg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}

.comm-sec-name {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
}

.comm-sec-name .ds-icon {
  width: 20px;
  height: 20px;
  color: var(--ds-accent-fg);
}

.comm-sel-all {
  padding: var(--ds-space-1) var(--ds-space-3);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius-sm);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-fg);
  pointer-events: none;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ds-space-2);
}

.comm-section .checkbox-grid {
  padding: var(--ds-space-3);
}

.check-opt {
  display: flex;
  align-items: center;
  gap: var(--ds-space-2);
  min-height: var(--ds-target);
  padding: 0 var(--ds-space-3);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-sm);
  color: var(--ds-fg);
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color var(--ds-fast) var(--ds-ease), background-color var(--ds-fast) var(--ds-ease);
}

.check-opt:hover {
  border-color: var(--ds-border-strong);
}

.check-opt:has(input:checked) {
  border-color: var(--ds-border-strong);
  background: var(--ds-accent-subtle);
}

/* Thank-you */
.quiz-thankyou {
  display: none;
  padding: var(--ds-space-6) 0;
  text-align: center;
}

.quiz-thankyou.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ds-space-4);
}

.thankyou-icon {
  display: inline-flex;
  color: var(--ds-accent-fg);
}

.thankyou-h {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ds-fg);
}

.thankyou-sub {
  max-width: 34em;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ds-fg-muted);
}

.thankyou-sub--fine {
  font-size: 15px;
}

.thankyou-sending {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ds-accent-fg);
}

.funnel .divider {
  width: 48px;
  height: 2px;
  margin: var(--ds-space-3) auto;
  background: var(--ds-accent);
}

/* ── RESPONSIVE ── */
@media (max-width: 899px) {
  .funnel {
    padding: var(--ds-space-8) 0;
  }

  .funnel .section-h2 {
    font-size: 52px;
  }

  .quiz-container {
    padding: var(--ds-space-6) var(--ds-space-5);
  }

  .checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .quiz-options,
  .prop-type-options,
  .sell-gate-opts,
  .sell-detail-grid,
  .form-row,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .funnel .container {
    padding: 0 var(--ds-space-4);
  }

  .quiz-container {
    padding: var(--ds-space-5) var(--ds-space-4);
  }

  .quiz-q {
    font-size: 24px;
  }
}
