/* ============================================================
   Arigato Studio — Logo Questionnaire
   Component layer on top of tokens.css
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg1);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: var(--font-sans); }
:focus-visible { outline: none; }

/* ---- accent intensity hook (set on <body data-accent>) ---- */
.accent-bar { background: var(--coral); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar -------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(250,250,249,0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.brand svg { display: block; }
.brand-mark-img {
  display: block;
  flex: none;
  object-fit: contain;
}
.brand-name {
  font-family: var(--font-logo);
  letter-spacing: 0.17em;
  font-size: 13px;
  color: var(--navy-900);
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.topbar-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* link styled as a quiet pill nav action */
.ghost-link {
  font-size: 13px;
  font-weight: var(--fw-medium);
  color: var(--fg2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--paper);
  white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ghost-link:hover { color: var(--navy-900); border-color: var(--border-strong); }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .topbar-right { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
  .topbar-meta { flex-basis: 100%; text-align: right; }
  .ghost-link { padding: 7px 10px; font-size: 12.5px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--shadow-focus); }
.btn svg { display: block; }

.btn-primary { background: var(--navy-900); color: #fff; }
.btn-primary:hover { background: var(--navy-800); }

.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--coral-600); }

.btn-outline { background: var(--paper); color: var(--navy-900); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--navy-900); }

.btn-ghost { background: transparent; color: var(--fg2); }
.btn-ghost:hover { color: var(--navy-900); background: var(--navy-100); }

.btn:disabled { background: var(--navy-100); color: var(--navy-400); cursor: not-allowed; border-color: transparent; }
.btn:disabled:active { transform: none; }

.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ============================================================
   Form layout
   ============================================================ */
.form-stage {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 24px) 120px;
}

/* progress / step indicator -------------------------------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-6);
}
.stepper-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.stepper-item:last-child { flex: 0; }
.step-dot {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  border: 1.5px solid var(--border-strong);
  background: var(--paper);
  color: var(--fg3);
  transition: all var(--dur-base) var(--ease-out);
}
.step-dot.is-done { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.step-dot.is-active { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: 0 0 0 4px var(--coral-50); }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.step-line .fill {
  position: absolute;
  inset: 0;
  background: var(--navy-900);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out);
}

.progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.progress-meta .label { font-family: var(--font-mono); font-size: 12px; color: var(--fg3); letter-spacing: 0.04em; }
.progress-track { height: 4px; background: var(--sunken); border-radius: var(--radius-pill); overflow: hidden; }
.progress-track .bar { height: 100%; background: var(--coral); border-radius: var(--radius-pill); transition: width var(--dur-slow) var(--ease-out); }

/* card / block --------------------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow-sm);
}
.step-head { margin-bottom: var(--space-6); }
.step-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 10px;
}
.step-title {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  font-size: var(--text-2xl);
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: var(--fg1);
  margin: 0 0 8px;
}
.step-title em { font-family: var(--font-serif); font-style: italic; font-weight: var(--fw-light); }
.step-sub { font-size: var(--text-md); color: var(--fg2); margin: 0; line-height: 1.5; }

/* field ---------------------------------------------------- */
.field { margin-bottom: var(--space-6); }
.field:last-child { margin-bottom: 0; }
.field-label {
  font-weight: var(--fw-medium);
  font-size: 15px;
  color: var(--fg1);
  margin-bottom: 6px;
  line-height: 1.45;
}
.req { color: var(--coral); font-weight: var(--fw-semibold); margin-left: 4px; }
.optional { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); letter-spacing: 0.02em; font-weight: 400; margin-left: 7px; vertical-align: 1px; }
.field-help { font-size: 13px; color: var(--fg2); margin: 0 0 12px; line-height: 1.5; }

.input, .textarea, .select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--fg1);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--paper);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--navy-400); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: var(--shadow-focus);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.input.has-error, .textarea.has-error { border-color: var(--coral); background: var(--coral-50); }
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--coral-700);
  margin-top: 7px;
  font-weight: var(--fw-medium);
}

/* choice cards (single / multi) ---------------------------- */
.choice-grid { display: grid; gap: 10px; }
.choice-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  text-align: left;
  font-size: 14.5px;
  font-weight: var(--fw-medium);
  color: var(--fg1);
}
.choice:hover { border-color: var(--navy-500); }
.choice.is-selected { border-color: var(--coral); background: var(--coral-50); box-shadow: inset 0 0 0 1px var(--coral); }
.choice .tick {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.choice.radio .tick { border-radius: var(--radius-pill); }
.choice.is-selected .tick { background: var(--coral); border-color: var(--coral); color: #fff; }
.choice .tick svg { opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.choice.is-selected .tick svg { opacity: 1; }
.choice-body { display: flex; flex-direction: column; gap: 2px; }
.choice-body .desc { font-size: 12.5px; font-weight: var(--fw-regular); color: var(--fg2); line-height: 1.4; }

/* style picker cards w/ glyph ------------------------------ */
.stylecard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stylecard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--paper);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.stylecard:hover { border-color: var(--navy-500); }
.stylecard.is-selected { border-color: var(--coral); background: var(--coral-50); box-shadow: inset 0 0 0 1px var(--coral); }
.stylecard .glyph {
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--navy-50);
  display: grid;
  place-items: center;
  color: var(--navy-700);
  border: 1px solid var(--border);
}
.stylecard.is-selected .glyph { background: var(--paper); border-color: var(--coral-200); }
.stylecard .name { font-size: 14px; font-weight: var(--fw-medium); color: var(--fg1); }
.stylecard .corner-tick {
  position: absolute; top: 10px; right: 10px;
  width: 20px; height: 20px; border-radius: var(--radius-pill);
  background: var(--coral); color: #fff; display: grid; place-items: center;
  opacity: 0; transform: scale(0.6); transition: all var(--dur-fast) var(--ease-bounce, var(--ease-out));
}
.stylecard.is-selected .corner-tick { opacity: 1; transform: scale(1); }

/* chips (multi-select feelings / typography) --------------- */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: var(--fw-medium);
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--fg1);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip:hover { border-color: var(--navy-500); }
.chip.is-selected { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip.is-selected .x { opacity: 0.7; }

/* upload dropzone ------------------------------------------ */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--navy-50);
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--coral); background: var(--coral-50); }
.dropzone .dz-icon { color: var(--navy-400); margin-bottom: 8px; }
.dropzone .dz-title { font-weight: var(--fw-medium); font-size: 14px; color: var(--fg1); }
.dropzone .dz-sub { font-size: 12.5px; color: var(--fg2); margin-top: 3px; }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--paper);
}
.file-thumb { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--navy-100); display: grid; place-items: center; color: var(--navy-500); flex: none; overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 13.5px; font-weight: var(--fw-medium); color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); }
.file-x { flex: none; border: none; background: transparent; color: var(--navy-400); cursor: pointer; padding: 4px; border-radius: var(--radius-sm); display: grid; place-items: center; }
.file-x:hover { color: var(--coral); background: var(--coral-50); }

/* link rows ------------------------------------------------ */
.link-rows { display: flex; flex-direction: column; gap: 9px; }
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row .input { flex: 1; }
.add-link { align-self: flex-start; }

/* footer nav (sticky) -------------------------------------- */
.form-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  background: rgba(250,250,249,0.9);
  backdrop-filter: saturate(160%) blur(12px);
  border-top: 1px solid var(--border);
}
.form-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.footer-hint { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); }

/* two-column helper ---------------------------------------- */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
  .choice-grid.cols-2, .choice-grid.cols-3, .stylecard-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Brief screen
   ============================================================ */
.brief-stage { max-width: 820px; margin: 0 auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 24px) 80px; }
.brief-hero {
  text-align: center;
  margin-bottom: var(--space-7);
}
.brief-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--success); background: #EAF4EF;
  padding: 6px 13px; border-radius: var(--radius-pill); margin-bottom: var(--space-4);
}
.brief-title { font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: var(--text-3xl); letter-spacing: -0.028em; line-height: 1.04; margin: 0 0 10px; }
.brief-title em { font-family: var(--font-serif); font-style: italic; font-weight: var(--fw-light); }
.brief-lede { font-size: var(--text-md); color: var(--fg2); margin: 0 auto; max-width: 56ch; }

.brief-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: var(--space-6) 0 var(--space-7); }
.confirmation-ref {
  margin-top: -18px;
  font-size: 13.5px;
  color: var(--fg2);
}
.confirmation-ref code {
  background: var(--navy-100);
}

.brief-doc {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.brief-doc-head {
  padding: 22px clamp(20px, 4vw, 32px);
  border-bottom: 1px solid var(--border);
  background: var(--navy-900);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
}
.brief-doc-head .bd-name { font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: var(--text-xl); letter-spacing: -0.02em; }
.brief-doc-head .bd-slogan { font-family: var(--font-serif); font-style: italic; font-weight: var(--fw-light); color: var(--navy-200); font-size: 15px; margin-top: 2px; }
.brief-doc-head .bd-ref { font-family: var(--font-mono); font-size: 11px; color: var(--navy-300); letter-spacing: 0.04em; text-align: right; }

.brief-grid { padding: clamp(12px, 3vw, 20px) clamp(20px, 4vw, 32px); }
.brief-section { padding: 18px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 168px 1fr; gap: var(--space-5); }
.brief-section:last-child { border-bottom: none; }
.brief-section .bs-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg3); padding-top: 2px; }
.brief-section .bs-value { font-size: 15px; color: var(--fg1); line-height: 1.55; }
.brief-section .bs-value.muted { color: var(--fg3); font-style: italic; }
.bs-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.bs-tag { font-size: 12.5px; font-weight: var(--fw-medium); background: var(--navy-100); color: var(--navy-800); padding: 4px 11px; border-radius: var(--radius-sm); }
.bs-tag.coral { background: var(--coral-50); color: var(--coral-700); }
.bs-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bs-links a { font-family: var(--font-mono); font-size: 13px; word-break: break-all; }
.bs-files { display: flex; flex-wrap: wrap; gap: 8px; }
.bs-file-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--fg1); background: var(--navy-50); border: 1px solid var(--border); padding: 5px 10px; border-radius: var(--radius-sm); font-family: var(--font-mono); }
@media (max-width: 560px) { .brief-section { grid-template-columns: 1fr; gap: 6px; } }

/* toast ---------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--navy-900); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: var(--fw-medium);
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--spark); }
.submit-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  max-width: 280px;
  font-size: 12.5px;
  color: var(--coral-700);
  line-height: 1.35;
}
@media (max-width: 640px) {
  .form-footer-inner {
    flex-wrap: wrap;
  }
  .submit-error {
    order: -1;
    flex: 1 0 100%;
    max-width: none;
    margin-left: 0;
  }
}

/* swatch (color preview) ----------------------------------- */
.swatch { width: 22px; height: 22px; border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,0.12); flex: none; }

/* fade-in for steps — transform-only so content is never hidden
   if animations are paused (offscreen iframes, reduced-motion). */
@keyframes stepIn { from { transform: translateY(10px); } to { transform: none; } }
.step-anim { animation: stepIn var(--dur-base) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .step-anim { animation: none; } }

/* small ---------------------------------------------------- */
.muted-note { font-size: 12.5px; color: var(--fg3); }
.kbd-hint { font-family: var(--font-mono); font-size: 11px; color: var(--fg3); }
