/* ── Custom properties ─────────────────────────────────────────────────────── */
:root {
  --color-primary:      #4A8DC5;
  --color-primary-dark: #3a72a0;
  --color-accent:       #e67e22;
  --color-success:      #27ae60;
  --color-error:        #c0392b;
  --color-error-bg:     #fdf2f2;
  --color-text:         #1c1c1c;
  --color-text-muted:   #555;
  --color-border:       #ccc;
  --color-bg:           #f4f6f9;
  --color-surface:      #ffffff;
  --color-full:         #95a5a6;
  --radius:             8px;
  --shadow:             0 2px 8px rgba(0, 0, 0, 0.1);
  --font:               -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width:          760px;
}

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

[hidden] { display: none !important; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  margin: 0 -1rem 2rem;
}

.site-header h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: -0.5px;
}

.site-header .subtitle {
  margin-top: 0.35rem;
  opacity: 0.85;
  font-size: 0.95rem;
}

.site-header-logo {
  display: block;
  height: 110px;
  width: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
}

/* ── Section headings ──────────────────────────────────────────────────────── */
h2 {
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
}

/* ── Category progress bars (inside header) ────────────────────────────────── */
.site-header .category-bars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
  text-align: left;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.cat-bar-row {
  opacity: 1;
}

.cat-bar-row.is-full {
  opacity: 0.6;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.cat-bar-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
}

.cat-bar-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

.spots-left {
  color: #a8e6c0;
  font-weight: 600;
}

.spots-full {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cat-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50px;
  transition: width 0.4s ease;
}

.cat-bar-fill--full {
  background: rgba(255, 255, 255, 0.4);
}

/* ── Error banner ──────────────────────────────────────────────────────────── */
.error-banner {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ── Form section ──────────────────────────────────────────────────────────── */
.registration-form-section {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
}

/* ── Fieldsets ─────────────────────────────────────────────────────────────── */
fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1rem;
  margin-bottom: 1.5rem;
}

legend {
  font-weight: 600;
  color: var(--color-primary);
  padding: 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Form groups ───────────────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

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

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.required {
  color: var(--color-error);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select {
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: var(--font);
  background: var(--color-surface);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  /* Safari adds an inset box-shadow on inputs by default */
  -webkit-box-shadow: none;
  box-shadow: none;
  /* Safari autofill background override */
  -webkit-text-fill-color: var(--color-text);
  color: var(--color-text);
}

.form-group select {
  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='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  -webkit-box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.15);
  box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.15);
}

/* Safari autofill styling override */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--color-surface) inset;
  -webkit-text-fill-color: var(--color-text);
  border-color: var(--color-border);
}

.form-group input[aria-invalid="true"],
.form-group select[aria-invalid="true"] {
  border-color: var(--color-error);
}

.field-error {
  font-size: 0.8rem;
  color: var(--color-error);
  margin-top: 0.3rem;
  min-height: 1.1em;
}

/* ── Two-column name row ───────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Checkbox ──────────────────────────────────────────────────────────────── */
.form-group--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.65rem;
}

.form-group--checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-group--checkbox label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ── Rules link ────────────────────────────────────────────────────────────── */
.rules-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--color-primary);
}

/* ── Price summary ─────────────────────────────────────────────────────────── */
.price-summary {
  background: #eaf4fb;
  border: 1px solid #aed6f1;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  text-align: center;
  color: var(--color-primary);
}

/* ── PayPal button container ───────────────────────────────────────────────── */
#paypal-button-container {
  margin-top: 1rem;
}

/* ── Processing message ────────────────────────────────────────────────────── */
.processing-message {
  text-align: center;
  padding: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

/* ── Success / Error page ──────────────────────────────────────────────────── */
.success-wrapper {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.success-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 480px;
  width: 100%;
}

.success-card h2 {
  border: none;
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--color-success);
}

.error-card h2 {
  color: var(--color-error);
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: var(--color-success);
  color: #fff;
  border-radius: 50%;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
}

.error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  background: var(--color-error);
  color: #fff;
  border-radius: 50%;
  font-size: 2rem;
  margin: 0 auto 1.25rem;
  font-weight: 700;
}

.success-card p {
  margin-bottom: 0.6rem;
  color: var(--color-text);
}

.transaction-id {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

.transaction-id code {
  background: #f0f0f0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.see-you {
  margin-top: 1rem;
  font-style: italic;
  color: var(--color-text-muted);
}

/* ── Button ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s, opacity 0.15s;
  border: none;
  width: 100%;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

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

.btn--paypal {
  background: #ffc439;
  color: #003087;
}

.btn--paypal:hover {
  background: #f0b429;
}

.btn--waitlist {
  background: var(--color-accent);
  color: #fff;
}

.btn--waitlist:hover {
  background: #cf6d17;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-primary);
}

.powered-by {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #bbb;
}

.powered-by strong {
  color: #999;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.notice {
  color: var(--color-text-muted);
  font-style: italic;
}
