/* Indiana Motorsports Coalition membership — colors sampled from the IMC logo. */
:root {
  --navy: #17234b;
  --navy-deep: #0f1835;
  --red: #cf2a30;
  --red-dark: #a81f25;
  --gold: #f0ad1c;
  --ground: #eef1f6;
  --surface: #ffffff;
  --ink: #141c36;
  --muted: #59627c;
  --line: #cdd3e0;
  --focus: #f0ad1c;
  --ok: #1d7a46;
  --warn: #a35f00;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", sans-serif;
  --radius: 6px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
}

a {
  color: var(--navy);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Registration: navy brand panel beside the form ---------- */

.register {
  display: grid;
  grid-template-columns: minmax(300px, 38fr) 62fr;
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  background: var(--navy);
  color: #fff;
  padding-right: 46px; /* room for the checkered strip */
}

.brand-panel-inner {
  padding: clamp(32px, 6vh, 72px) clamp(24px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-logo {
  width: min(320px, 100%);
  height: auto;
  filter: drop-shadow(0 10px 24px rgb(0 0 0 / 0.35));
}

.brand-statement {
  margin: 0;
  max-width: 14ch;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 0.98;
}

.brand-lede {
  margin: -8px 0 0;
  max-width: 38ch;
  line-height: 1.5;
  color: #dfe4f2;
}

.benefits {
  border-left: 4px solid var(--gold);
  padding: 2px 0 2px 18px;
}

.benefits h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1;
}

.benefits ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #dfe4f2;
  font-size: 0.98rem;
}

.benefits li {
  max-width: 36ch;
}

.benefits li + li {
  margin-top: 8px;
}

/* Checkered flag running the full height of the panel, edged with the logo's red rule. */
.checker {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: conic-gradient(#fff 25%, var(--navy-deep) 0 50%, #fff 0 75%, var(--navy-deep) 0) 0 0 / 40px 40px;
  border-left: 6px solid var(--red);
}

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

.form-column {
  padding: clamp(32px, 6vh, 72px) clamp(20px, 5vw, 72px) 80px;
  max-width: 820px;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(2.75rem, 5vw, 4rem);
  line-height: 0.95;
  color: var(--navy);
}

.intro {
  margin: 14px 0 32px;
  max-width: 56ch;
  color: var(--muted);
}

.notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--navy);
  background: var(--surface);
}

.notice-error {
  border-left-color: var(--red);
  color: var(--red-dark);
}

fieldset {
  margin: 0 0 20px;
  padding: 24px clamp(16px, 3vw, 28px) 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

legend {
  padding: 0 8px;
  margin-left: -8px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--navy);
}

.fieldset-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}

.grid-address {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  column-gap: 16px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

input:hover,
select:hover {
  border-color: #9aa4bd;
}

input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 0;
  border-color: var(--navy);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--red);
  background: #fff7f7;
}

.field-error {
  margin: 6px 0 0;
  color: var(--red-dark);
  font-size: 0.9rem;
  font-weight: 500;
}

fieldset > .field-error {
  margin: 0 0 12px;
}

/* ---------- Involvement choices ---------- */

.affiliations {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.aff {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.aff:has(input[type="checkbox"]:checked) {
  border-color: var(--navy);
  box-shadow: inset 5px 0 0 var(--navy);
  background: #fff;
}

.aff-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  align-items: baseline;
  padding: 14px 18px 14px 20px;
  cursor: pointer;
}

.aff-toggle input {
  grid-row: span 2;
  align-self: center;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--navy);
}

.aff-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--navy);
}

.aff-hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.aff-fields {
  display: none;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  padding: 0 18px 2px 56px;
}

.aff:has(input[type="checkbox"]:checked) .aff-fields {
  display: grid;
}

/* ---------- Membership level ---------- */

.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.level {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  cursor: pointer;
}

.level input {
  width: 20px;
  height: 20px;
  margin: 0 0 6px;
  accent-color: var(--navy);
}

.level:has(input:checked) {
  border-color: var(--navy);
  box-shadow: inset 0 5px 0 var(--navy);
  background: #fff;
}

.level-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--navy);
}

.level-price {
  font-weight: 600;
}

.level-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Contribution ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.chip {
  position: relative;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
}

.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
}

.chip input:checked + span {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.contribution-other {
  display: none;
  max-width: 260px;
}

fieldset:has(input[value="other"]:checked) .contribution-other {
  display: block;
}

/* ---------- Directory consent ---------- */

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px clamp(16px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}

.consent input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--navy);
}

.consent-hint {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Submit ---------- */

.submit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 28px;
}

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

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: var(--red);
  border: 0;
  box-shadow: 0 3px 0 var(--red-dark);
}

.button-primary:hover {
  background: var(--red-dark);
}

.button-primary:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--red-dark);
}

.button-secondary {
  min-height: 42px;
  padding: 0 18px;
  font-size: 1.1rem;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
}

.button-secondary:hover {
  border-color: var(--navy);
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Welcome ---------- */

body.centered {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(var(--red), var(--red)) top / 100% 6px no-repeat,
    var(--ground);
}

.welcome {
  max-width: 560px;
  text-align: center;
}

.welcome-logo {
  width: 160px;
  height: auto;
  margin-bottom: 16px;
}

.welcome p {
  margin: 16px auto 0;
  max-width: 48ch;
}

.welcome-manage {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Demo mode ---------- */

.demo-banner {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-deep);
  background: var(--gold);
}

body.centered.has-demo-banner {
  padding-top: 0;
  grid-template-rows: auto 1fr;
  place-items: initial;
}

body.centered.has-demo-banner > main {
  place-self: center;
  margin: 24px 0;
}

.demo-checkout {
  width: min(480px, 100%);
  text-align: center;
}

.demo-checkout > p {
  margin: 12px auto 0;
  max-width: 44ch;
}

.demo-summary {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.demo-summary th,
.demo-summary td {
  padding: 12px 16px;
  border-bottom: 1px solid #e6e9f0;
}

.demo-summary th {
  font-weight: 500;
}

.demo-summary td {
  text-align: right;
  white-space: nowrap;
}

.demo-summary tfoot th,
.demo-summary tfoot td {
  font-weight: 700;
  border-bottom: 0;
}

.demo-receipt {
  color: var(--muted);
  font-size: 0.95rem;
}

.demo-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.demo-actions .button-secondary {
  min-height: 48px;
}

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

.admin-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px clamp(16px, 3vw, 32px);
  background: var(--navy);
  border-bottom: 4px solid var(--red);
}

.admin-title {
  margin: 0 auto 0 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.8rem;
  color: #fff;
}

.admin {
  padding: 24px clamp(16px, 3vw, 32px) 64px;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-filters input {
  flex: 1 1 280px;
  max-width: 420px;
}

.admin-filters select {
  width: auto;
}

.admin-empty {
  padding: 48px 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table.members {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.members th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  background: #f6f8fb;
  border-bottom: 1px solid var(--line);
}

.members td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid #e6e9f0;
}

.members tbody tr:last-child td {
  border-bottom: 0;
}

.nowrap {
  white-space: nowrap;
}

.member-name {
  display: block;
  font-weight: 600;
}

.member-email {
  display: block;
  color: var(--muted);
}

.attention {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--red-dark);
  background: #fdeced;
}

.aff-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aff-list li + li {
  margin-top: 4px;
}

.aff-tag {
  display: inline-block;
  min-width: 52px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--navy);
  background: #e4e8f2;
}

.aff-role {
  color: var(--muted);
}

.level-note {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.standing {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.standing-current {
  color: var(--ok);
  background: #e3f4ea;
}

.standing-grace {
  color: var(--warn);
  background: #fdf1dc;
}

.standing-pending {
  color: var(--muted);
  background: #eceff5;
}

.standing-lapsed {
  color: var(--red-dark);
  background: #fdeced;
}

.stripe-link {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Small screens: brand panel becomes a header band ---------- */

@media (max-width: 860px) {
  .register {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    padding-right: 0;
    padding-bottom: 30px;
  }

  .brand-panel-inner {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding: 24px 20px;
  }

  .brand-logo {
    width: 120px;
  }

  .brand-statement {
    flex: 1 1 200px;
    max-width: none;
  }

  .brand-lede,
  .benefits {
    flex-basis: 100%;
    margin: 0;
    max-width: none;
  }

  .levels {
    grid-template-columns: 1fr;
  }

  .checker {
    top: auto;
    left: 0;
    width: auto;
    height: 30px;
    background-size: 30px 30px;
    border-left: 0;
    border-top: 6px solid var(--red);
  }
}

@media (max-width: 560px) {
  .grid-2,
  .grid-address,
  .aff-fields {
    grid-template-columns: 1fr;
  }

  .aff-fields {
    padding-left: 20px;
  }

  .button-primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button-primary:active {
    transform: none;
  }
}
