:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #eef2f7;
  --text: #162033;
  --muted: #5f6b7d;
  --line: #d8dfeb;
  --primary: #1d4ed8;
  --primary-dark: #183ea8;
  --danger: #c0392b;
  --success: #1f7a45;
  --shadow: 0 18px 48px rgba(22, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.banner-header {
  margin-bottom: 24px;
}

.banner-header a {
  display: block;
}

.banner-header img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand h1,
.brand h2,
.brand p {
  margin: 0;
}

.brand small {
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 12px;
}

.nav a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav a.active {
  border-color: var(--primary);
  color: var(--primary);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-body {
  padding: 24px;
}

.panel-body > .language-switch {
  margin-bottom: 18px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.muted {
  color: var(--muted);
}

.language-switch {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.language-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.language-switch button.active {
  background: var(--surface);
  color: var(--text);
}

.consent-copy {
  margin-top: 20px;
  padding: 28px;
  background: #fbfcfe;
  border-radius: 8px;
  border: 1px solid var(--line);
  line-height: 1.7;
}

.form-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.signature-pad {
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  min-height: 180px;
  touch-action: none;
  cursor: crosshair;
}

.signature-controls {
  display: flex;
  justify-content: flex-start;
}

.checkbox-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checkbox-row input {
  margin-top: 2px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

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

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

.btn-excel {
  border-color: #147d46;
  background: #147d46;
  color: #fff;
}

.btn-excel:hover {
  background: #0f6538;
}

.btn-pdf {
  border-color: #c62828;
  background: #c62828;
  color: #fff;
}

.btn-pdf:hover {
  background: #9f1f1f;
}

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

.btn-danger:hover {
  background: #962d22;
}

.btn-small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}

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

.success-shell {
  max-width: 860px;
}

.success-panel {
  text-align: center;
}

.success-body {
  padding: 40px 24px;
}

.success-kicker {
  margin: 0 0 10px;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.success-body h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.25;
}

.success-body p {
  margin: 0;
}

.success-actions {
  justify-content: center;
  margin-top: 24px;
}

.status {
  margin-top: 16px;
  min-height: 24px;
  font-weight: 700;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--danger);
}

.waiver-document {
  max-width: 820px;
  margin: 0 auto;
}

.waiver-document h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.25;
}

.waiver-document p {
  margin: 0 0 14px;
}

.waiver-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.waiver-event {
  margin-bottom: 18px;
}

.waiver-list {
  margin: 20px 0 0;
  padding-left: 22px;
}

.waiver-list > li {
  margin-bottom: 18px;
}

.waiver-list ul {
  margin: 12px 0 12px;
  padding-left: 18px;
}

.waiver-list li::marker {
  font-weight: 700;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-toolbar .field {
  min-width: 240px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 14px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.pagination-info {
  color: var(--muted);
  font-size: 14px;
}

.login-box {
  max-width: 420px;
  margin: 48px auto 0;
}

.hidden {
  display: none;
}

.btn-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: 8px;
  padding: 16px;
  max-width: min(90vw, 480px);
  max-height: 90vh;
  overflow: auto;
}

.modal-box img {
  display: block;
  max-width: 100%;
  height: auto;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav {
    flex-wrap: wrap;
  }

  .consent-copy {
    padding: 20px;
  }

  .waiver-document h2 {
    font-size: 22px;
  }
}
