:root {
  --ink: #071126;
  --muted: #5e6b80;
  --line: #d9d1c2;
  --panel: #ffffff;
  --paper: #f7f5ef;
  --accent: #071126;
  --accent-dark: #050b18;
  --accent-soft: #f2eadc;
  --teal: #42536d;
  --green: #2d654f;
  --gold: #bd852e;
  --coral: #c55c42;
  --violet: #7457b8;
  --focus: #f1b84b;
  --shadow: 0 20px 54px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(7, 17, 38, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(189, 133, 46, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, #f7f5ef 0%, #eef0f4 48%, #fbf7ef 100%);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("./assets/crown-district-crown-logo.png");
  background-repeat: no-repeat;
  background-position: center 130px;
  background-size: min(72vw, 780px);
  opacity: 0.055;
}

.page-shell {
  position: relative;
  z-index: 1;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.assessment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-link img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  padding: 8px;
  border: 1px solid rgba(189, 133, 46, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.brand-link strong,
.brand-link small {
  display: block;
}

.brand-link small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-link {
  color: var(--gold);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.intro-panel {
  margin-bottom: 24px;
}

.intro-copy {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px);
  background:
    linear-gradient(90deg, rgba(7, 17, 38, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(184, 122, 29, 0.1) 1px, transparent 1px),
    #ffffff;
  background-size: 26px 26px, 26px 26px, auto;
  border: 1px solid rgba(189, 133, 46, 0.24);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-copy::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--teal));
}

.intro-copy::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 48px);
  bottom: clamp(18px, 4vw, 42px);
  width: 160px;
  height: 96px;
  border: 1px solid rgba(35, 100, 170, 0.18);
  background:
    linear-gradient(90deg, rgba(35, 100, 170, 0.2) 2px, transparent 2px),
    linear-gradient(0deg, rgba(31, 122, 112, 0.18) 2px, transparent 2px);
  background-size: 32px 32px;
  opacity: 0.45;
}

.intro-copy > * {
  position: relative;
  z-index: 1;
}

.assessment-logo {
  width: min(250px, 70vw);
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(189, 133, 46, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.assessment-logo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: inherit;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 16px;
  padding: 7px 11px;
  color: var(--accent-dark);
  background: rgba(242, 234, 220, 0.92);
  border: 1px solid rgba(189, 133, 46, 0.24);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1;
  color: var(--ink);
}

.lede {
  max-width: 800px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.privacy-callout {
  max-width: 820px;
  margin: 18px 0 0;
  padding: 13px 15px;
  border: 1px solid rgba(189, 133, 46, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #4f5c70;
  font-size: 0.92rem;
}

.privacy-callout.compact {
  margin-top: 12px;
  background: rgba(242, 234, 220, 0.62);
}

.form-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.status-panel {
  position: sticky;
  top: 18px;
}

.status-card {
  background:
    linear-gradient(180deg, rgba(242, 234, 220, 0.88), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(189, 133, 46, 0.2);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-label strong {
  color: var(--ink);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: #dde8f1;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--green));
  border-radius: inherit;
  transition: width 180ms ease;
}

.save-state {
  min-height: 40px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.intake-form {
  display: grid;
  gap: 18px;
  counter-reset: section;
}

.form-section,
.submit-panel {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 30px);
  box-shadow: 0 10px 30px rgba(24, 33, 47, 0.06);
}

.form-section {
  counter-increment: section;
  border-left: 6px solid var(--section-color, var(--accent));
}

.form-section:nth-of-type(1) {
  --section-color: var(--accent);
}

.form-section:nth-of-type(2) {
  --section-color: var(--teal);
}

.form-section:nth-of-type(3) {
  --section-color: var(--gold);
}

.form-section:nth-of-type(4) {
  --section-color: var(--coral);
}

.form-section:nth-of-type(5) {
  --section-color: var(--violet);
}

.form-section:nth-of-type(6) {
  --section-color: var(--green);
}

.form-section:nth-of-type(7) {
  --section-color: #4770b8;
}

.form-section:nth-of-type(8) {
  --section-color: #2f8c84;
}

.form-section:nth-of-type(9) {
  --section-color: #a26f20;
}

.form-section:nth-of-type(10) {
  --section-color: #9b5ab8;
}

.form-section:nth-of-type(11) {
  --section-color: #c35b43;
}

.form-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--section-color, var(--accent));
  opacity: 0.16;
}

.form-section h2,
.submit-panel h2 {
  margin: 0 0 18px;
  font-size: clamp(1.18rem, 3vw, 1.55rem);
  line-height: 1.2;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.section-heading h2::before {
  content: counter(section);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: #fff;
  background: var(--section-color, var(--accent));
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 900;
}

.clear-section {
  min-height: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  background: #fff;
  color: #5d697a;
  border-color: #c8d2df;
  font-size: 0.86rem;
}

.clear-section:hover {
  background: #f5f7fa;
  color: var(--accent-dark);
  border-color: var(--accent);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.form-section > label:last-child,
.form-section > fieldset:last-child {
  margin-bottom: 0;
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  margin: 0 0 9px;
  padding: 0;
  font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid #c4d0dc;
  border-radius: 7px;
  padding: 12px 13px;
  font-weight: 500;
  outline: none;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(35, 100, 170, 0.16);
}

input:required {
  border-left: 4px solid var(--accent);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.choice-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid label {
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  border: 1px solid #dce3ec;
  border-radius: 7px;
  color: #2f3a49;
  font-size: 0.9rem;
  font-weight: 650;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.choice-grid label:has(input:checked) {
  background: var(--accent-soft);
  border-color: rgba(35, 100, 170, 0.55);
  box-shadow: inset 0 0 0 1px rgba(35, 100, 170, 0.16);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.submit-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  border-color: rgba(31, 122, 112, 0.24);
  background:
    linear-gradient(90deg, rgba(31, 122, 112, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(35, 100, 170, 0.08) 1px, transparent 1px),
    #fafdff;
  background-size: 24px 24px;
}

.submit-panel p {
  margin: 0;
  color: var(--muted);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 0 18px;
  background: linear-gradient(90deg, var(--accent), #15233c);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

button:hover {
  background: linear-gradient(90deg, var(--accent-dark), #0f1a2d);
  border-color: var(--accent-dark);
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: #fff;
  color: var(--accent-dark);
}

button.secondary:hover {
  background: var(--accent-soft);
}

.form-message {
  min-height: 24px;
  font-weight: 750;
}

.form-message.success {
  color: var(--green);
}

.form-message.warning {
  color: #9a5c00;
}

@media (max-width: 900px) {
  .form-layout {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    min-height: auto;
  }

  .status-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .intro-panel {
    gap: 12px;
    margin-bottom: 12px;
  }

  .assessment-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-copy,
  .form-section,
  .submit-panel,
  .status-card {
    border-radius: 7px;
    box-shadow: none;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  .field-grid,
  .choice-grid,
  .choice-grid.compact {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }

  .intro-copy::after {
    display: none;
  }

  .section-heading h2::before {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 7px;
  }

  .action-row {
    display: grid;
  }

  button {
    width: 100%;
  }
}
