/* Booking tool – colours of Gymnasium ALLEE (gymnasium-allee.net). */
:root {
  --brand: #413c58;
  --brand-dark: #2b273a;
  --brand-tint: #eeedf4;
  --accent: #f87060;
  --accent-dark: #c9473a;
  --yellow: #f4d35e;
  --text: #2b273a;
  --muted: #6b6680;
  --border: #d9d6e3;
  --surface: #f7f6fa;
  --bg: #ffffff;
  --success: #1f6b43;
  --success-bg: #e6f4ec;
  --error: #b3261e;
  --error-bg: #fdecea;
  --warning: #7a5a00;
  --warning-bg: #fff6d6;
  --radius: 10px;
  --focus: 0 0 0 3px rgba(248, 112, 96, 0.45);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; color: var(--brand); margin: 0 0 0.6em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.container.narrow { max-width: 720px; }
main.container { flex: 1; padding-block: 32px 56px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--brand); color: #fff; padding: 8px 14px; z-index: 10; }
.skip-link:focus { left: 8px; top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.site-header { border-bottom: 4px solid var(--accent); background: #fff; }
.header-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: inline-flex; }
.brand img { height: 46px; width: auto; display: block; }
.lang-switch {
  margin-left: auto; font-size: 0.9rem; font-weight: 600; text-decoration: none;
  border: 1.5px solid var(--border); border-radius: 999px; padding: 4px 14px;
}
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }
.admin-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; }
.admin-nav a { font-weight: 600; text-decoration: none; }
.admin-nav .user { color: var(--muted); }
.admin .lang-switch { margin-left: 0; }
.admin .admin-nav { margin-left: auto; }

.site-footer { background: var(--brand); color: #e9e7f1; font-size: 0.9rem; }
.footer-inner { display: flex; gap: 22px; flex-wrap: wrap; padding-block: 18px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }

/* Cards, notices, messages */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px); margin-bottom: 24px;
  box-shadow: 0 1px 2px rgba(43, 39, 58, 0.04);
}
.card > :last-child { margin-bottom: 0; }
.card-danger { border-color: #f1c4bf; }
.card-danger h2, .card-danger h1 { color: var(--accent-dark); }

.notice { border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; border-left: 4px solid; }
.notice-info { background: var(--brand-tint); border-color: var(--brand); }
.notice-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.notice-error { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.notice-warning { background: var(--warning-bg); border-color: #d4a514; color: var(--warning); }
.notice-large { font-size: 1.08rem; padding: 16px 20px; }

.message { padding-block: 24px; }
.message-success h1 { color: var(--success); }
.message-error h1 { color: var(--accent-dark); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0 0 6px; }
.nowrap { white-space: nowrap; }

/* Event page */
.event { margin-bottom: 28px; }
.meta { display: grid; gap: 10px; margin: 0 0 20px; padding: 16px 18px; background: var(--surface); border-radius: var(--radius); }
.meta > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; }
.meta dt { font-weight: 600; color: var(--muted); }
.meta dd { margin: 0; }
.meta-date { display: block; }
.description { font-size: 1.05rem; }
.description p:last-child { margin-bottom: 0; }
.event-footer { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }
.privacy-note { font-size: 0.88rem; color: var(--muted); }

.summary { display: grid; gap: 0; margin: 0; }
.summary > div { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--surface); }
.summary > div:last-child { border-bottom: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 540px) {
  .meta > div, .summary > div { grid-template-columns: 1fr; gap: 0; }
}

/* Forms */
.field { margin-bottom: 18px; }
.field > label, .field > legend, .label { display: block; font-weight: 600; margin-bottom: 5px; }
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
.req { color: var(--accent-dark); }

input[type="text"], input[type="email"], input[type="number"], input[type="password"],
input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; background: #fff;
}
textarea { resize: vertical; min-height: 4.5em; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[type="number"] { max-width: 12rem; }

.field.check { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; }
.field.check input { width: 1.25rem; height: 1.25rem; margin: 2px 0 0; accent-color: var(--brand); }
.field.check label { font-weight: 500; margin: 0; }
.field.check .hint, .field.check .error-text { grid-column: 2; }

.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.error-text { color: var(--error); font-size: 0.92rem; font-weight: 600; margin: 6px 0 0; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha altcha-widget { --altcha-max-width: 100%; display: block; margin-bottom: 6px; }

/* Date choice as cards */
.date-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.date-option { position: relative; cursor: pointer; display: block; font-weight: 400; margin: 0; }
.date-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.date-card {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius); background: #fff;
  transition: border-color .15s, background .15s;
}
.date-when { font-weight: 700; color: var(--brand); }
.date-note { font-size: 0.9rem; }
.date-seats { font-size: 0.88rem; color: var(--success); font-weight: 600; }
.date-option:hover .date-card { border-color: var(--brand); }
.date-option input:checked + .date-card { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.date-option input:focus-visible + .date-card { box-shadow: var(--focus); }
.date-option.is-disabled { cursor: not-allowed; }
.date-option.is-disabled .date-card { background: var(--surface); border-style: dashed; color: var(--muted); }
.date-option.is-disabled .date-when { color: var(--muted); }
.date-option.is-disabled .date-seats { color: var(--accent-dark); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: 10px 18px; border-radius: 8px; border: 1.5px solid transparent; background: none; color: var(--brand);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-secondary:hover { background: var(--brand-tint); color: var(--brand); }
.btn-ghost { color: var(--brand); border-color: var(--border); background: #fff; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--accent-dark); color: #fff; }
.btn-danger:hover { background: #a6362b; color: #fff; }
.btn-ghost-danger { color: var(--accent-dark); border-color: #f1c4bf; background: #fff; }
.btn-ghost-danger:hover { background: var(--error-bg); color: var(--error); }
.btn-large { padding: 13px 26px; font-size: 1.05rem; }
.btn-small { padding: 6px 12px; font-size: 0.9rem; }
.btn-block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
form.inline { display: inline; margin: 0; }

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.push-right { margin-left: auto; }
.sticky-actions {
  position: sticky; bottom: 0; background: rgba(255, 255, 255, 0.95); padding: 14px 0;
  border-top: 1px solid var(--border); z-index: 2;
}

/* Admin */
.admin main.container.wide { max-width: 1120px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin-bottom: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
.copy-row { display: flex; gap: 10px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92rem; }

.table-wrap { overflow-x: auto; margin-bottom: 28px; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { background: var(--surface); color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfaff; }
.table tr.is-selected { background: var(--brand-tint); }
.table tfoot td { background: var(--surface); border-top: 2px solid var(--border); border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge-open { background: var(--success-bg); color: var(--success); border-color: #b9dfc9; }
.badge-closed { background: var(--warning-bg); color: var(--warning); border-color: #ecd68f; }
.badge-cancelled { background: var(--error-bg); color: var(--error); border-color: #f1c4bf; }

.meter { display: inline-block; vertical-align: middle; width: 70px; height: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin-right: 8px; }
.meter span { display: block; height: 100%; background: var(--brand); }

.danger-zone { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; } }

.rows { display: grid; gap: 12px; margin-bottom: 14px; }
.row-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: var(--surface); }
.row-item.has-error { border-color: var(--error); }
.row-item .field { margin-bottom: 10px; font-weight: 600; }
.row-item .field input, .row-item .field select, .row-item .field textarea { margin-top: 4px; font-weight: 400; }
.date-row { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(90px, 0.5fr) minmax(160px, 1.4fr) 7.5rem; gap: 0 12px; align-items: end; }
.date-row .row-error { grid-column: 1 / -1; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding-bottom: 10px; }
@media (max-width: 720px) {
  .date-row, .field-grid { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
}
.field-row:not(.is-select) .options-only { display: none; }

.login { margin-top: 24px; }
.local-login { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.local-login summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 12px; }

[hidden] { display: none !important; }
