/* version: 1.9.1 */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-border: #e3e5e8;
  --color-text: #1c1f24;
  --color-muted: #6b7280;
  --color-accent: #2f6feb;
  --color-danger: #d64545;
  --color-success: #1f9d55;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Browsers don't inherit font-family into form controls by default, so
   without this every button/input/select quietly falls back to the OS UI
   font instead of matching the rest of the page. */
button, input, select, textarea { font-family: inherit; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 20px 24px;
}

.site-header-inner {
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.25rem;
  font-weight: 600;
}

.app-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.loading, .empty-state {
  color: var(--color-muted);
  text-align: center;
  padding: 48px 0;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card .meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.workshop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--color-accent);
}

.badge.sold-out {
  background: #fdecec;
  color: var(--color-danger);
}

/* "Only N seats left" beside the title on the registration page. */
.badge.few-left {
  background: #fff4e5;
  color: #b45309;
  vertical-align: middle;
  margin-left: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: #fff;
  font-size: 1rem;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { background: #b9c4d6; cursor: not-allowed; }

.btn.secondary {
  background: var(--color-bg);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* Printing the confirmation page: just the confirmation itself on plain
   white paper - no buttons, notifications or screen-only chrome. */
@media print {
  .confirmation-actions, .toast-container { display: none !important; }
  body { background: #fff; }
  .site-header { padding: 0 0 12px; }
  .site-header-inner { max-width: none; margin: 0; }
  .app-main { max-width: none; padding: 16px 0 0; }
  .card { background: #fff; border: none; padding: 0; }
}

form { margin-top: 8px; }

.field {
  margin-bottom: 16px;
}

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

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}

.field.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field.checkbox label { margin: 0; font-weight: normal; }

.attendee-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
}

.attendee-block h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.price-line {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 16px 0;
}

/* Subtotal and tax rows above the total when a workshop is taxed. */
.price-summary { margin: 16px 0; }
.price-summary .price-line { margin: 8px 0 0; }
.price-sub-line { display: flex; justify-content: space-between; font-size: 0.95rem; margin: 4px 0; }
.price-sub-line.muted { color: var(--color-muted); }

/* Coupon: a "Have a coupon code?" link that opens a code box, and the
   applied code shown with a Remove link. */
.coupon-section { margin: 16px 0 0; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  text-transform: uppercase;
}
.coupon-row .btn { padding: 10px 16px; }
.coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #e8f6ee;
  color: var(--color-success);
  font-weight: 600;
  font-size: 0.95rem;
}
.coupon-note { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: #e8f6ee; color: var(--color-success); font-weight: 600; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
}
.coupon-applied .link-button { font-weight: normal; }
.price-sub-line.discount { color: var(--color-success); }

/* Two fields side by side (purchaser's first / last name), stacked on
   narrow screens. */
.form-row { display: flex; gap: 12px; }
.form-row > .field { flex: 1; min-width: 0; }
@media (max-width: 520px) { .form-row { flex-direction: column; gap: 0; } }

.workshop-detail p { white-space: pre-wrap; }
.workshop-detail a { color: var(--color-accent); }
.workshop-detail .location-line { margin: 16px 0 4px; }
.workshop-detail .instructions { margin: 0 0 4px; font-style: italic; }
.workshop-detail .detail-label { margin: 16px 0 4px; }
.workshop-detail .description { margin-top: 0; }

.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  background: var(--color-text);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--color-danger); }
.toast.success { background: var(--color-success); }