/* ==========================================================================
   WILDCARDLABS — PUBLIC PROPOSAL INTAKE (LIGHT, v3)
   Path: public/wildcardlabs.app/frontend/home/subpages/clientPortal/proposalPage.css

   Same light direction as the entry page:
   - Slim Sora display type over quiet system UI text.
   - Lit hairline section heads, pill buttons, glass + halo accents.
   - A live brief rail (progress + summary) beside the form on wide screens.
   ========================================================================== */

:root {
  --safe-top: env(safe-area-inset-top, 0px);

  --bg-base: #fbfcfe;
  --bg-surface: #ffffff;
  --bg-tint: #f3f7fc;

  --text-main: #0b1220;
  --text-muted: #475569;
  --text-dim: #64748b;

  --line: rgba(11, 18, 32, .08);
  --line-2: rgba(11, 18, 32, .16);

  --wl-sky: #0ea5e9;
  --wl-blue: #2563eb;
  --wl-indigo: #6366f1;

  --status-green: #059669;
  --status-yellow: #d97706;
  --status-red: #dc2626;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", var(--font-ui);
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --maxw: 1040px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body.wl-proposal-body {
  position: relative;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--wl-font-frontend, var(--font-ui));
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--wl-sky);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Ambient ---------- */
body.wl-proposal-body::before {
  content: ""; position: fixed; inset: -10%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(14, 165, 233, .18), transparent 70%),
    radial-gradient(40% 35% at 6% 96%, rgba(37, 99, 235, .08), transparent 70%),
    radial-gradient(35% 30% at 96% 68%, rgba(99, 102, 241, .08), transparent 70%);
  animation: ambientDrift 32s ease-in-out infinite alternate;
}
body.wl-proposal-body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse 70% 45% at 50% 0%, #000 10%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 45% at 50% 0%, #000 10%, transparent 75%);
}
@keyframes ambientDrift {
  from { transform: translate3d(-1.5%, 0, 0) scale(1); }
  to   { transform: translate3d(1.5%, 1%, 0) scale(1.04); }
}
.pointer-light {
  position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none;
  width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: radial-gradient(closest-side, rgba(14, 165, 233, .1), transparent);
  opacity: 0; transition: opacity .6s; will-change: transform;
}
.pointer-light.on { opacity: 1; }
@media (hover: none) { .pointer-light { display: none; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
  padding-top: var(--safe-top);
  background: linear-gradient(180deg, rgba(251, 252, 254, .94), rgba(251, 252, 254, .74));
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); height: 64px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand-logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--wl-sky);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .14), 0 0 16px 2px rgba(14, 165, 233, .6);
  animation: markBreath 4.5s ease-in-out infinite;
}
@keyframes markBreath { 50% { box-shadow: 0 0 0 6px rgba(14, 165, 233, .09), 0 0 24px 4px rgba(14, 165, 233, .75); } }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 300; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.brand-name span { font-weight: 600; color: var(--wl-sky); }
.brand-sub { margin-top: 3px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }

.nav-link {
  flex: none; padding: 8px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--text-muted);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: color .2s, box-shadow .2s, background .2s;
}
.nav-link:hover { color: var(--wl-sky); background: rgba(14, 165, 233, .05); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .55), 0 0 18px rgba(14, 165, 233, .14); }

.progress-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; overflow: hidden; }
.progress-line i {
  display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--wl-sky), var(--wl-blue));
  box-shadow: 0 0 14px 2px rgba(14, 165, 233, .5);
  transition: transform .5s var(--ease);
}

/* ---------- Layout ---------- */
.proposal-layout { position: relative; z-index: 2; flex: 1; width: 100%; padding: clamp(32px, 6vw, 64px) 20px 96px; }
.proposal-container { max-width: var(--maxw); margin: 0 auto; }

.proposal-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 5vw, 64px); align-items: start;
}
.proposal-form-col { min-width: 0; }
@media (max-width: 900px) { .proposal-grid { grid-template-columns: 1fr; } .brief-rail { display: none; } }

/* ---------- Hero ---------- */
.proposal-hero { margin-bottom: clamp(32px, 5vw, 52px); max-width: 760px; }
.k {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
}
.k-inline { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--text-dim); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-dim); }
.dot-live { background: var(--status-green); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14), 0 0 10px rgba(5, 150, 105, .55); }

.proposal-title {
  margin: 18px 0 16px; max-width: 16ch; text-wrap: balance;
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(2.2rem, 6.6vw, 4rem); line-height: 1.05; letter-spacing: -.05em;
}
.proposal-title span {
  font-weight: 300;
  background: linear-gradient(120deg, var(--wl-sky), var(--wl-blue) 60%, var(--wl-indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(14, 165, 233, .3));
}
.proposal-subtitle { max-width: 56ch; font-size: clamp(14px, 1.7vw, 16px); line-height: 1.7; color: var(--text-muted); text-wrap: pretty; }
.trust-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 24px; }
.trust-row li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-dim); }

/* ---------- Section heads / panels ---------- */
.panel { position: relative; margin-bottom: clamp(36px, 5vw, 52px); scroll-margin-top: 92px; }
.panel-head {
  position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-top: 24px; margin-bottom: 22px;
}
.panel-head::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--line-2), var(--line) 55%, transparent); }
.panel-head::after { content: ""; position: absolute; top: -1px; left: 0; width: 30px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .4); }
.panel-head h2 { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.panel-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.panel-body { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label.k, .field > .k { margin-bottom: 0; }
.field-foot { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); }

input[type="text"], input[type="email"], select, textarea {
  width: 100%; padding: 12px 14px;
  font-family: var(--font-ui); font-size: 14px; color: var(--text-main);
  background: rgba(255, 255, 255, .85);
  border: 1px solid var(--line-2); border-radius: 12px; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:hover, select:hover, textarea:hover { border-color: rgba(11, 18, 32, .28); }
input:focus, select:focus, textarea:focus {
  border-color: var(--wl-sky); background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .14), 0 10px 24px -14px rgba(14, 165, 233, .6);
}
input:user-invalid, textarea:user-invalid { border-color: rgba(220, 38, 38, .55); box-shadow: 0 0 0 3px rgba(220, 38, 38, .08); }

textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
textarea.small { min-height: 100px; }

select.editor-select {
  cursor: pointer; appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 13px center;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Chips ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-option {
  padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 1px var(--line-2);
  user-select: none; -webkit-user-select: none;
  transition: color .2s, background .2s, box-shadow .2s, transform .15s;
}
.chip-option:hover { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .55); }
.chip-option:active { transform: scale(.97); }
.chip-option.selected {
  color: var(--text-main); background: rgba(14, 165, 233, .09);
  box-shadow: inset 0 0 0 1px var(--wl-sky), 0 0 18px rgba(14, 165, 233, .18);
}
.chip-option.selected::before { content: "✓"; margin-right: 7px; color: var(--wl-sky); font-weight: 700; }

/* ---------- Submit ---------- */
.submit-area { margin-top: 8px; padding-top: 26px; border-top: 1px solid var(--line); }
.privacy-note { max-width: 56ch; margin-bottom: 18px; font-size: 12.5px; line-height: 1.65; color: var(--text-dim); }
.form-error {
  margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: var(--status-red);
  background: rgba(220, 38, 38, .05); box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .3);
}

.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 24px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255, 255, 255, .6);
  transition: color .2s, box-shadow .2s, background .2s, transform .2s;
}
.ghost-btn:hover { color: var(--wl-sky); background: rgba(14, 165, 233, .05); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .55), 0 0 22px rgba(14, 165, 233, .14); }
.ghost-btn:active { transform: scale(.98); }

.cta-button {
  width: 100%; color: #fff; border: 0;
  background: linear-gradient(135deg, var(--wl-sky), var(--wl-blue));
  box-shadow: 0 12px 30px -10px rgba(14, 165, 233, .7), inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.cta-button:hover { color: #fff; background: linear-gradient(135deg, var(--wl-sky), var(--wl-blue)); box-shadow: 0 16px 38px -10px rgba(14, 165, 233, .9), inset 0 0 0 1px rgba(255, 255, 255, .35); transform: translateY(-1px); }
.cta-button:disabled { opacity: .6; cursor: wait; transform: none; }
.cta-button .arrow { transition: transform .3s var(--ease); }
.cta-button:hover .arrow { transform: translateX(3px); }

/* ---------- Brief rail (progress + live summary) ---------- */
.brief-rail { position: sticky; top: 92px; }
.rail-card {
  position: relative; padding: 24px 22px 22px; border-radius: 22px;
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(14, 165, 233, .1), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(243, 247, 252, .9));
  box-shadow: inset 0 0 0 1px var(--line-2), 0 28px 56px -34px rgba(14, 165, 233, .55);
}
.rail-card::before { content: ""; position: absolute; top: -1px; left: 22px; width: 30px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .45); }

.rail-pct { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 12px; }
.rail-pct b { font-family: var(--font-display); font-weight: 200; font-size: 2.4rem; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.rail-pct span { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .12em; }
.rail-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.rail-bar i { display: block; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, var(--wl-sky), var(--wl-blue)); box-shadow: 0 0 12px rgba(14, 165, 233, .6); transition: transform .5s var(--ease); }

.rail-steps { list-style: none; margin-top: 18px; }
.rail-steps li { border-top: 1px solid var(--line); }
.rail-steps li:first-child { border-top: 0; }
.rail-steps button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 0; text-align: left;
  font-size: 13px; color: var(--text-dim); transition: color .2s;
}
.rail-steps button:hover { color: var(--text-main); }
.rail-steps .dot { box-shadow: inset 0 0 0 1.5px rgba(100, 116, 139, .55); background: transparent; transition: background .3s, box-shadow .3s; }
.rail-steps li.is-done button { color: var(--text-main); }
.rail-steps li.is-done .dot { background: var(--status-green); box-shadow: 0 0 0 3px rgba(5, 150, 105, .14), 0 0 10px rgba(5, 150, 105, .55); }
.rail-steps em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

.rail-summary { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); display: grid; gap: 12px; }
.rail-summary dt { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.rail-summary dd { margin-top: 3px; font-size: 13px; color: var(--text-main); word-break: break-word; }
.rail-summary dd.is-empty { color: #94a3b8; }
.rail-draft { margin-top: 16px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; min-height: 16px; }

/* ---------- Confirmation ---------- */
.confirmation-state { display: none; max-width: 600px; margin: 0 auto; padding-top: clamp(16px, 4vw, 40px); text-align: center; }
.confirmation-state.active { display: block; animation: cfmIn .6s var(--ease); }
@keyframes cfmIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.confirm-icon {
  position: relative; width: 72px; height: 72px; margin: 0 auto 26px; border-radius: 26%;
  display: grid; place-items: center; color: var(--status-green);
  background: linear-gradient(160deg, #ffffff, #eefaf5);
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .3), 0 18px 34px -14px rgba(5, 150, 105, .5);
}
.confirm-icon::before {
  content: ""; position: absolute; inset: -38%; z-index: -1; border-radius: 40%;
  background: radial-gradient(closest-side, rgba(5, 150, 105, .4), transparent); filter: blur(22px);
  animation: halo 4s ease-in-out infinite;
}
@keyframes halo { 50% { opacity: .65; transform: scale(1.1); } }
.confirm-icon svg { stroke-dasharray: 26; stroke-dashoffset: 26; animation: draw .6s .3s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.confirm-title { margin: 14px 0 14px; font-family: var(--font-display); font-weight: 200; font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: -.05em; line-height: 1.05; }
.confirm-subtitle { max-width: 50ch; margin: 0 auto 30px; font-size: 14.5px; line-height: 1.7; color: var(--text-muted); }

.proposal-key-card {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: min(100%, 340px); padding: 24px 30px 22px; margin-bottom: 30px; border-radius: 22px;
  background: radial-gradient(90% 120% at 50% 0%, rgba(14, 165, 233, .14), transparent 70%), rgba(255, 255, 255, .85);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .4), 0 26px 50px -28px rgba(14, 165, 233, .7);
}
.proposal-key-card::before { content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%); width: 30px; height: 2px; background: var(--wl-sky); box-shadow: 0 0 14px 2px rgba(14, 165, 233, .5); }
.proposal-key-value { font-family: var(--font-mono); font-size: clamp(1.5rem, 5vw, 1.9rem); font-weight: 700; letter-spacing: .1em; line-height: 1.2; color: var(--wl-sky); text-shadow: 0 0 24px rgba(14, 165, 233, .35); user-select: all; }
.proposal-key-hint { font-size: 12px; color: var(--text-dim); }
.copy-key { margin-top: 4px; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 500; color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--line-2); transition: color .2s, box-shadow .2s, background .2s; }
.copy-key:hover { color: var(--wl-sky); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, .55); background: rgba(14, 165, 233, .05); }
.copy-key.is-copied { color: var(--status-green); box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .4); background: rgba(5, 150, 105, .05); }

.next-steps { list-style: none; max-width: 420px; margin: 0 auto 30px; text-align: left; }
.next-steps li { display: flex; gap: 14px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-muted); }
.next-steps li:first-child { border-top: 0; }
.next-steps b { flex: none; font-family: var(--font-display); font-weight: 300; font-size: 1.05rem; letter-spacing: -.02em; color: var(--wl-sky); }

.confirmation-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.confirmation-actions .cta-button { max-width: 340px; }
.secondary-link { font-size: 12.5px; font-weight: 500; color: var(--text-muted); transition: color .2s; }
.secondary-link:hover { color: var(--wl-sky); }

/* ---------- Motion ---------- */
[data-motion] { animation: ppFade .8s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes ppFade { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 640px) {
  .proposal-layout { padding: 28px 16px 64px; }
  .header-inner { height: 58px; padding: 0 16px; }
  .brand-sub { display: none; }
  .confirmation-actions .cta-button { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .confirm-icon svg { stroke-dashoffset: 0; }
}
