/* ============================================================
   components.css — registration sandbox building blocks
   Form, button, table, status pills, auth overlay, header.
   ============================================================ */

/* ── Wave / glow (decorative for dark hero) ─────── */
.wave-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 38px,
    var(--teal-500) 38px,
    var(--teal-500) 40px
  );
}
.glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(10, 173, 168, 0.12) 0%, transparent 70%);
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  cursor: pointer;
  transition: var(--transition-default);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: scale(0.97); transition-duration: 100ms; }

.btn--primary { background: var(--color-interactive-bg); color: var(--color-fg-inverse); }
.btn--primary:hover { background: var(--color-interactive-bg-hover); color: var(--color-fg-inverse); }

.btn--secondary { background: var(--color-interactive-secondary); color: var(--color-fg-inverse); }
.btn--secondary:hover { background: var(--color-interactive-secondary-hover); color: var(--color-fg-inverse); }

.btn--outline {
  background: transparent;
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}
.btn--outline:hover { background: var(--teal-50); color: var(--teal-600); border-color: var(--teal-600); }

.btn--danger { background: #dc2626; color: var(--white); }
.btn--danger:hover { background: #b91c1c; color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--color-fg-secondary);
}
.btn--ghost:hover { background: var(--slate-100); color: var(--navy-900); }

.btn--sm { padding: 7px 14px; font-size: var(--text-sm); border-radius: var(--radius-sm); }
.btn--lg { padding: 16px 32px; font-size: var(--text-md); border-radius: var(--radius-lg); }
.btn--block { width: 100%; }

.btn[disabled], .btn--disabled {
  background: var(--slate-200);
  color: var(--slate-400);
  cursor: not-allowed;
  pointer-events: none;
  border-color: transparent;
}

/* Spinner inside a button */
.btn__spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header / nav ────────────────────────────────── */
.site-header {
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--color-border-default);
  box-shadow: var(--shadow-1);
}
.site-header__inner {
  max-width: 1100px;
  margin-inline: auto;
  padding: var(--space-4) var(--space-12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.site-header__back {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  text-decoration: none;
}
.site-header__back:hover { color: var(--color-fg-accent); }
@media (max-width: 600px) {
  .site-header__inner { padding: var(--space-3) var(--space-6); }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}
.logo__bars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.logo__bars span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--teal-500);
}
.logo__bars span:nth-child(1) { height: 12px; }
.logo__bars span:nth-child(2) { height: 20px; }
.logo__bars span:nth-child(3) { height: 26px; }
.logo__bars span:nth-child(4) { height: 20px; }
.logo__bars span:nth-child(5) { height: 12px; }
.logo__word {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--navy-900);
}

/* ── Event hero (registration page top) ───────────── */
.event-hero {
  background: var(--color-bg-dark);
  color: var(--color-fg-inverse);
  padding: var(--space-16) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}
.event-hero__inner { position: relative; z-index: 1; }

.event-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(10, 173, 168, 0.13);
  border: 1px solid rgba(10, 173, 168, 0.3);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  margin-bottom: var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--teal-300);
  letter-spacing: var(--tracking-wide);
}
.event-hero__badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-400); }

.event-hero__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: var(--font-weight-bold);
  color: var(--white);
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  max-width: 720px;
  margin-bottom: var(--space-6);
}
.event-hero__venue {
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  color: var(--white);
  margin-bottom: var(--space-1);
}
.event-hero__address {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  max-width: 560px;
}

/* ── Form ────────────────────────────────────────── */
.form {
  max-width: 640px;
  margin-inline: auto;
  display: grid;
  gap: var(--space-6);
}

.form-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  box-shadow: var(--shadow-2);
}
@media (max-width: 600px) {
  .form-card { padding: var(--space-8) var(--space-6); }
}

.form-field {
  display: grid;
  gap: var(--space-2);
}
.form-field--optional .form-label::after {
  content: ' (opsiyonel)';
  color: var(--color-fg-muted);
  font-weight: var(--font-weight-regular);
}

.form-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
  letter-spacing: var(--tracking-wide);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--navy-900);
  background: var(--color-bg-surface);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  transition: border-color var(--duration-base) var(--ease-default),
              box-shadow var(--duration-base) var(--ease-default);
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-fg-muted); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(10, 173, 168, 0.15);
}

/* Select chevron */
.form-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px 18px;
  padding-right: 40px;
}
.form-select:invalid,
.form-select option[value=""] { color: var(--color-fg-muted); }
.form-select option { color: var(--navy-900); }

.form-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.form-helper {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-fg-secondary);
}
.form-error {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: #dc2626;
  display: none;
}
.form-field.is-invalid .form-input,
.form-field.is-invalid .form-select,
.form-field.is-invalid .form-textarea {
  border-color: #dc2626;
}
.form-field.is-invalid .form-error { display: block; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: flex-end;
}

.form-status-banner {
  display: none;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.form-status-banner.is-active { display: block; }
.form-status-banner--error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

/* ── Success card (post-submit) ──────────────────── */
.success-card {
  display: none;
  background: var(--color-bg-surface);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-xl);
  padding: var(--space-12);
  box-shadow: var(--shadow-3);
  max-width: 640px;
  margin-inline: auto;
  text-align: left;
}
.success-card.is-active { display: block; }

.success-card__icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--teal-50);
  color: var(--teal-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.success-card__icon svg { width: 28px; height: 28px; }
.success-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
  margin-bottom: var(--space-3);
  letter-spacing: var(--tracking-tight);
}
.success-card p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-fg-secondary);
  line-height: 1.65;
  margin-bottom: var(--space-3);
}
.success-card p:last-child { margin-bottom: 0; }

/* ── Status pills (admin) ────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}
.status-pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.status-pill--pending   { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-100); }
.status-pill--confirmed { background: #dcfce7;        color: #15803d;          border: 1px solid #bbf7d0; }
.status-pill--expired   { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }
.status-pill--cancelled { background: #fee2e2;        color: #b91c1c;          border: 1px solid #fecaca; }

/* ── Site header actions (user badge + signout) ──── */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.user-badge__email {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--slate-700);
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .user-badge__email { display: none; }
}

/* ── Auth overlay (admin login / denied) ─────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  z-index: 200;
}
.auth-overlay[hidden] { display: none; }

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: var(--space-12);
  max-width: 460px;
  width: 100%;
}
.auth-card__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}
.auth-card__panel[hidden] { display: none; }

.auth-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  margin: 0;
}
.auth-card__lead {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--slate-700);
  line-height: 1.5;
  margin: 0;
}
.auth-card__hint {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--slate-500);
  line-height: 1.5;
  margin: 0;
}

.auth-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--teal-50);
  color: var(--teal-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-card__icon svg { width: 24px; height: 24px; }
.auth-card__icon--warn { background: var(--amber-50); color: var(--amber-700); }

.auth-card__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--slate-200);
  border-top-color: var(--teal-500);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
}

/* ── Filter bar (admin) ──────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-6);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}
.filter-bar__field {
  display: grid;
  gap: var(--space-1);
}
.filter-bar__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-fg-muted);
}
.filter-bar__select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--navy-900);
  background: var(--color-bg-surface);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: 8px 32px 8px 12px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  -webkit-appearance: none;
  appearance: none;
}
.filter-bar__select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(10, 173, 168, 0.15);
}
.filter-bar__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  letter-spacing: var(--tracking-wide);
}

/* ── Table (admin) ───────────────────────────────── */
.table-wrap {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.table-scroll { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  min-width: 1100px;
}
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--slate-100);
}
.table tbody tr:last-child td { border-bottom: none; }
.table thead th {
  background: var(--slate-50);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-fg-muted);
  border-bottom: 1px solid var(--color-border-default);
  white-space: nowrap;
}
.table tbody tr:hover { background: var(--slate-50); }
.table .cell-name {
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
}
.table .cell-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}
.table .cell-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.table-empty {
  padding: var(--space-16) var(--space-6);
  text-align: center;
  font-family: var(--font-body);
  color: var(--color-fg-secondary);
}

/* ── Admin head ─────────────────────────────────── */
.admin-head { margin-bottom: var(--space-6); }
.admin-head__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--navy-900);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  margin-bottom: var(--space-2);
}

.admin-event-select {
  display: grid;
  gap: var(--space-2);
  max-width: 640px;
  margin-bottom: var(--space-6);
}

/* ── Event panel (collapsible details/summary) ──── */
.event-panel {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-1);
}
.event-panel summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border-default);
}
.event-panel summary::-webkit-details-marker { display: none; }
.event-panel[open] summary { background: var(--slate-50); }
.event-panel__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
}
.event-panel__expand {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  letter-spacing: var(--tracking-wide);
}
.event-panel__form {
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
}
.event-panel__readonly {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  color: var(--color-fg-secondary);
  padding: 11px 14px;
  background: var(--slate-50);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
}
.event-panel__toggle-field { padding-top: var(--space-2); }
.event-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--navy-900);
  cursor: pointer;
}
.event-panel__toggle input { width: 18px; height: 18px; }

/* ── Stats row + chips ──────────────────────────── */
.admin-stats { margin-bottom: var(--space-6); }
.stats-row {
  display: grid;
  gap: var(--space-2);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-1);
}
.stats-row__line {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  line-height: 1.5;
}
.stats-row__line strong {
  color: var(--navy-900);
  font-weight: var(--font-weight-semibold);
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-fg-secondary);
  cursor: pointer;
  transition: var(--transition-default);
}
.stat-chip:hover { color: var(--navy-900); border-color: var(--color-border-strong); }
.stat-chip.is-active {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--white);
}
.stat-chip__count {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-xs);
  background: var(--slate-100);
  border-radius: var(--radius-full);
  padding: 1px 8px;
}
.stat-chip.is-active .stat-chip__count {
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
}

/* ── Status pills (refresh for new enum) ────────── */
.status-pill--applied   { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-100); }
.status-pill--paid      { background: #dcfce7;        color: #15803d;          border: 1px solid #bbf7d0; }
.status-pill--cancelled { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }
.status-pill--refunded  { background: #fee2e2;        color: #b91c1c;          border: 1px solid #fecaca; }

/* ── Filter status (checkbox group) ─────────────── */
.filter-status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.filter-status__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  cursor: pointer;
  transition: var(--transition-default);
}
.filter-status__option:hover {
  border-color: var(--color-border-strong);
  color: var(--navy-900);
}
.filter-status__option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}
.filter-status__option:has(input:checked) {
  background: var(--navy-50);
  border-color: var(--navy-300);
  color: var(--navy-900);
  font-weight: var(--font-weight-medium);
}

/* ── Filter bar — search input ──────────────────── */
.filter-bar__input {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--navy-900);
  background: var(--color-bg-surface);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  width: 100%;
}
.filter-bar__input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(10, 173, 168, 0.15);
}

/* ── Table — make rows clickable ────────────────── */
.table tbody tr[data-row] { cursor: pointer; }

/* ── Modals (detail + action dialog stack) ──────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 27, 51, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  z-index: 1000;
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal--dialog { z-index: 1100; }

.modal__panel {
  background: var(--color-bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-4);
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - var(--space-16));
  overflow-y: auto;
}
.modal__panel--dialog { max-width: 480px; }
.modal__loading {
  padding: var(--space-16);
  text-align: center;
  font-family: var(--font-body);
  color: var(--color-fg-secondary);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border-default);
}
.modal__title {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
}
.modal__heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.modal__name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  color: var(--navy-900);
}
.modal__close {
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--color-fg-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.modal__close:hover { background: var(--slate-100); color: var(--navy-900); }

.modal__section {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border-default);
}
.modal__section:last-child { border-bottom: none; }
.modal__section-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-fg-muted);
  margin-bottom: var(--space-4);
}

body.is-modal-open { overflow: hidden; }

@media (max-width: 600px) {
  .modal { padding: 0; align-items: stretch; }
  .modal__panel,
  .modal__panel--dialog {
    border-radius: 0;
    max-height: 100vh;
    max-width: none;
  }
}

/* ── Action row ─────────────────────────────────── */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* ── Form: checkbox + radio + fieldset ──────────── */
.form-checkbox,
.form-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--navy-900);
  cursor: pointer;
  padding: 4px 0;
}
.form-checkbox input,
.form-radio input { margin-top: 3px; width: 16px; height: 16px; }
.form-fieldset {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.form-fieldset legend {
  padding: 0 var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-fg-muted);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

/* ── Timeline (registration_log) ────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.timeline__entry {
  background: var(--slate-50);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}
.timeline__entry--status_change { border-left: 3px solid var(--teal-500); }
.timeline__entry--admin_note    { border-left: 3px solid var(--navy-700); }
.timeline__entry--contact       { border-left: 3px solid var(--amber-500); }
.timeline__entry--email_sent    { border-left: 3px solid var(--slate-400); }
.timeline__entry--system        { border-left: 3px solid var(--slate-300); }

.timeline__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}
.timeline__type {
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  color: var(--color-fg-secondary);
}
.timeline__time { margin-left: auto; font-family: var(--font-mono); }
.timeline__chip {
  background: var(--white);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: var(--tracking-normal);
}
.timeline__metadata {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-fg-secondary);
  margin-top: var(--space-1);
}
.timeline__message {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--navy-900);
  white-space: pre-wrap;
  line-height: 1.5;
}
.timeline__by {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  margin-top: var(--space-2);
}

/* ── Toast ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--navy-900);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-3);
  max-width: 360px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast--success { background: #15803d; }
.toast--error   { background: #b91c1c; }
.toast.is-leaving { opacity: 0; transform: translateX(20px); }

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.55);
  padding: var(--space-8) 0;
  margin-top: var(--space-16);
}
.site-footer__inner {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--space-12);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
}
.site-footer span,
.site-footer a {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
}
.site-footer a:hover { color: var(--teal-300); }
@media (max-width: 600px) {
  .site-footer__inner { padding-inline: var(--space-6); flex-direction: column; align-items: flex-start; }
}
