/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --primary:       #005659;
  --primary-light: #007a7e;
  --primary-dark:  #003c40;
  --accent:        #a0c45c;
  --accent-dark:   #82a048;
  --bg:            #eef4f4;
  --card:          #ffffff;
  --border:        #cddede;
  --border-focus:  #005659;
  --text:          #1b2c2e;
  --muted:         #4d6a6e;
  --error:         #c62828;
  --error-bg:      #fff0f0;
  --success:       #2a7c36;
  --success-bg:    #f0faf2;
  --warning:       #b05000;
  --warning-bg:    #fff8f0;
  --shadow-sm:     0 1px 3px rgba(0,86,89,.08), 0 1px 2px rgba(0,86,89,.04);
  --shadow-md:     0 4px 12px rgba(0,86,89,.1),  0 2px 4px rgba(0,86,89,.06);
  --shadow-lg:     0 8px 24px rgba(0,86,89,.12), 0 4px 8px rgba(0,86,89,.06);
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     16px;
  --transition:    0.18s ease;
}

/* Ensure [hidden] always wins regardless of author display rules */
[hidden] { display: none !important; }

/* ── Reset + Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.mt-lg { margin-top: 28px; }

/* ── Site header ───────────────────────────────────────────────────────────── */
.site-header {
  background: #1a1a2e;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
}

.site-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,.15);
  padding: 3px;
}

/* ── Edition hero ──────────────────────────────────────────────────────────── */
.edition-hero {
  background: linear-gradient(135deg, #0d0d1f 0%, #1a1a2e 55%, #252550 100%);
  color: #ffffff;
  padding: 40px 0 36px;
  position: relative;
  overflow: hidden;
}

.edition-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.edition-event-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 6px;
}

.edition-name {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin-bottom: 14px;
}

.edition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.edition-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  opacity: .85;
  font-weight: 500;
}

.edition-results-link,
.edition-results-soon {
  display: inline-block;
  border-radius: 14px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 1 !important;
}
.edition-results-link {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff !important;
  text-decoration: none !important;
  transition: background .15s;
}
.edition-results-link:hover { background: rgba(255,255,255,.22); }
.edition-results-soon {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.65) !important;
  cursor: default;
}

/* ── Stepper ───────────────────────────────────────────────────────────────── */
.stepper {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 56px;
  z-index: 90;
}

.stepper-inner {
  display: flex;
  align-items: center;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper-inner::-webkit-scrollbar { display: none; }

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: default;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: color var(--transition);
}

.step.active {
  color: var(--primary);
}

.step.done {
  color: var(--success);
  cursor: pointer;
}
.step.done:hover { text-decoration: underline; }

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--border);
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.step.active .step-num {
  background: var(--primary);
  color: #fff;
}

.step.done .step-num {
  background: var(--success);
  color: #fff;
}

.step-connector {
  flex: 1;
  min-width: 20px;
  height: 1px;
  background: var(--border);
}

/* ── Screen layout ─────────────────────────────────────────────────────────── */
.screen-wrap {
  padding: 32px 0 60px;
  min-height: calc(100vh - 200px);
}

.center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 16px;
  gap: 12px;
}

.section-header {
  margin-bottom: 28px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--muted);
  font-size: 14px;
}

/* ── Loading / Error screens ───────────────────────────────────────────────── */
.spinner-lg {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--muted);
  font-size: 15px;
}

.error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--error-bg);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}

/* ── Race cards ────────────────────────────────────────────────────────────── */
.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.race-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.race-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.race-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.race-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.3;
}

.race-status-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}

.race-status-open    { background: #e6f7e8; color: var(--success); }
.race-status-soon    { background: #f0f0f0; color: #666; }
.race-status-full    { background: #fde8e8; color: var(--error); }
.race-status-closed  { background: #f5f5f5; color: #888; }

.race-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.race-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.race-meta-icon { opacity: .7; }

.race-card-tier {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.race-tier-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.race-tier-name {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.race-tier-desc {
  font-size: 12px;
  color: var(--muted);
  opacity: .75;
}

.race-tier-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.02em;
}

.race-tier-price .currency { font-size: 15px; font-weight: 600; }

/* ── Multi-tier option selector ─────────────────────────────────────────── */
.race-card-body { display: flex; flex-direction: column; gap: 10px; }

.race-tiers-list {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.race-tier-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  transition: background 0.12s;
}
.race-tier-option:last-child { border-bottom: none; }
.race-tier-option:hover { background: #f5fbfb; }

.race-tier-option-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.race-tier-option-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.race-tier-option-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Single tier (existing) ─────────────────────────────────────────────── */
.race-tier-soon {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  width: 100%;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-accent {
  background: var(--accent);
  color: #1b2c2e;
  border-color: var(--accent);
}
.btn-accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: rgba(0,86,89,.06); }

.btn-lg  { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-xl  { padding: 16px 36px; font-size: 16px; border-radius: var(--radius-lg); width: 100%; max-width: 400px; }
.btn-full { width: 100%; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  transition: color var(--transition);
}
.btn-back:hover { color: var(--primary); }

/* ── Cart bar ──────────────────────────────────────────────────────────────── */
.cart-bar {
  position: sticky;
  bottom: 16px;
  background: var(--primary-dark);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  margin-top: 16px;
}

.cart-bar-count {
  font-weight: 600;
  font-size: 15px;
}

.cart-bar-total {
  font-size: 20px;
  font-weight: 700;
  margin-left: 12px;
}

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}

/* ── Form card ─────────────────────────────────────────────────────────────── */
.form-cart-items {
  margin-bottom: 20px;
}

.form-cart-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.form-cart-item-info { flex: 1; min-width: 0; }
.form-cart-item-name { font-weight: 600; font-size: 14px; }
.form-cart-item-meta { font-size: 12px; color: var(--muted); }
.form-cart-item-price { font-weight: 700; color: var(--primary); font-size: 15px; white-space: nowrap; }
.form-cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color var(--transition), background var(--transition);
}
.form-cart-item-remove:hover { color: var(--error); background: var(--error-bg); }

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.form-card-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-card-header .btn-back { color: rgba(255,255,255,.7); }
.form-card-header .btn-back:hover { color: #fff; }

.form-race-info {
  color: #ffffff;
}

.form-race-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}

.form-race-tier {
  font-size: 13px;
  opacity: .8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-race-price {
  font-size: 22px;
  font-weight: 700;
}

/* ── Age warning ───────────────────────────────────────────────────────────── */
.form-age-warning {
  margin: 0 24px 0;
  padding: 10px 14px;
  border: 1px solid #fde68a;
  border-left: 3px solid #d97706;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 13.5px;
  line-height: 1.5;
}

/* ── Tier age badge ─────────────────────────────────────────────────────────── */
.race-tier-age {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Form sections ─────────────────────────────────────────────────────────── */
.form-section {
  padding: 24px 24px 0;
}

.form-section:last-of-type { padding-bottom: 0; }

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-section-note {
  font-size: 13px;
  color: var(--warning);
  background: var(--warning-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
}

/* ── Consent section ────────────────────────────────────────────────────────── */
.consent-section {
  background: #f8f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: 24px 24px 0;
  padding: 20px 20px 4px !important;
}

.consent-notice {
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
  margin: 0 0 14px;
}

.consent-notice a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.consent-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.consent-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13.5px;
  color: #374151;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.consent-check-label:last-child {
  border-bottom: none;
}

.consent-check-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.consent-check-label a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Field groups ──────────────────────────────────────────────────────────── */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.field-group:last-child { margin-bottom: 0; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

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

.required-mark { color: var(--error); margin-left: 2px; }

.field-input {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,86,89,.1);
}

.field-input.valid {
  border-color: var(--success);
}

.field-input.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.field-input.confirm-field {
  background: #f6fafa;
  border-style: dashed;
}
.field-input.confirm-field:focus {
  border-style: solid;
  background: #fff;
}

.field-input[type="date"] { cursor: pointer; }

select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234d6a6e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

textarea.field-input {
  resize: vertical;
  min-height: 80px;
}

.field-error {
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
  min-height: 16px;
  display: block;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 400;
  font-size: 14px;
}

.radio-group {
  display: flex;
  gap: 24px;
  margin-top: 6px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Club picker ───────────────────────────────────────────────────────────── */

.club-search-box {
  position: relative;
}

.club-search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234d6a6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  padding-left: 36px;
}

.club-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1.5px solid var(--border-focus);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 86, 89, 0.14);
  list-style: none;
  padding: 5px;
  margin: 0;
  z-index: 200;
  max-height: 228px;
  overflow-y: auto;
}

.club-dropdown-item {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background 0.1s, color 0.1s;
  outline: none;
}

.club-dropdown-item:hover,
.club-dropdown-item:focus {
  background: #eef4f4;
  color: var(--primary);
}

.club-dropdown-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.club-selected-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: #f0f9f9;
}

.club-selected-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-selected-name::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.club-clear-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 3px 6px;
  border-radius: 5px;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.club-clear-btn:hover {
  background: #ffeaea;
  color: var(--error);
}

.club-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.club-option-row {
  font-size: 13px;
  color: var(--muted);
}

/* ── Pass code section ─────────────────────────────────────────────────────── */
.pass-section {
  margin-top: 24px;
}

.pass-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.pass-toggle:hover { color: var(--primary); }

.pass-expand {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pass-input-row {
  display: flex;
  gap: 8px;
}

.pass-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: border-color 0.15s;
}

.pass-input:focus {
  outline: none;
  border-color: var(--primary);
}

.pass-feedback {
  font-size: 13px;
  margin-top: 8px;
}

.pass-feedback.pass-error { color: var(--error); }
.pass-feedback.pass-success { color: var(--success); }

/* ── Merchandise section ───────────────────────────────────────────────────── */
.merch-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
  transition: border-color var(--transition);
}

.merch-item.selected { border-color: var(--primary); }
.merch-item.required { border-color: var(--accent-dark); }

.merch-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.merch-item-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.merch-item-info { flex: 1; }

.merch-item-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.merch-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 999px;
}

.merch-badge-required { background: #fff3e0; color: #bf6000; }
.merch-badge-optional { background: #e8f4fd; color: #1565c0; }

.merch-item-description { font-size: 12px; color: var(--muted); margin-top: 2px; }

.merch-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.merch-item-price.free { color: var(--success); }

.merch-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.merch-option-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.merch-option-btn:hover { border-color: var(--primary); color: var(--primary); }
.merch-option-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; }

.merch-options-error {
  font-size: 12px;
  color: var(--error);
  width: 100%;
  margin-top: 4px;
}

.merch-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.merch-stepper-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: border-color .15s, background .15s;
}

.merch-stepper-btn:hover { border-color: var(--primary); color: var(--primary); }

.merch-stepper-count {
  min-width: 24px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.cr-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.55);
  padding: 52px 0 0;
  font-size: 14px;
  line-height: 1.6;
}
.cr-footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 24px 44px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.7fr;
  gap: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cr-footer-heading {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: #fff; margin: 0 0 18px;
}
.cr-footer-heading span { color: #a5b4fc; }
.cr-footer-col p { margin: 0; font-size: 13px; line-height: 1.75; color: rgba(255,255,255,.5); }
.cr-footer-nav { display: flex; flex-direction: column; gap: 9px; }
.cr-footer-nav a { color: rgba(255,255,255,.55); text-decoration: none; font-size: 13px; transition: color .15s; }
.cr-footer-nav a:hover { color: #fff; }
.cr-footer-social { display: flex; gap: 10px; margin-top: 4px; }
.cr-footer-social-link {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.cr-footer-social-link:hover { background: rgba(255,255,255,.16); color: #fff; }
.cr-footer-bottom {
  max-width: 1080px; margin: 0 auto;
  padding: 16px 24px;
  font-size: 12px; color: rgba(255,255,255,.3);
}

/* ── Codes section ─────────────────────────────────────────────────────────── */
.codes-section { padding: 20px 24px; }

.code-input-group { margin-bottom: 16px; }

.code-input-row {
  display: flex;
  gap: 8px;
  margin-top: 5px;
}

.code-input { flex: 1; text-transform: uppercase; letter-spacing: .05em; }

.code-feedback {
  font-size: 13px;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.code-feedback.success { background: var(--success-bg); color: var(--success); }
.code-feedback.error   { background: var(--error-bg);   color: var(--error);   }

/* ── Form price bar ────────────────────────────────────────────────────────── */
.form-price-bar {
  margin: 20px 24px 0;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-price-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.form-price-total {
  text-align: right;
  white-space: nowrap;
}

.price-total-label { font-size: 12px; color: var(--muted); }
.price-total-amount { font-size: 26px; font-weight: 700; color: var(--primary); letter-spacing: -.03em; }

/* ── Form actions ──────────────────────────────────────────────────────────── */
.form-actions {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-cart-hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ── Pre-fill banner ───────────────────────────────────────────────────────── */
.prefill-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #a8d9af;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.prefill-banner svg { flex-shrink: 0; }
.prefill-banner span { flex: 1; }

.prefill-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--success);
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  opacity: .7;
  transition: opacity var(--transition);
}
.prefill-dismiss:hover { opacity: 1; }

/* ── Summary screen ────────────────────────────────────────────────────────── */
.summary-registrations {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.summary-reg-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.summary-reg-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-reg-person {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.summary-reg-race {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.summary-category {
  color: var(--primary);
  font-weight: 600;
}

.summary-reg-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.summary-reg-breakdown {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
}

.breakdown-discount { color: var(--success); }

.summary-reg-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  text-decoration: underline;
  padding: 0;
  margin-top: 10px;
  transition: color var(--transition);
}
.summary-reg-remove:hover { color: var(--error); }

.summary-contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.summary-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary);
  margin-bottom: 14px;
}

.summary-totals {
  background: var(--primary-dark);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 24px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  margin-bottom: 8px;
}

.totals-row:last-child { margin-bottom: 0; }

.totals-row.grand-total {
  font-size: 22px;
  font-weight: 700;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.2);
}

.totals-label { opacity: .85; }
.totals-discount { color: var(--accent); }

.summary-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pay-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Confirmation screen ───────────────────────────────────────────────────── */
.confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  border: 2px solid #a8d9af;
}

.confirm-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}

.confirm-subtitle {
  color: var(--muted);
  max-width: 400px;
}

.confirm-details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  width: 100%;
  max-width: 480px;
  text-align: left;
  margin-top: 8px;
}

.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.confirm-detail-row:last-child { border-bottom: none; }
.confirm-detail-label { color: var(--muted); }
.confirm-detail-value { font-weight: 600; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1b2c2e;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  border: none;
  inset: unset;
  margin: 0;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast:popover-open {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.toast.toast-success { background: var(--success); }
.toast.toast-error   { background: var(--error); }

/* ── Mi inscripción (página de detalle) ────────────────────────────────────── */
.reg-detail-page {
  padding: 32px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Status banner */
.reg-status-banner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
}

.reg-status-banner.status-confirmed {
  background: var(--success-bg);
  border-color: #bbf0c8;
}
.reg-status-banner.status-pending {
  background: var(--warning-bg);
  border-color: #fcd5a0;
}
.reg-status-banner.status-cancelled {
  background: var(--error-bg);
  border-color: #fecaca;
}

.reg-status-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.reg-status-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
}
.status-confirmed .reg-status-title { color: var(--success); }
.status-pending   .reg-status-title { color: var(--warning); }
.status-cancelled .reg-status-title { color: var(--error);   }

.reg-status-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Detail cards */
.reg-detail-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.reg-detail-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.reg-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.reg-detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.reg-detail-field:nth-child(2n) { border-right: none; }
.reg-detail-field:nth-last-child(-n+2) { border-bottom: none; }
.reg-detail-field:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  border-right: none;
}

.reg-detail-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.reg-detail-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

/* Merchandise in detail page */
.reg-merch-list {
  padding: 8px 0;
}
.reg-merch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.reg-merch-item:last-child { border-bottom: none; }
.reg-merch-name  { flex: 1; color: var(--text); }
.reg-merch-name em { color: var(--muted); font-style: normal; }
.reg-merch-qty   { font-weight: 600; color: var(--muted); min-width: 28px; text-align: center; }
.reg-merch-price { font-weight: 600; color: var(--primary); min-width: 72px; text-align: right; }

/* Actions row */
.reg-detail-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 16px;
}

.reg-pay-card {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.reg-pay-expiry {
  font-size: 14px;
  color: #92400e;
  margin: 0;
}
.reg-pay-error {
  font-size: 13px;
  color: #dc2626;
  margin-top: 8px;
  width: 100%;
}
@media (max-width: 540px) {
  .reg-pay-card { flex-direction: column; align-items: stretch; }
  .reg-pay-card .btn { text-align: center; }
}

/* ── Club widget (edit dialog) ─────────────────────────────────────────────── */
.club-search-box { position: relative; }

.club-search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  padding-left: 36px;
}

.club-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0; right: 0;
  background: var(--card);
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  padding: 5px; margin: 0;
  z-index: 300;
  max-height: 200px;
  overflow-y: auto;
}

.club-dropdown-item {
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background .1s, color .1s;
  outline: none;
}
.club-dropdown-item:hover,
.club-dropdown-item:focus { background: rgba(0,86,89,.08); color: var(--primary); }

.club-dropdown-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.club-selected-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  background: rgba(0,86,89,.06);
  margin-top: 6px;
}

.club-selected-name {
  flex: 1; min-width: 0;
  font-size: 14px; font-weight: 500;
  color: var(--primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.club-selected-name::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 8px;
  vertical-align: middle;
  position: relative; top: -1px;
}

.club-clear-btn {
  flex-shrink: 0;
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 3px 6px;
  border-radius: 5px; line-height: 1;
  transition: background .12s, color .12s;
}
.club-clear-btn:hover { background: #fef2f2; color: var(--error); }

.club-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.club-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

/* ── Edit dialog ───────────────────────────────────────────────────────────── */
.edit-dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  padding: 0;
  width: min(600px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: hidden;
}

.edit-dialog[open] {
  display: flex;
  flex-direction: column;
}

.edit-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.edit-dialog::backdrop {
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}

.edit-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.edit-dialog-title { font-size: 18px; font-weight: 700; }

.edit-dialog-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.edit-dialog-close:hover { background: var(--bg); color: var(--text); }

.edit-dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.edit-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.edit-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

/* Print styles */
@media print {
  .site-header,
  .reg-detail-actions { display: none !important; }
  .edition-hero { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .reg-detail-page { padding: 16px 0; gap: 12px; }
  .reg-detail-card { box-shadow: none; border: 1px solid #ccc; }
  .reg-status-banner { border: 1px solid #ccc !important; }
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .form-card-header { padding: 16px; }
  .form-section     { padding: 16px 16px 0; }
  .codes-section    { padding: 16px; }
  .form-price-bar   { margin: 16px 16px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  .form-actions     { padding: 16px; }
  .summary-reg-card,
  .summary-contact-card,
  .summary-totals   { padding: 16px 16px; }
  .cart-bar         { flex-direction: column; gap: 10px; align-items: stretch; }
  .cart-bar .btn    { width: 100%; justify-content: center; }

  .reg-detail-grid  { grid-template-columns: 1fr; }
  .edit-grid        { grid-template-columns: 1fr; }
  .reg-detail-field { border-right: none !important; }
  .reg-detail-field:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .reg-detail-field:last-child { border-bottom: none !important; }
  .reg-status-banner { flex-direction: column; gap: 10px; }
  .cr-footer-inner { grid-template-columns: 1fr; gap: 32px; }
}
