/* Colors live in variables so dark mode only has to redefine them. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --border: #e6e0d6;
  --accent: #c2410c;          /* warm terracotta */
  --accent-text: #ffffff;
  --accent-soft: #fdebe1;
  --es: #b45309;  --es-soft: #fef3c7;
  --en: #1d4ed8;  --en-soft: #dbeafe;
  --danger: #b91c1c; --danger-soft: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2125;
    --text: #e8e6e3;
    --muted: #a1a7af;
    --border: #30343a;
    --accent: #f97316;
    --accent-text: #1a0d05;
    --accent-soft: #3a2116;
    --es: #fbbf24;  --es-soft: #3a2f12;
    --en: #93c5fd;  --en-soft: #172a46;
    --danger: #fca5a5; --danger-soft: #3b1717;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--accent); }

.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 12px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.account-area { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.account-name { font-weight: 600; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-small { padding: 4px 12px; font-size: 0.85rem; }

/* ---------- hero ---------- */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 40em; }

/* ---------- catalog header + filters ---------- */
.catalog-head h2 { margin: 24px 0 4px; font-size: 1.3rem; }
.tz-note { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }

.filters { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 20px; }
.filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.segmented button {
  border: 0; background: transparent; color: var(--text);
  padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- status messages ---------- */
.status:empty { display: none; }
.status { padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border); color: var(--muted); margin-bottom: 20px; }
.status.is-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.status p { margin: 0 0 8px; }
.status .ref { font-family: ui-monospace, monospace; font-size: 0.85rem; }

/* ---------- cards ---------- */
.session-list {
  list-style: none; margin: 0 0 64px; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.tag-es { background: var(--es-soft); color: var(--es); }
.tag-en { background: var(--en-soft); color: var(--en); }

.card-title { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.card-when { margin: 0; display: flex; flex-direction: column; }
.card-date { font-weight: 600; }
.card-time { color: var(--muted); font-size: 0.95rem; }

.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seats { font-size: 0.9rem; color: var(--muted); }
.seats.is-full { color: var(--danger); font-weight: 600; }

/* ---------- buttons ---------- */
.btn-primary, .btn-secondary {
  font: inherit; font-weight: 600; border-radius: 999px; padding: 8px 18px; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }
.btn-secondary { background: transparent; color: inherit; border-color: currentColor; }

button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px;
  font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
}

/* ---------- sign-in dialog ---------- */
.dialog {
  width: min(28rem, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.dialog::backdrop { background: rgb(0 0 0 / 0.4); }
.dialog h2 { margin: 0 0 8px; font-size: 1.25rem; }
.dialog p { margin: 0 0 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.field input {
  font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { color: var(--danger); font-size: 0.9rem; min-height: 1.5em; margin: 8px 0 0 !important; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.muted { color: var(--muted); }

/* ---------- sign-in page ---------- */
.signin-card {
  max-width: 28rem; margin: 64px auto; padding: 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.signin-card h1 { margin: 0 0 8px; font-size: 1.5rem; }
.signin-card p { margin: 0 0 16px; }
.signin-card a { color: var(--accent); font-weight: 600; }
.brand { text-decoration: none; }

/* ---------- book dialog ---------- */
.attendees { border: 0; padding: 0; margin: 8px 0 12px; }
.attendees legend { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.attendee { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.attendee input { width: 18px; height: 18px; accent-color: var(--accent); }
.attendee.is-disabled { color: var(--muted); }
.small { font-size: 0.85rem; }
.book-price { font-weight: 600; font-size: 1.05rem; margin-bottom: 4px !important; }
.is-short { color: var(--danger) !important; }

/* ---------- test-site banner (staging, dev) ---------- */
/* Diagonal yellow stripes: hard to mistake for the real site. */
.test-banner {
  background: repeating-linear-gradient(-45deg, #fde68a 0 14px, #fcd34d 14px 28px);
  color: #422006; font-size: 0.9rem; font-weight: 600;
}
.test-banner-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-block: 8px; }
.test-banner-credit { margin-left: auto; }
.test-banner .btn-secondary { background: #fffbeb; color: #422006; border-color: #b45309; }
