/* ============================================================
   Cap8 intake, app stylesheet
   Tokens copied from cap8-deck.css (design token source of truth).
   Do not link the deck file directly, it is a 16:9 slide stylesheet.
   ============================================================ */

:root {
  --bg: #0d1117;
  --card: #11161f;
  --card-2: #141b26;
  --ink: #f4f3ef;
  --muted: #8b97aa;
  --muted-2: #6c7686;
  --line: #26303f;
  --blue: #9cc0e4;
  --blue-bright: #78b4e4;
  --purple: #9054b4;
  --purple-bright: #a96fd0;
  --grad: linear-gradient(120deg, #78b4e4 0%, #9054b4 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: #05070b;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

a {
  color: var(--blue-bright);
}

button {
  font: inherit;
  color: inherit;
}

/* ---- focus visibility (accessibility, no color-only signaling) ---- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
}

/* ---- app shell ---- */
.app-root {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 720px) {
  .app-root {
    padding: 48px 32px 100px;
  }
}

.app-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wordmark {
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--muted);
  font-weight: 600;
  align-self: flex-start;
}
.wordmark::after {
  content: "";
  display: block;
  width: 52px;
  height: 1px;
  background: var(--line);
  margin-top: 9px;
}

.test-badge {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--purple-bright);
  border: 1px solid var(--purple);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ---- progress bar (branch-aware) ---- */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--card-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 3px;
  transition: width 0.25s ease;
}
.progress-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* ---- resume banner ---- */
.resume-banner {
  border: 1px solid var(--purple);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(120, 180, 228, 0.1), rgba(144, 84, 180, 0.16));
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resume-banner p {
  color: #cdd0dc;
  font-size: 14.5px;
}
.resume-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- screen layout ---- */
.screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.screen-title {
  font-size: 26px;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

@media (min-width: 720px) {
  .screen-title {
    font-size: 32px;
  }
}

.lead {
  font-style: italic;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

.body-copy {
  color: #c4ccd8;
  font-size: 15px;
  line-height: 1.62;
}

.summary-copy {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.screen-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sub-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.sub-title {
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--blue);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.guidance-note {
  border-left: 2px solid var(--purple);
  padding-left: 14px;
}

/* ---- radio card groups ---- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sr-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.radio-card {
  display: block;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-card:hover {
  border-color: var(--purple);
}

.sr-input:focus-visible + .card-body {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-input:checked + .card-body {
  color: var(--ink);
}

.sr-input:checked ~ .card-body .card-name::before {
  content: "✓ ";
  color: var(--blue-bright);
}

.radio-card:has(.sr-input:checked) {
  border-color: transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box;
  border-width: 2px;
  padding: 15px 17px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.card-desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.card-quant {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted-2);
  font-style: italic;
}

.badge-pill {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--purple-bright);
  border: 1px solid var(--purple);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* family cards, visual centerpiece: slightly larger */
input[name="product_family"] + .card-body .card-name {
  font-size: 18px;
}
label.radio-card:has(input[name="product_family"]) {
  padding: 20px 20px;
}

/* ---- fields ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.text-input,
.text-area,
select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
}

.text-input:focus-visible,
.text-area:focus-visible {
  border-color: var(--blue-bright);
}

.text-area {
  min-height: 110px;
  resize: vertical;
}

.number-input {
  max-width: 140px;
}

.error-text {
  font-size: 13px;
  color: #e08a8a;
}

.checkbox-field {
  flex-direction: row;
  align-items: flex-start;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink);
  min-height: 44px;
  cursor: pointer;
}

.checkbox-input {
  width: 20px;
  height: 20px;
  accent-color: var(--purple-bright);
  flex-shrink: 0;
}

/* ---- chip / token ticker input ---- */
.chip-field {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  font-size: 13.5px;
  color: var(--ink);
}

.chip-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
}
.chip-remove:hover {
  color: var(--ink);
  background: var(--line);
}

.chip-input-row {
  display: flex;
  gap: 10px;
}
.chip-input-row .text-input {
  flex: 1;
}

.suggestions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  min-height: 40px;
}
.suggestion-btn:hover {
  border-color: var(--purple);
  color: var(--ink);
}

.inline-note {
  font-size: 13px;
  color: var(--blue);
  min-height: 1em;
}

.inline-note:empty {
  display: none;
}

/* ---- preset buttons (open list seeding) ---- */
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-secondary {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover {
  border-color: var(--purple);
}
.btn-secondary.is-active {
  border-color: transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box, var(--grad) border-box;
  border-width: 2px;
}

/* ---- primary button ---- */
.btn-primary {
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: var(--grad);
  color: #0b0e14;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  cursor: pointer;
  width: 100%;
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-back {
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  padding: 8px 0;
}
.btn-back:hover {
  color: var(--ink);
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--blue-bright);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 0 6px;
}

@media (min-width: 480px) {
  .btn-primary {
    width: auto;
  }
}

.screen-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

@media (min-width: 480px) {
  .screen-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .screen-nav .btn-primary {
    order: 2;
    margin-left: auto;
  }
}

/* ---- inline confirm (family switch reset) ---- */
.inline-confirm {
  border: 1px solid var(--purple);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(120, 180, 228, 0.08), rgba(144, 84, 180, 0.14));
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.inline-confirm p {
  font-size: 14px;
  color: #dfe5ee;
  line-height: 1.5;
}
.inline-confirm-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-subquestion {
  border-top: none;
  border-left: 2px solid var(--purple);
  padding-left: 16px;
}

/* ---- sleeve assignment rows ---- */
.assign-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  flex-wrap: wrap;
}
.assign-ticker {
  font-weight: 600;
  min-width: 64px;
}
.assign-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
}
.assign-choice input {
  accent-color: var(--purple-bright);
  width: 18px;
  height: 18px;
}

/* ---- review screen ---- */
.review-sections {
  display: flex;
  flex-direction: column;
}

.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.review-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.review-value {
  font-size: 14.5px;
  color: var(--ink);
}

.raw-json {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 14px 16px;
}
.raw-json summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.raw-json pre {
  margin-top: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  color: #c4ccd8;
  max-height: 420px;
  overflow: auto;
}

.review-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 480px) {
  .review-actions {
    flex-direction: row;
  }
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  background: var(--card-2);
  padding: 2px 6px;
  border-radius: 4px;
}
