:root {
  --ink: #1c1c1c;
  --paper: #f6f2e9;
  --bib-orange: #ff5a1f;
  --bib-orange-dark: #d7440f;
  --line: #ddd4bf;
  --muted: #736b5a;
  --success: #2f6b4f;
  --danger: #c62b2b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Archivo', sans-serif;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      115deg,
      #efe9db 0px, #efe9db 46px,
      #e8e1d0 46px, #e8e1d0 48px
    );
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- header ---------- */

.site-header {
  padding: 24px 24px 0;
}

.wordmark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  max-width: 460px;
  margin: 0 auto;
}
.wordmark span { color: var(--bib-orange-dark); }

/* ---------- hero / main ---------- */

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}

.hero {
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 38px;
  line-height: 1.05;
  margin: 18px 0 10px;
}

.hero .lede {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto 30px;
}

/* ---------- bib card (form) ---------- */

.bib {
  position: relative;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 34px 28px 28px;
}

.bib::before {
  content: "";
  position: absolute;
  top: -1px; left: 16px; right: 16px;
  height: 1px;
  border-top: 2px dashed #b9ae95;
}
.bib .holes {
  position: absolute;
  top: -7px; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
}
.bib .holes span {
  width: 10px; height: 10px;
  background: #efe9db;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

input[type="email"] {
  width: 100%;
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: #fffdf8;
}
input[type="email"]:focus {
  outline: 3px solid var(--bib-orange);
  outline-offset: 1px;
}

.field-block { margin-bottom: 22px; }

.province-picker { position: relative; }

#add-province-btn {
  width: 100%;
  text-align: left;
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 14px;
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink);
}
#add-province-btn:hover { background: #fff8ee; }
#add-province-btn:focus-visible { outline: 3px solid var(--bib-orange); outline-offset: 1px; }
#add-province-btn .plus { color: var(--bib-orange-dark); margin-right: 6px; font-weight: 700; }

.dropdown {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 4px 4px 0 rgba(28,28,28,0.12);
}
.dropdown[hidden] { display: none; }

.ca-group { border-bottom: 1px solid var(--line); }
.ca-group:last-child { border-bottom: none; }

.ca-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font-family: 'Archivo', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--ink);
}
.ca-header:hover { background: #f3ecdd; }
.ca-header .chev {
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 11px;
}
.ca-header[aria-expanded="true"] .chev { transform: rotate(90deg); }

.ca-provinces { display: none; padding: 2px 0 6px; }
.ca-provinces.open { display: block; }

.province-option {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: 'Archivo', sans-serif;
  font-size: 14px;
  padding: 8px 14px 8px 26px;
  cursor: pointer;
  color: var(--ink);
}
.province-option:hover { background: #fdeee4; color: var(--bib-orange-dark); }

.empty-note {
  padding: 14px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  min-height: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 14px;
  border: 2px solid var(--bib-orange);
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
}
.chip button {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--danger);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chip button:hover { background: #fbe4e4; }

.submit-btn {
  width: 100%;
  margin-top: 30px;
  padding: 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  background: var(--bib-orange);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
}
.submit-btn:hover { background: var(--bib-orange-dark); }
.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.form-error.show { display: block; }

.success-view { display: none; text-align: center; padding: 20px 4px 6px; }
.success-view.show { display: block; }
.success-view .bignum {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 40px;
  color: var(--success);
  margin: 0 0 8px;
}
.success-view p { color: var(--muted); font-size: 14.5px; line-height: 1.5; margin: 0; }

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 18px 16px 26px;
  font-size: 12.5px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .ca-header .chev { transition: none; }
}
