* { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #F3F5F9;
  color: #212121;
  -webkit-font-smoothing: antialiased;
}

.msi {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

/* Header banner */

.banner {
  width: 100%;
  margin-bottom: 20px;
  padding: 32px 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent-1) 30%, transparent);
  text-align: center;
}

.banner__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner__icon .msi { font-size: 32px; color: #fff; }

.banner__title {
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 6px;
}

.banner__subtitle { color: rgba(255, 255, 255, 0.7); font-size: 14px; margin: 0; }

.spinner {
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Card */

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

.card--center { text-align: center; padding: 28px; }

/* Form fields */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.field-input-wrap { position: relative; }

.field-input-wrap .msi {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #757575;
  font-size: 20px;
  pointer-events: none;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="url"],
.field input[type="date"],
.field input[type="time"],
.field select,
.field textarea {
  width: 100%;
  padding: 14px 12px;
  border: 1px solid #BDBDBD;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: #212121;
}

/* !important: must reliably beat the type-selector padding rule above
   (.field input[type="date"] etc.), which is more specific than a plain
   .field-input-wrap input selector and would otherwise always win,
   leaving the icon sitting on top of the input's text. */
.field-input-wrap input { padding-left: 40px !important; }

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-1, #1E88E5);
  border-width: 2px;
  padding: 13px 11px;
}

.field-input-wrap input:focus { padding-left: 39px !important; }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.field-hint { font-size: 12px; color: #9e9e9e; margin-top: 4px; }
.field-error { font-size: 12px; color: #d32f2f; margin-top: 4px; }
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #d32f2f; }

/* Checkbox / radio / multiselect / rating */

.choice-group {
  border: 1px solid #BDBDBD;
  border-radius: 4px;
  padding: 8px 12px;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
}

.choice-row input { width: 18px; height: 18px; accent-color: var(--accent-1, #1E88E5); flex-shrink: 0; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 0;
}

.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent-1, #1E88E5); flex-shrink: 0; }

.rating-row { display: flex; gap: 4px; border: 1px solid #BDBDBD; border-radius: 4px; padding: 10px 12px; }

.rating-star {
  background: none;
  border: none;
  font-size: 22px;
  color: #FFB300;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* Calendar date picker (dd/mm/yyyy display, independent of browser locale) */

.calendar-wrap { position: relative; }

.calendar-popover {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 12px;
  margin-top: 4px;
  width: 280px;
  display: none;
}

.calendar-popover.open { display: block; }

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.calendar-header button {
  background: none;
  border: none;
  cursor: pointer;
  color: #616161;
  padding: 6px;
  border-radius: 50%;
  display: flex;
}

.calendar-header button:hover { background: #F5F5F5; }
.calendar-header button .msi { font-size: 18px; }

.calendar-title { font-size: 14px; font-weight: 600; color: #212121; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  color: #9e9e9e;
  padding: 4px 0;
  font-weight: 600;
}

.calendar-day {
  text-align: center;
  font-size: 13px;
  padding: 8px 0;
  border-radius: 50%;
  cursor: pointer;
  color: #212121;
  background: none;
  border: none;
}

.calendar-day:hover:not(:disabled) { background: #E3F2FD; }
.calendar-day:disabled { color: #d0d0d0; cursor: not-allowed; text-decoration: line-through; }
.calendar-day.empty { visibility: hidden; }
.calendar-day.selected { background: var(--accent-1, #1E88E5); color: #fff; }
.calendar-day.today:not(.selected) { border: 1px solid var(--accent-1, #1E88E5); }

/* Event registration — AppBar + centered, optionally-backgrounded page */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  background: var(--accent-1, #1E88E5);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.appbar__title { color: #fff; font-size: 20px; font-weight: 500; }

.page-bg {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 24px 0;
}

/* Event registration */

.event-header-banner {
  padding: 16px;
  background: color-mix(in srgb, var(--accent-1, #1E88E5) 10%, white);
  border-radius: 12px;
  margin-bottom: 24px;
}

.event-header-banner__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.event-header-banner__title-row .msi { font-size: 28px; color: var(--accent-1, #1E88E5); }

.event-header-banner__title { font-size: 20px; font-weight: bold; color: var(--accent-1, #1E88E5); margin: 0; }

.event-header-banner__desc { font-size: 14px; color: #424242; margin: 0 0 10px; }

.event-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #616161;
  font-weight: 500;
  margin-top: 6px;
}

.event-meta-row .msi { font-size: 16px; color: #757575; flex-shrink: 0; }

.event-hosted-by {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #F5F5F5;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.event-hosted-by .msi { font-size: 20px; color: #616161; }
.event-hosted-by-label { font-size: 12px; color: #757575; }
.event-hosted-by-name { font-size: 14px; font-weight: bold; color: #424242; }

.event-price-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #43A047, #66BB6A);
  margin: 24px 0;
}

.event-price-banner__label { color: #fff; font-size: 18px; font-weight: 500; }
.event-price-banner__value { color: #fff; font-size: 24px; font-weight: bold; }

.section-title {
  font-size: 16px;
  font-weight: bold;
  color: #424242;
  margin: 0 0 12px;
}

.section-divider { border: none; border-top: 2px solid #eee; margin: 24px 0; }

/* Combobox (staff autocomplete) */

.combobox { position: relative; }

.combobox-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
  display: none;
  margin-top: 4px;
}

.combobox-options.open { display: block; }

.combobox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}

.combobox-option:hover { background: #F5F5F5; }
.combobox-option .msi { font-size: 16px; color: #757575; }
.combobox-option-sub { color: #9e9e9e; font-size: 12px; margin-left: auto; }

/* Notices */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}

.notice--error { background: #FFEBEE; color: #d32f2f; border: 1px solid #d32f2f; }
.notice--warning { background: rgba(255, 152, 0, 0.1); color: #E65100; }
.notice--info { background: #E3F2FD; color: #1976D2; border: 1px solid #90CAF9; }
.notice .msi { font-size: 18px; flex-shrink: 0; }

/* Buttons */

.btn-submit {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent-1, #1E88E5);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

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

.btn-outline {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--accent-1, #1E88E5);
  border-radius: 4px;
  background: transparent;
  color: var(--accent-1, #1E88E5);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

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

/* Confirmation state */

.confirm-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon .msi { font-size: 48px; color: #4CAF50; }

.confirm-title { font-size: 20px; font-weight: bold; margin: 0 0 10px; }
.confirm-detail { font-size: 15px; font-weight: 600; margin: 0; }
.confirm-sub { font-size: 14px; color: #616161; margin: 2px 0 0; }
.confirm-note { font-size: 13px; color: #757575; margin: 16px 0 0; line-height: 1.5; }

.footer-credit {
  text-align: center;
  font-size: 11px;
  color: #BDBDBD;
  margin: 24px 0 12px;
}
