/* -----------------------------------------------------------
   SIA Technology Demand Survey — mobile-first stylesheet
   No frameworks. No build step. ~4 KB.
   Palette:
     --ink    navy              #0b2340   header, body text on light
     --gold   accent            #d4a94a   brand mark, focus ring
     --line   hairline grey     #e3e6eb
     --paper  background        #f5f6f8
     --good   success tick      #1e8f5a
   ----------------------------------------------------------- */

:root {
  --ink:   #0b2340;
  --ink2:  #1a3758;
  --muted: #5b6778;
  --gold:  #d4a94a;
  --line:  #e3e6eb;
  --paper: #f5f6f8;
  --card:  #ffffff;
  --good:  #1e8f5a;
  --bad:   #b3261e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(11,35,64,.06), 0 4px 12px rgba(11,35,64,.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Header ---- */
.site-header {
  background: var(--ink);
  color: #fff;
  padding: 16px 0;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  display: grid; place-items: center;
  font-weight: 800;
  letter-spacing: .5px;
  font-size: 18px;
}
.brand-text h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.tagline {
  margin: 2px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.75);
}

/* ---- Main ---- */
main { padding: 20px 0 60px; }

.intro {
  color: var(--muted);
  font-size: 14.5px;
  margin: 4px 0 18px;
}

/* ---- Fieldsets ---- */
form { margin: 0; }
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px 14px 16px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink2);
}
.hint {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ---- Labelled fields ---- */
.field {
  display: block;
  margin-bottom: 10px;
}
.field > span {
  display: block;
  font-size: 13px;
  color: var(--ink2);
  margin-bottom: 4px;
  font-weight: 600;
}
.field em {
  color: var(--bad);
  font-style: normal;
  margin-left: 2px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  font-size: 16px; /* keeps iOS from zooming */
  line-height: 1.3;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 72px; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,169,74,.25);
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink2) 50%),
    linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* ---- Checkbox grid ---- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 520px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
}

.chk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  font-size: 15px;
  min-height: 44px; /* thumb-friendly */
}
.chk:hover { border-color: #cfd4db; }
.chk input {
  width: 20px; height: 20px;
  accent-color: var(--ink);
  flex: 0 0 auto;
}
.chk input:checked + span { font-weight: 600; }
.chk:has(input:checked) {
  background: #f1f5fb;
  border-color: var(--ink2);
}

/* ---- Buttons ---- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, transform .08s, opacity .2s;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
  margin-top: 4px;
}
.btn-primary:hover { background: var(--ink2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .7; cursor: progress; }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  margin-top: 16px;
}
.btn-secondary:hover { background: #f1f5fb; }

/* Spinner, shown only while submitting */
.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn-primary.is-loading .btn-spinner { display: inline-block; }
.btn-primary.is-loading .btn-label   { opacity: .75; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Error + fine print ---- */
.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #fbecea;
  color: var(--bad);
  border: 1px solid #f1c4bf;
  border-radius: 8px;
  font-size: 14px;
}
.fineprint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* ---- Thanks card ---- */
.thanks-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 24px;
  text-align: center;
  margin-top: 32px;
}
.thanks-card h2 { margin: 8px 0 6px; color: var(--ink); font-size: 22px; }
.thanks-card p  { margin: 6px 0; color: var(--ink2); }
.thanks-card .ref { font-size: 13px; color: var(--muted); margin-top: 10px; }
.thanks-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f1f3f7;
  padding: 2px 6px;
  border-radius: 4px;
}
.tick {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  display: grid; place-items: center;
  margin: 0 auto 8px;
}

/* ---- Footer ---- */
.site-footer {
  padding: 18px 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  background: #fff;
}

/* ---- Honeypot ---- */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
