/* TX Crash Kings intake: "Royal Night". Navy and gold from the crest, with a calm,
   glassy, Apple-like finish. Single dark theme on purpose (the brand is gold on navy);
   gold is only ever used on navy, never on white. Fonts are self-hosted (CSP font-src 'self'). */
@font-face { font-family: Inter; src: url(/fonts/inter-latin.woff2) format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: Oswald; src: url(/fonts/oswald-latin.woff2) format('woff2'); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --abyss: #050B1C;
  --navy: #0A1736;
  --navy-2: #0F2049;
  --navy-3: #1A2F66;
  --gold: #D4AF5A;
  --gold-hi: #F3DC9A;
  --gold-deep: #9C7A2E;
  --red: #C8222C;
  --text: #F5F7FB;
  --text-2: #AEB8CF;
  --text-3: #8692AE;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
  --field: rgba(255, 255, 255, .045);
  --field-focus: rgba(255, 255, 255, .075);
  --error: #FF8080;
  --gold-leaf: linear-gradient(145deg, #FBE7A6 0%, #D9B451 45%, #A88330 100%);
  --display: Oswald, "Arial Narrow", sans-serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; min-height: 100vh; background: var(--navy); color: var(--text); font: 16px/1.5 var(--body); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* page atmosphere: a soft gold light from the top, fading into deep navy */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 45% at 50% -5%, rgba(212, 175, 90, .16), transparent 70%),
              radial-gradient(60% 50% at 100% 30%, rgba(40, 80, 170, .22), transparent 70%),
              linear-gradient(180deg, var(--navy) 0%, var(--abyss) 100%); }
::selection { background: var(--gold); color: var(--navy); }

/* ---- hero ------------------------------------------------------------------ */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--gold) 80%, transparent); opacity: .8; }
.hero-glow { position: absolute; inset: -40% -20% auto; height: 160%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 40% at 25% 40%, rgba(243, 220, 154, .14), transparent 70%),
              repeating-linear-gradient(135deg, rgba(243, 220, 154, .035) 0 1px, transparent 1px 16px); }
.hero-inner { max-width: 1040px; margin: 0 auto; padding: 28px 16px 30px; display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; }
.crest { width: 84px; height: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .55)) drop-shadow(0 0 18px rgba(212, 175, 90, .18)); }
.eyebrow { font: 600 12px/1 var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold-hi); }
.hero h1 { margin: 8px 0 6px; font: 700 36px/1.02 var(--body); letter-spacing: -.035em;
  background: linear-gradient(180deg, #FFFFFF 30%, #C9D2E6); -webkit-background-clip: text; background-clip: text; color: transparent; text-wrap: balance; }
.tagline { margin: 0; font-size: 15px; color: var(--text-2); letter-spacing: -.005em; }
.who { grid-column: 1 / -1; justify-self: start; margin-top: 12px; font-size: 12px; font-weight: 500; color: var(--text-2); background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.who:empty { display: none; }
@media (min-width: 720px) {
  .hero-inner { grid-template-columns: auto 1fr auto; padding: 44px 24px 46px; gap: 28px; }
  .crest { width: 128px; }
  .hero h1 { font-size: 60px; }
  .tagline { font-size: 18px; }
  .who { grid-column: auto; align-self: start; justify-self: end; margin: 0; }
}
html.tg .hero-inner { padding-top: 18px; padding-bottom: 20px; }

/* ---- compact glass bar that slides in once the hero scrolls away (scroll-driven, no JS) -- */
.bar { display: none; }
@supports (animation-timeline: scroll()) {
  .bar { display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 10; pointer-events: none;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(8, 18, 44, .72); backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%);
    border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(-100%);
    animation: bar-in linear both; animation-timeline: scroll(root); animation-range: 120px 200px; }
  .bar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold-leaf); transform-origin: 0 50%; transform: scaleX(0);
    animation: grow linear both; animation-timeline: scroll(root); }
}
.bar-inner { max-width: 1040px; margin: 0 auto; height: 52px; padding: 0 16px; display: flex; align-items: center; gap: 10px; }
.bar-crest { width: 26px; height: auto; }
.bar-title { font: 600 15px/1 var(--body); letter-spacing: -.01em; }
@keyframes bar-in { to { opacity: 1; transform: none; } }
@keyframes grow { to { transform: scaleX(1); } }

/* ---- layout ----------------------------------------------------------------- */
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 72px; counter-reset: step; }
@media (min-width: 720px) { main { padding: 36px 24px 96px; } }

.card { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px 22px; margin: 0 0 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -28px rgba(0, 0, 0, .7); }
@media (min-width: 720px) { .card { padding: 0 28px 28px; margin-bottom: 24px; } }
/* hairline of gold light along the top edge */
.card::before { content: ''; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(243, 220, 154, .55), transparent); }

.card h2, .client-head { counter-increment: step; display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 20px 0 16px; font: 600 21px/1.2 var(--body); letter-spacing: -.02em; color: var(--text); border-bottom: 1px solid var(--line); }
@media (min-width: 720px) { .card h2, .client-head { font-size: 24px; padding: 26px 0 20px; margin-bottom: 22px; } }
.card h2::before, .client-head::before { content: counter(step, decimal-leading-zero); flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font: 700 14px/1 var(--display); letter-spacing: 0; color: var(--navy); background: var(--gold-leaf);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 4px 14px rgba(212, 175, 90, .35); }
.client-head h2 { all: unset; flex: 1; min-width: 0; }
.client-head > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.card h3 { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; font: 600 13px/1.2 var(--display); text-transform: uppercase; letter-spacing: .2em; color: var(--gold-hi); }
.card h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212, 175, 90, .6), transparent); }
.badge { white-space: nowrap; font: 600 11px/1.6 var(--body); letter-spacing: 0; text-transform: none; color: var(--gold-hi); background: rgba(212, 175, 90, .12); border: 1px solid rgba(212, 175, 90, .3); border-radius: 999px; padding: 1px 9px; }

.grid { display: grid; grid-template-columns: 1fr; gap: 18px 20px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 14px; font-weight: 500; letter-spacing: -.005em; margin-bottom: 7px; color: #E3E8F2; }
.field .req { color: var(--gold); margin-left: 3px; }
.field .help { font-size: 13px; color: var(--text-3); margin-top: 6px; }
.field .err { font-size: 13px; font-weight: 600; color: var(--error); margin-top: 6px; }

/* ---- controls --------------------------------------------------------------- */
input, select, textarea { width: 100%; min-height: 52px; font: inherit; font-size: 16px; color: var(--text); background-color: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 13px 16px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s var(--ease); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select, input[list] { padding-right: 44px; }
select { appearance: none; -webkit-appearance: none;
}
select, input[list] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23F3DC9A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 12px; }
select option { background: var(--navy-2); color: var(--text); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .26); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-hi); background-color: var(--field-focus); box-shadow: 0 0 0 4px rgba(243, 220, 154, .16), 0 8px 24px -12px rgba(212, 175, 90, .5); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus { -webkit-text-fill-color: var(--text); box-shadow: inset 0 0 0 100px #16264F; caret-color: var(--text); }
input::-webkit-calendar-picker-indicator { opacity: .75; cursor: pointer; transition: opacity .2s; }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[list]::-webkit-calendar-picker-indicator { opacity: 0; }
.invalid input, .invalid select, .invalid textarea { border-color: var(--error); box-shadow: 0 0 0 4px rgba(255, 128, 128, .14); }

button { position: relative; overflow: hidden; font: 600 15px/1 var(--body); letter-spacing: -.005em; border: 0; border-radius: 999px; min-height: 50px; padding: 15px 26px; cursor: pointer;
  color: var(--navy); background: var(--gold-leaf);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 10px 28px -10px rgba(212, 175, 90, .7);
  transition: transform .35s var(--spring), box-shadow .3s var(--ease), filter .3s var(--ease), background-color .3s var(--ease), color .3s var(--ease); -webkit-tap-highlight-color: transparent; }
/* a slow sheen sweeps across gold buttons on hover */
button:not(.secondary):not(.link)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); transition: transform .9s var(--ease); pointer-events: none; }
button:hover { transform: translateY(-1px); filter: brightness(1.04); }
button:not(.secondary):not(.link):hover::after { transform: translateX(120%); }
button:active { transform: scale(.97); transition-duration: .12s; }
button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
button.secondary { color: var(--gold-hi); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(243, 220, 154, .45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
button.secondary:hover { background: rgba(243, 220, 154, .1); }
button.link { min-height: 40px; padding: 10px 12px; background: none; box-shadow: none; font-size: 14px; font-weight: 500; color: var(--error); border-radius: 10px; }
button.link:hover { background: rgba(255, 255, 255, .06); transform: none; }
button.link.plain { color: var(--gold-hi); }
button:disabled { opacity: .55; cursor: default; transform: none; filter: saturate(.6); }
#add-client { width: 100%; min-height: 56px; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px rgba(243, 220, 154, .35); background: rgba(255, 255, 255, .025); }
#add-client:hover { background: rgba(243, 220, 154, .08); }

.actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-top: 24px; }
#submit { flex: 1 1 100%; min-height: 58px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
@media (min-width: 720px) { #submit { flex: 0 0 auto; min-width: 280px; } }
.hint { color: var(--text-3); font-size: 13px; flex: 1 1 260px; }

.notice { position: relative; background: rgba(212, 175, 90, .09); border: 1px solid rgba(212, 175, 90, .32); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; color: var(--text); box-shadow: 0 12px 30px -18px rgba(212, 175, 90, .5); }
.notice button { margin-left: 10px; min-height: 36px; padding: 9px 16px; font-size: 13px; }

.done { position: relative; text-align: center; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 22px 32px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 70px -30px rgba(0, 0, 0, .8); }
.done h2 { margin: 18px 0 8px; font: 700 32px/1.1 var(--body); letter-spacing: -.03em; }
.done p { margin: 0 auto; max-width: 44ch; color: var(--text-2); }
.done .actions { justify-content: center; }
.seal { width: 76px; height: 76px; fill: none; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 8px 22px rgba(212, 175, 90, .45)); }
.seal circle { stroke: var(--gold); stroke-width: 2.5; }
.seal path { stroke: var(--gold-hi); stroke-width: 4; }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.checklist .check { display: flex; gap: 12px; align-items: center; min-height: 50px; margin: 0; padding: 10px 14px; font-weight: 500; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--field); cursor: pointer;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .3s var(--spring); }
.checklist .check:hover { border-color: rgba(255, 255, 255, .26); }
.checklist .check:has(input:checked) { border-color: rgba(243, 220, 154, .7); background: rgba(212, 175, 90, .12); }
.checklist input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--gold); }
.files input[type=file] { width: 100%; padding: 12px; border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { font: 600 14px/1 var(--body); color: var(--navy); background: var(--gold-leaf); border: 0; border-radius: 999px; padding: 10px 16px; margin-right: 12px; cursor: pointer; }

/* ---- motion: everything is visible at rest; motion only adds polish --------------- */
@media (prefers-reduced-motion: no-preference) {
  .crest { animation: crest-in 1s var(--spring) both; }
  .hero-text > * { animation: rise .9s var(--ease) both; }
  .hero-text > :nth-child(2) { animation-delay: .08s; }
  .hero-text > :nth-child(3) { animation-delay: .16s; }
  .who { animation: rise .9s var(--ease) .24s both; }
  .hero-glow { animation: drift 18s ease-in-out infinite alternate; }
  #form:not([hidden]) > #incident > .card:first-child { animation: rise .9s var(--ease) .2s both; }
  @supports (animation-timeline: view()) {
    .card { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 28%; }
  }
  /* fields that appear from an answer (showIf, minor sections) ease in */
  .field, [data-section], .notice, .done { transition: opacity .45s var(--ease), transform .45s var(--ease), display .45s allow-discrete; }
  @starting-style { .field, [data-section], .notice { opacity: 0; transform: translateY(-6px); } .done { opacity: 0; transform: scale(.97); } }
  .invalid input, .invalid select, .invalid textarea { animation: nudge .42s var(--ease); }
  .done:not([hidden]) .seal circle { stroke-dasharray: 183; animation: draw .8s var(--ease) .1s both; }
  .done:not([hidden]) .seal path { stroke-dasharray: 44; animation: draw .5s var(--ease) .7s both; }
  .done:not([hidden]) .seal { animation: crest-in .8s var(--spring) both; }
  .checklist .check:active { transform: scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes reveal { from { opacity: 0; transform: translateY(28px) scale(.985); } }
@keyframes crest-in { from { opacity: 0; transform: scale(.86) translateY(6px); } }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(6%, 4%, 0); } }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes draw { from { stroke-dashoffset: var(--len, 183); } to { stroke-dashoffset: 0; } }
.seal path { --len: 44; }
