/* ============================================================
   Grey Taurus — Funding Readiness Intake
   Design tokens matched to the main Grey Taurus site's brand
   (css/style.css in the parent repo) for visual consistency.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* Scoped to .intake-flow (views/intake/*) only — the admin panel and
   Agreement/signature/PDF pages share this stylesheet but are out of scope
   for this pass and must keep their existing boxed inputs/fieldsets. */
.intake-flow fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.intake-flow legend {
  padding: 0;
  width: 100%;
}

:root {
  --color-bg: #0f1117;
  --color-bg-surface: #161b26;
  --color-bg-card: #1a2030;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #e8eaf0;
  --color-text-muted: #8a95a3;
  --color-accent: #c9a96e;
  --color-accent-hover: #d4b87a;
  --color-error: #e07070;
  --color-success: #7bc99a;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.25s var(--ease);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 720px;
  --touch: 44px;
}

body {
  font-family: var(--font);
  background-color: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3 { line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }

p { color: var(--color-text-muted); }

.icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 28px; height: 28px; }

/* ----- Layout ------------------------------------------------ */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 56px) 20px 120px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 40px;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.section {
  margin-bottom: 44px;
}

.section-divider {
  height: 1px;
  background: var(--color-border);
  margin: 36px 0;
  border: none;
}

/* ----- Step progress ------------------------------------------ */

.step-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
}
.step-progress .dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--color-border);
  transition: var(--transition);
}
.step-progress .dot.done,
.step-progress .dot.active {
  background: var(--color-accent);
}

.step-label {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.step-panel {
  display: none;
}
.step-panel.active {
  display: block;
  animation: stepIn 0.35s var(--ease);
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Form elements ------------------------------------------ */

.field {
  margin-bottom: 26px;
}

.field label,
.field legend {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 10px;
  color: var(--color-text);
}

.field .hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.field .error {
  font-size: 0.82rem;
  color: var(--color-error);
  margin-top: 8px;
  display: none;
}
.field.invalid .error { display: block; }
.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--color-error);
}

/* Borderless/underline inputs — no boxed fields per the brand's design
   standards. Padding stays on the sides for a comfortable click/tap target
   even though there's no visible box. Scoped to .intake-flow — the admin
   panel and Agreement pages keep their existing boxed inputs (see the
   general input rule below, which still applies everywhere else). */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  min-height: var(--touch);
  padding: 11px 14px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text);
  transition: var(--transition);
}

.intake-flow input[type="text"],
.intake-flow input[type="email"],
.intake-flow input[type="tel"],
.intake-flow input[type="number"],
.intake-flow textarea,
.intake-flow select {
  padding: 11px 2px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

.intake-flow select {
  /* native select chrome renders its own box in some browsers; force it flat */
  appearance: none;
  background-image: none;
}

.intake-flow input[type="text"]:focus-visible,
.intake-flow input[type="email"]:focus-visible,
.intake-flow input[type="tel"]:focus-visible,
.intake-flow input[type="number"]:focus-visible,
.intake-flow textarea:focus-visible,
.intake-flow select:focus-visible {
  border-bottom-color: var(--color-accent);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

textarea { min-height: 96px; resize: vertical; }

/* Choice groups render as free-floating pill options, not boxed radio rows */
.choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.choice label {
  display: flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-surface);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  margin: 0;
}
.choice input:checked + label {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(201, 169, 110, 0.08);
}
.choice input:focus-visible + label {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: var(--touch);
}
.checkbox-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-accent);
}

/* ----- Buttons / free-floating actions ------------------------- */

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 20px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 8px;
}
.btn:hover { color: var(--color-text); }

/* Kept for the admin panel and Agreement/signature/PDF pages, which are out
   of scope for the client-facing intake flow's borderless-CTA pass below —
   see .cta-link. Not used anywhere in views/intake/*. */
.btn-primary {
  background: var(--color-accent);
  color: #14151a;
  font-weight: 600;
  border-radius: 999px;
  padding: 0 26px;
}
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Back / skip / save-and-resume — plain text actions, no fill, no border */
.text-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 20px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 8px;
}
.text-action:hover { color: var(--color-text); }

/* Primary CTA — free-floating text + arrow, animated underline on hover.
   No filled background, no pill shape: standards forbid solid-background
   pill buttons for primary actions. Matches the marketing site's
   .link-arrow pattern (css/style.css) with an added arrow-nudge on hover. */
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 2px;
  border: none;
  background: none;
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  transition: color 150ms ease;
}
.cta-link::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 2px;
  width: 0;
  height: 1px;
  background: var(--color-accent-hover);
  transition: width 150ms ease;
}
.cta-link:hover,
.cta-link:focus-visible {
  color: var(--color-accent-hover);
}
.cta-link:hover::after,
.cta-link:focus-visible::after {
  width: calc(100% - 4px);
}
.cta-link .icon {
  transition: transform 150ms ease;
}
.cta-link:hover .icon,
.cta-link:focus-visible .icon {
  transform: translateX(3px);
}
.cta-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cta-link:disabled:hover::after {
  width: 0;
}
.cta-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.link-action {
  color: var(--color-accent);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}
.link-action:hover { border-bottom-color: var(--color-accent); }

/* ----- Cards / surfaces (used sparingly — background shifts, not boxes) */

.surface {
  background: var(--color-bg-surface);
  border-radius: 16px;
  padding: 24px;
}

.disclosure {
  background: rgba(201, 169, 110, 0.06);
  border-left: 2px solid var(--color-accent);
  padding: 16px 18px;
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-top: 14px;
}

.disclosure.pending {
  border-left-color: var(--color-text-muted);
}

/* ----- Upload dropzone ------------------------------------------ */

.dropzone {
  border: 1px dashed var(--color-border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  transition: var(--transition);
  cursor: pointer;
  min-height: var(--touch);
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.dropzone input { display: none; }

.upload-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.upload-item .icon { color: var(--color-success); }

/* ----- Cost summary table --------------------------------------- */

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.cost-table th,
.cost-table td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.cost-table th {
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.cost-total-row td {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 1.05rem;
  border-bottom: none;
  padding-top: 18px;
}

/* ----- Signature pad --------------------------------------------- */

.signature-wrap {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  touch-action: none;
}
#signature-canvas {
  width: 100%;
  height: 180px;
  display: block;
}

/* ----- Admin table ------------------------------------------------ */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--color-border);
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  text-transform: capitalize;
}

/* ----- Toast / inline banners -------------------------------------- */

.banner {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.banner.error { background: rgba(224, 112, 112, 0.1); color: var(--color-error); }
.banner.success { background: rgba(123, 201, 154, 0.1); color: var(--color-success); }

/* ----- Scroll-reveal motion ------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .step-panel.active { animation: none; }
}

/* ----- Legal content (rendered markdown: /terms, /privacy, agreement) --- */

.legal-content h1 { margin-bottom: 18px; }
.legal-content h2 { margin: 32px 0 12px; }
.legal-content p { margin-bottom: 14px; }
.legal-content ul, .legal-content ol { margin: 0 0 14px 20px; list-style: disc; }
.legal-content ol { list-style: decimal; }
.legal-content li { margin-bottom: 6px; color: var(--color-text-muted); }
.legal-content a { color: var(--color-accent); text-decoration: underline; }
.legal-content blockquote {
  border-left: 2px solid var(--color-accent);
  background: rgba(201, 169, 110, 0.06);
  padding: 14px 18px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.legal-content hr { border: none; border-top: 1px solid var(--color-border); margin: 28px 0; }

/* ----- Site footer -------------------------------------------------- */

.site-footer {
  max-width: var(--max-width);
  margin: 60px auto 0;
  padding: 24px 20px 40px;
  display: flex;
  justify-content: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* ----- Responsive -------------------------------------------------- */

@media (max-width: 480px) {
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .btn-primary,
  .cta-link { justify-content: center; }
  .admin-table { display: block; overflow-x: auto; }
}
