/* ==========================================================================
   PatagoniaVibe design system
   Every color, size, radius and shadow comes from the tokens below. Screens
   compose the shared components; they never declare literal style values.
   ========================================================================== */

:root {
  /* Brand palette: aurora violet, glacier cyan, sunset pink, amber, lagoon green. */
  --c-violet: #7c3aed;
  --c-violet-600: #6d28d9;
  --c-cyan: #06b6d4;
  --c-cyan-700: #0e7490;
  --c-pink: #ec4899;
  --c-pink-700: #be185d;
  --c-amber: #f59e0b;
  --c-amber-800: #92400e;
  --c-green: #10b981;
  --c-green-700: #047857;
  --c-red: #ef4444;
  --c-red-700: #b91c1c;
  --c-sky: #0ea5e9;
  --c-blue-700: #1d4ed8;

  --brand: var(--tenant-primary, var(--c-violet));
  --brand-2: var(--tenant-accent, var(--c-cyan));

  --grad-aurora: linear-gradient(135deg, var(--c-violet) 0%, var(--c-pink) 55%, var(--c-amber) 100%);
  --grad-glacier: linear-gradient(135deg, var(--c-cyan) 0%, var(--c-violet) 100%);
  --grad-lagoon: linear-gradient(135deg, var(--c-green) 0%, var(--c-cyan) 100%);
  --grad-sunset: linear-gradient(135deg, var(--c-pink) 0%, var(--c-amber) 100%);
  --grad-brand: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);

  /* Light theme surfaces. */
  --bg: #f5f3ff;
  --bg-2: #eef7fb;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --border: #e4e1f0;
  --border-strong: #cfcae3;
  --text: #1c1733;
  --text-muted: #5b5676;
  --text-inverse: #ffffff;
  --focus: #7c3aed;
  --overlay: rgba(18, 12, 40, 0.55);

  --ok-bg: #d1fae5;  --ok-fg: #065f46;
  --warn-bg: #fef3c7; --warn-fg: #92400e;
  --err-bg: #fee2e2;  --err-fg: #991b1b;
  --info-bg: #e0f2fe; --info-fg: #075985;
  --neutral-bg: #ede9fe; --neutral-fg: #4c1d95;

  /* Type scale. */
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Space Grotesk", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-hero: clamp(2.4rem, 6vw, 4.6rem);
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh: 1.55;

  /* Spacing, radius, elevation, motion. */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4.5rem;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(28, 23, 51, 0.06), 0 1px 3px rgba(28, 23, 51, 0.08);
  --shadow: 0 8px 24px -8px rgba(76, 29, 149, 0.18), 0 2px 6px rgba(28, 23, 51, 0.06);
  --shadow-lg: 0 24px 48px -16px rgba(76, 29, 149, 0.35);
  --shadow-glow: 0 10px 30px -6px rgba(124, 58, 237, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms;
  --t: 280ms;
  --t-slow: 700ms;
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --content-max: 1240px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c0a1d;
  --bg-2: #0a1424;
  --surface: #161230;
  --surface-2: #1d1840;
  --surface-glass: rgba(26, 21, 56, 0.72);
  --border: #2d2657;
  --border-strong: #3f3673;
  --text: #f1eefe;
  --text-muted: #b3acd6;
  --focus: #c4b5fd;
  --overlay: rgba(4, 2, 12, 0.7);
  --ok-bg: #064e3b;  --ok-fg: #a7f3d0;
  --warn-bg: #78350f; --warn-fg: #fde68a;
  --err-bg: #7f1d1d;  --err-fg: #fecaca;
  --info-bg: #0c4a6e; --info-fg: #bae6fd;
  --neutral-bg: #2e1065; --neutral-fg: #ddd6fe;
  --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 var(--sp-3); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p { margin: 0 0 var(--sp-4); }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
code, kbd { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: var(--radius-sm); border: 1px solid var(--border); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
::selection { background: var(--c-violet); color: var(--text-inverse); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--sp-4); top: -100px; z-index: 100; background: var(--surface); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius); box-shadow: var(--shadow); }
.skip-link:focus { top: var(--sp-4); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.text-gradient { background: var(--grad-aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon--lg { width: 1.75em; height: 1.75em; }
.icon--xl { width: 2.75em; height: 2.75em; }

/* ---------- Animated background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45; animation: float 18s var(--ease) infinite alternate; }
.blob--1 { width: 46vmax; height: 46vmax; background: var(--c-violet); top: -18vmax; left: -12vmax; }
.blob--2 { width: 38vmax; height: 38vmax; background: var(--c-cyan); bottom: -16vmax; right: -10vmax; animation-delay: -6s; }
.blob--3 { width: 30vmax; height: 30vmax; background: var(--c-pink); top: 30%; left: 55%; opacity: 0.3; animation-delay: -12s; }
:root[data-theme="dark"] .blob { opacity: 0.28; }
@keyframes float {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(6vw, 4vh) scale(1.08) rotate(20deg); }
  100% { transform: translate(-4vw, 8vh) scale(0.95) rotate(-10deg); }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px) scale(0.98); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 42px;
  padding: var(--sp-2) var(--sp-4);
  font: inherit; font-weight: var(--fw-semibold); font-size: var(--fs-sm);
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease), filter var(--t) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--primary { --btn-bg: var(--grad-brand); --btn-fg: var(--text-inverse); --btn-border: transparent; background-size: 160% 160%; animation: shimmer 6s ease infinite; }
.btn--primary:hover { box-shadow: var(--shadow-glow); filter: saturate(1.15); }
.btn--aurora { --btn-bg: var(--grad-aurora); --btn-fg: var(--text-inverse); --btn-border: transparent; background-size: 180% 180%; animation: shimmer 5s ease infinite; }
.btn--ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn--ghost:hover { --btn-bg: var(--surface-2); box-shadow: none; }
.btn--danger { --btn-bg: var(--c-red-700); --btn-fg: var(--text-inverse); --btn-border: transparent; }
.btn--success { --btn-bg: var(--c-green-700); --btn-fg: var(--text-inverse); --btn-border: transparent; }
.btn--sm { min-height: 34px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { min-height: 52px; padding: var(--sp-3) var(--sp-6); font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn--icon { width: 38px; min-height: 38px; padding: 0; border-radius: 50%; }
.btn--icon.btn--danger-soft:hover { --btn-bg: var(--err-bg); --btn-fg: var(--err-fg); }
@keyframes shimmer { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Busy state: set by app.js on submit; spinner replaces nothing, it is added. */
.btn.is-busy { pointer-events: none; opacity: 0.85; }
.btn.is-busy::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.45); transform: scale(0); animation: ripple 600ms var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* Tooltips for icon buttons (the text is also the aria-label). */
[data-tooltip] { position: relative; }
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translate(-50%, 4px);
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap;
  color: var(--text-inverse); background: var(--text);
  border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
  z-index: 30;
}
[data-tooltip]:hover::before, [data-tooltip]:focus-visible::before { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="dark"] [data-tooltip]::before { color: var(--bg); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  /* Cards are often the <a> itself. The UA underline propagates into every
     heading and paragraph inside it, so it has to be killed here once. */
  text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t);
}
.card--glass { background: var(--surface-glass); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card--tilt { transform-style: preserve-3d; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.card__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
.card__footer { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.card--gradient-border { position: relative; border: none; }
.card--gradient-border::before { content: ""; position: absolute; inset: 0; padding: 2px; border-radius: inherit; background: var(--grad-aurora); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
/* Edge-less card: it reads on its own fill plus a lifted shadow. The 1px box
   is kept (only the color goes) so hover never shifts the layout. Needs both
   classes to outrank `.card--hover:hover`. */
.card--borderless { border-color: transparent; box-shadow: var(--shadow); }
.card--borderless.card--hover:hover { border-color: transparent; }

.icon-bubble { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius); color: var(--text-inverse); background: var(--grad-brand); box-shadow: var(--shadow-glow); flex-shrink: 0; }
.icon-bubble--aurora { background: var(--grad-aurora); }
.icon-bubble--glacier { background: var(--grad-glacier); }
.icon-bubble--lagoon { background: var(--grad-lagoon); }
.icon-bubble--sunset { background: var(--grad-sunset); }
.icon-bubble--lg { width: 64px; height: 64px; border-radius: var(--radius-lg); }

/* ---------- Stats ---------- */
.stat-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.stat { display: flex; gap: var(--sp-4); align-items: center; text-decoration: none; color: inherit; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: 1; }
.stat__label { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- Page header / breadcrumb ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.page-header__title { margin: var(--sp-1) 0 0; }
.page-header__subtitle { color: var(--text-muted); margin: var(--sp-1) 0 0; }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb li + li::before { content: "/"; margin-right: var(--sp-1); opacity: 0.5; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: var(--fw-semibold); }

/* ---------- Summary chips / filters ---------- */
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.chip { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); min-height: 34px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); text-decoration: none; transition: all var(--t-fast); }
.chip:hover { border-color: var(--brand); }
.chip--active { background: var(--grad-brand); color: var(--text-inverse); border-color: transparent; }
.chip__count { font-weight: var(--fw-bold); }
.toolbar { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--sp-4); }
.toolbar .field { margin: 0; min-width: 200px; flex: 1; }
.toolbar .field--narrow { flex: 0 1 200px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: var(--fw-semibold); color: var(--text-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; padding: var(--sp-3) var(--sp-4); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: var(--sp-1); justify-content: flex-end; }
.row-actions form { margin: 0; }
.cell-title { font-weight: var(--fw-semibold); }
.cell-sub { color: var(--text-muted); font-size: var(--fs-xs); }
.thumb { width: 48px; height: 48px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); }

/* ---------- Badges (always icon + text, never color alone) ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-2); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-fg); }
.badge .icon { width: 1em; height: 1em; }
.badge--success { background: var(--ok-bg); color: var(--ok-fg); }
.badge--warning { background: var(--warn-bg); color: var(--warn-fg); }
.badge--danger { background: var(--err-bg); color: var(--err-fg); }
.badge--info { background: var(--info-bg); color: var(--info-fg); }
.access-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); }

/* ---------- Forms ---------- */
.form { display: grid; gap: var(--sp-4); }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.field { display: grid; gap: var(--sp-1); }
.field > label, .field__label { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.field__required { color: var(--c-pink-700); }
:root[data-theme="dark"] .field__required { color: var(--c-pink); }
.input, .select, .textarea {
  width: 100%; min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.textarea { min-height: 120px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-red); }
.field-hint { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }
.field-error { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--err-fg); margin: 0; }
.form-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; padding-top: var(--sp-2); }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-4); margin: 0; }
.fieldset legend { font-weight: var(--fw-bold); padding: 0 var(--sp-2); }

.password-field { position: relative; }
.password-field .input { padding-right: 48px; }
.password-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

.check { display: flex; gap: var(--sp-2); align-items: flex-start; cursor: pointer; font-size: var(--fs-sm); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }
.check-grid { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: var(--radius-pill); background: var(--border-strong); position: relative; transition: background var(--t); cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease); }
.switch input:checked { background: var(--grad-brand); }
.switch input:checked::after { transform: translateX(20px); }

.module-toggle { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); border: 1.5px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.module-toggle:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.module-toggle input { width: 20px; height: 20px; accent-color: var(--brand); }

.dropzone { display: grid; place-items: center; gap: var(--sp-2); text-align: center; padding: var(--sp-6) var(--sp-4); border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); cursor: pointer; transition: border-color var(--t), background var(--t), transform var(--t); }
.dropzone.is-dragover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); transform: scale(1.01); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--sp-2); width: 100%; margin-top: var(--sp-3); }
.dropzone__previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); animation: pop var(--t) var(--ease); }

/* ---------- Company branding (settings) ---------- */
.settings-brand__title { margin-top: var(--sp-7); }
.brand-logo-preview { display: grid; place-items: center; min-height: 120px; padding: var(--sp-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); }
.brand-logo-preview img { max-height: 96px; max-width: 100%; object-fit: contain; }
.brand-hero-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
.brand-hero-item { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 16 / 10; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.brand-hero-item img { width: 100%; height: 100%; object-fit: cover; }
.brand-hero-item__badge { position: absolute; top: var(--sp-2); left: var(--sp-2); }
.brand-hero-item__actions { position: absolute; right: var(--sp-2); bottom: var(--sp-2); display: flex; gap: var(--sp-1); }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Progress ---------- */
.progress { height: 10px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress__bar { height: 100%; width: 0; background: var(--grad-brand); border-radius: inherit; transition: width var(--t-slow) var(--ease); }
.progress[data-value] .progress__bar { width: var(--value, 0%); }

/* ---------- Empty / error states ---------- */
.empty-state { display: grid; place-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-4); }
.empty-state__icon { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--grad-aurora); color: var(--text-inverse); box-shadow: var(--shadow-glow); animation: bob 3.5s ease-in-out infinite; }
.empty-state h2, .empty-state h3 { margin: 0; }
.empty-state p { color: var(--text-muted); max-width: 44ch; margin: 0; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-4); font-size: var(--fs-sm); color: var(--text-muted); }
.pagination__pages { display: flex; gap: var(--sp-1); align-items: center; }
.pagination__current { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border-radius: 50%; background: var(--grad-brand); color: var(--text-inverse); font-weight: var(--fw-bold); }

/* ---------- Alerts / banners ---------- */
.alert { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--info-bg); color: var(--info-fg); font-size: var(--fs-sm); }
.alert--success { background: var(--ok-bg); color: var(--ok-fg); }
.alert--warning { background: var(--warn-bg); color: var(--warn-fg); }
.alert--error { background: var(--err-bg); color: var(--err-fg); }
.impersonation-bar { position: sticky; top: 0; z-index: 60; display: flex; gap: var(--sp-3); align-items: center; justify-content: center; flex-wrap: wrap; padding: var(--sp-2) var(--sp-4); background: var(--grad-sunset); color: var(--text-inverse); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.impersonation-bar form { margin: 0; }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 90; display: grid; gap: var(--sp-2); width: min(420px, calc(100vw - 2 * var(--sp-4))); }
.toast { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 5px solid var(--c-sky); box-shadow: var(--shadow-lg); animation: toast-in var(--t) var(--ease); }
.toast--success { border-left-color: var(--c-green); }
.toast--error { border-left-color: var(--c-red); }
.toast--warning { border-left-color: var(--c-amber); }
.toast__body { flex: 1; font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.toast.is-leaving { animation: toast-out var(--t) var(--ease) forwards; }
@keyframes toast-in { from { transform: translateX(110%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(110%); opacity: 0; } }

/* ---------- Modal (replaces native confirm) ---------- */
.modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: var(--sp-4); background: var(--overlay); backdrop-filter: blur(4px); animation: fade-in var(--t) var(--ease); }
.modal[hidden] { display: none; }
.modal__dialog { width: min(460px, 100%); background: var(--surface); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow-lg); animation: pop var(--t) var(--ease); }
.modal__title { display: flex; gap: var(--sp-2); align-items: center; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- App shell (tenant + admin panels) ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5) var(--sp-4); background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-right: 1px solid var(--border); z-index: 40; }
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.brand__mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--grad-aurora); color: var(--text-inverse); box-shadow: var(--shadow-glow); animation: shimmer 6s ease infinite; background-size: 200% 200%; }
.brand__sub { display: block; font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
/* Company logo uploaded by the tenant: any aspect ratio fits the 40px-high brand slot. */
.brand__tenant-logo { display: block; height: 40px; width: auto; max-width: 132px; object-fit: contain; border-radius: 10px; }
.brand__logo { display: block; height: 44px; width: auto; }
.brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: block; }
@media (max-width: 560px) { .brand__logo { height: 36px; } }
.nav { display: grid; gap: 2px; }
.nav__section { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: var(--fw-bold); margin: var(--sp-3) var(--sp-3) var(--sp-1); }
.nav__link { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: var(--fw-medium); font-size: var(--fs-sm); transition: background var(--t-fast), transform var(--t-fast), color var(--t-fast); }
.nav__link:hover { background: var(--surface-2); transform: translateX(3px); }
.nav__link[aria-current="page"] { background: var(--grad-brand); color: var(--text-inverse); box-shadow: var(--shadow-glow); }
.sidebar__footer { margin-top: auto; display: grid; gap: var(--sp-2); }
.user-chip { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2); border-radius: var(--radius); background: var(--surface-2); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--grad-glacier); color: var(--text-inverse); font-weight: var(--fw-bold); flex-shrink: 0; }
.user-chip__name { font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: 1.2; }
.user-chip__role { font-size: var(--fs-xs); color: var(--text-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-5); background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.topbar__spacer { flex: 1; }
.topbar__tenant { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-semibold); }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); animation: content-in var(--t-slow) var(--ease); }
@keyframes content-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.sidebar-toggle { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform var(--t) var(--ease); box-shadow: var(--shadow-lg); background: var(--surface); }
  .sidebar.is-open { transform: none; }
  .sidebar-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); }
  .sidebar-toggle { display: inline-flex; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .topbar { padding: 0 var(--sp-4); }
}

/* ---------- Public site ---------- */
.site-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-5); background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); }
.site-main { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); }
.site-footer { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm); }
.site-footer__link { display: inline-block; margin-left: var(--sp-2); color: var(--text-muted); text-decoration: none; border-bottom: 1px solid var(--border-strong); transition: color var(--t-fast), border-color var(--t-fast); }
.site-footer__link:hover { color: var(--brand); border-color: var(--brand); }
.site-footer__version { display: inline-block; margin-left: var(--sp-2); padding: 2px var(--sp-2); border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface-glass); font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.02em; }

.hero { position: relative; display: grid; gap: var(--sp-5); justify-items: center; text-align: center; padding: var(--sp-8) 0 var(--sp-7); }
.hero__eyebrow { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-pill); background: var(--surface-glass); border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: var(--fw-semibold); box-shadow: var(--shadow-sm); }
.hero__title { font-size: var(--fs-hero); max-width: 16ch; margin: 0; letter-spacing: -0.03em; }
.hero__lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 60ch; margin: 0; }
.hero__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }
.hero__word { display: inline-block; background: var(--grad-aurora); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 5s ease infinite; }
/* Home hero: full-bleed stage with a CSS-only crossfading photo slideshow. Text
   sits on a dark scrim, so it stays light in both themes. */
.site-main--bleed { max-width: none; padding: 0 0 var(--sp-8); }
.home-body { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--sp-5); }
@media (max-width: 700px) { .home-body { padding: 0 var(--sp-4); } }
.hero--stage { padding: clamp(88px, 14vh, 160px) var(--sp-5) var(--sp-8); min-height: min(86vh, 800px); align-content: center; color: #fff; isolation: isolate; overflow: hidden; }
.hero__slides { position: absolute; inset: 0; z-index: -1; background: #0b0718; }
.hero__slides::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 7, 24, 0.55) 0%, rgba(11, 7, 24, 0.45) 45%, rgba(11, 7, 24, 0.92) 100%), radial-gradient(ellipse at center, transparent 30%, rgba(11, 7, 24, 0.5) 100%); }
.hero__slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; animation: hero-slide 18s linear infinite both; }
.hero__slide--dj { background-image: url("../img/hero/dj-1200.webp"); }
.hero__slide--salon { background-image: url("../img/hero/salon-1200.webp"); animation-delay: 6s; }
.hero__slide--baile { background-image: url("../img/hero/baile-1200.webp"); animation-delay: 12s; }
@keyframes hero-slide {
  0% { opacity: 0; transform: scale(1.12); }
  6% { opacity: 1; }
  33% { opacity: 1; }
  40% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}
.hero--stage .hero__eyebrow { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); color: #fff; backdrop-filter: blur(8px); }
.hero--stage .hero__title { color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35); }
.hero--stage .hero__lead { color: rgba(255, 255, 255, 0.88); }
.hero__ghost { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #fff; backdrop-filter: blur(8px); }
.hero__ghost:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.hero__dots { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.hero__dots span { width: 8px; height: 8px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.35); animation: hero-dot 18s linear infinite both; }
.hero__dots span:nth-child(2) { animation-delay: 6s; }
.hero__dots span:nth-child(3) { animation-delay: 12s; }
@keyframes hero-dot {
  0%, 38%, 100% { width: 8px; background: rgba(255, 255, 255, 0.35); }
  6%, 33% { width: 26px; background: #fff; }
}
@media (max-width: 700px) {
  .hero--stage { min-height: 78vh; padding: var(--sp-8) var(--sp-4) var(--sp-7); }
  .hero__slide--dj { background-image: url("../img/hero/dj-640.webp"); }
  .hero__slide--salon { background-image: url("../img/hero/salon-640.webp"); }
  .hero__slide--baile { background-image: url("../img/hero/baile-640.webp"); }
}
/* Reduced motion keeps the slow crossfade (no zoom): a fade is not a vestibular
   trigger. The !important beats the global reduced-motion reset below. */
@keyframes hero-fade {
  0%, 40%, 100% { opacity: 0; }
  6%, 33% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__slide { animation-name: hero-fade !important; }
  .hero__slide, .hero__dots span { animation-duration: 18s !important; animation-iteration-count: infinite !important; }
}

.section-lead { text-align: center; color: var(--text-muted); font-size: var(--fs-lg); max-width: 60ch; margin: calc(-1 * var(--sp-3)) auto var(--sp-6); }
.uses-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .uses-grid { grid-template-columns: 1fr; } }
.use-card__tags { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--brand); }
.steps { list-style: none; margin: 0; padding: 0; }
.step__num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-pill); background: var(--grad-aurora); color: #fff; font-weight: var(--fw-semibold); font-size: var(--fs-lg); box-shadow: var(--shadow-glow); }
.cta-band { margin: var(--sp-8) auto 0; display: grid; gap: var(--sp-4); justify-items: center; text-align: center; padding: var(--sp-8) var(--sp-5); background: radial-gradient(ellipse at top, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%), var(--surface); }
.cta-band__title { margin: 0; font-size: var(--fs-3xl); max-width: 22ch; letter-spacing: -0.02em; }
.cta-band__text { margin: 0; color: var(--text-muted); font-size: var(--fs-lg); max-width: 56ch; }

.feature { display: grid; gap: var(--sp-3); align-content: start; }
.feature__title { margin: 0; font-size: var(--fs-xl); }
.feature ul { margin: 0; padding-left: var(--sp-4); color: var(--text-muted); font-size: var(--fs-sm); }

.section-title { text-align: center; margin: var(--sp-8) auto var(--sp-5); max-width: 40ch; }

.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 160px); padding: var(--sp-5) 0; }
.auth-card { width: min(440px, 100%); padding: var(--sp-6); }
.auth-card__head { text-align: center; display: grid; gap: var(--sp-2); justify-items: center; margin-bottom: var(--sp-5); }
.auth-card__alt { margin-top: var(--sp-3); }
/* Realm switcher. It sits under the title, above the form, because the two
   login forms reject each other's credentials with the very same message. */
.auth-switch { margin: var(--sp-4) 0 0; }
.auth-switch a { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-decoration: none; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast); }
.auth-switch a:hover { color: var(--brand); border-color: var(--brand); background: var(--surface-2); transform: translateY(-1px); }

/* ---------- Full-bleed company stage ---------- */
/* `clip` (never `hidden`) removes the horizontal scrollbar that 100vw would
   create next to a vertical one, and it does not turn <body> into a scroll
   container, so the sticky header keeps working. */
body { overflow-x: clip; }
/* Anchor targets must clear the sticky header. */
[id] { scroll-margin-top: calc(var(--topbar-h) + var(--sp-4)); }

.bleed { width: 100vw; margin-inline: calc(50% - 50vw); }
.bleed__inner { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--sp-5); }

.stage {
  /* The stage always sits on the brand gradient, so its translucent whites and
     inks are scoped here instead of following the page theme. */
  --stage-glass: rgba(255, 255, 255, 0.16);
  --stage-line: rgba(255, 255, 255, 0.32);
  --stage-soft: rgba(255, 255, 255, 0.74);
  --stage-deep: rgba(8, 5, 24, 0.46);
  --stage-ink: #ffffff;
  --stage-ink-2: #171032;
  --stage-progress: 0;
  --py: 0px;
  --art-ridge-back: rgba(255, 255, 255, 0.16);
  --art-ridge-front: rgba(10, 6, 28, 0.55);
  --art-ridge-snow: rgba(255, 255, 255, 0.92);
  /* Distance from the viewport edge to the content column, so the floating art
     stays glued to the text grid on wide screens and falls back to 2% below it. */
  --stage-gutter: max(2%, calc((100% - var(--content-max)) / 2 + var(--sp-5)));
  position: relative;
  isolation: isolate;
  display: grid;
  overflow: hidden;
  margin-top: calc(-1 * var(--sp-6));
  min-height: clamp(430px, 78vh, 740px);
  color: var(--stage-ink);
  background: var(--grad-brand);
  box-shadow: 0 34px 60px -34px rgba(8, 5, 24, 0.6);
}

/* Decorative layers. Only wrappers carry --py so the inner parts keep their
   own animations (one transform property per element). */
.stage__scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* Company hero photos (stage--photos): stacked, crossfaded by app.js; the sky
   layer above them keeps the white title legible on any picture. */
.stage__photos { position: absolute; inset: 0; background: #0b0718; }
.stage__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1.6s var(--ease), transform 7s linear; }
.stage__photo.is-active { opacity: 1; transform: scale(1); }
.stage--photos .stage__sky { background: linear-gradient(180deg, rgba(8, 5, 24, 0.62) 0%, rgba(8, 5, 24, 0.38) 45%, rgba(8, 5, 24, 0.85) 100%), radial-gradient(ellipse at 30% 50%, rgba(8, 5, 24, 0.35), transparent 70%); }
.stage--photos .stage__glow-in { opacity: 0.28; }
.stage--photos .stage__grid, .stage--photos .stage__art { display: none; }
@media (prefers-reduced-motion: reduce) { .stage__photo { transform: none; transition: opacity 1.6s linear; } }
.stage__sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 96% at 76% 6%, rgba(255, 255, 255, 0.34), transparent 58%),
    linear-gradient(180deg, var(--stage-deep) 0%, transparent 42%, rgba(8, 5, 24, 0.66) 100%);
}
.stage__glow { display: block; transform: translate3d(0, calc(var(--py) * -0.6), 0); }
.stage__glow-in { position: absolute; top: -26vmax; right: -16vmax; width: 66vmax; height: 66vmax; border-radius: 50%; background: var(--grad-aurora); filter: blur(64px); opacity: 0.55; animation: glow-drift 24s var(--ease) infinite alternate; }
:root[data-theme="dark"] .stage__glow-in { opacity: 0.4; }
@keyframes glow-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-7vw, 6vh, 0) scale(1.2); } }

.stage__grid {
  position: absolute; left: -30%; right: -30%; bottom: -12%; height: 68%;
  background-image: linear-gradient(var(--stage-line) 1px, transparent 1px), linear-gradient(90deg, var(--stage-line) 1px, transparent 1px);
  background-size: 92px 92px;
  opacity: 0.45;
  transform: perspective(520px) rotateX(68deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 44%);
  mask-image: linear-gradient(180deg, transparent, #000 44%);
  animation: grid-run 8s linear infinite;
}
@keyframes grid-run { to { background-position: 0 92px; } }

/* Floating glass tiles: a deliberate collage on the right of the stage, layered
   over the ridge so the silhouettes never read as one muddy band. */
.stage__art {
  position: absolute;
  display: grid; place-items: center;
  padding: var(--sp-3);
  border-radius: var(--radius-lg);
  background: var(--stage-glass);
  border: 1px solid var(--stage-line);
  box-shadow: 0 22px 42px -24px rgba(8, 5, 24, 0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.stage__art .art { display: block; width: 100%; height: auto; animation: bob 7s var(--ease) infinite alternate; }
/* On the stage the art sits on the brand gradient, so the art parts that
   normally use page surfaces get their own translucent inks. */
.stage__art--music { --art-plate: rgba(10, 6, 28, 0.5); }
.stage__art--party { --art-shell: rgba(10, 6, 28, 0.42); }
.stage__art--wind { --art-ridge-back: rgba(255, 255, 255, 0.14); --art-ridge-front: rgba(10, 6, 28, 0.42); --art-ridge-snow: rgba(255, 255, 255, 0.8); }
.stage__art--music { top: 6%; right: var(--stage-gutter); width: clamp(140px, 17vw, 210px); z-index: 3; transform: translate3d(0, var(--py), 0) rotate(-3deg); }
.stage__art--music .art { animation-duration: 7s; }
.stage__art--party { top: 40%; right: calc(var(--stage-gutter) + 11%); width: clamp(120px, 14vw, 175px); z-index: 2; transform: translate3d(0, var(--py), 0) rotate(4deg); }
.stage__art--party .art { animation-duration: 5.5s; }
.stage__art--wind { top: 58%; right: calc(var(--stage-gutter) - 5%); width: clamp(165px, 20vw, 260px); z-index: 1; transform: translate3d(0, var(--py), 0) rotate(-2deg); }
.stage__art--wind .art { animation-duration: 9s; }
.stage__ridge { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; transform: translate3d(0, var(--py), 0); }
.stage__ridge .art { display: block; width: 100%; height: clamp(118px, 24vh, 250px); }

.stage__inner { position: relative; z-index: 1; display: grid; align-content: center; justify-items: start; gap: var(--sp-6); padding-block: var(--sp-8) var(--sp-7); }
.stage__content { display: grid; gap: var(--sp-4); justify-items: start; max-width: 46ch; }
.stage__eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0;
  padding: var(--sp-1) var(--sp-4); border-radius: var(--radius-pill);
  background: var(--stage-glass); border: 1px solid var(--stage-line);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.stage__eyebrow-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-amber); animation: dot-pulse 2.6s var(--ease) infinite; }
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
.stage__title { font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -0.035em; margin: 0; text-wrap: balance; text-shadow: 0 18px 46px rgba(8, 5, 24, 0.42); }
.stage__word { display: inline-block; margin-right: 0.26em; animation: word-in 900ms var(--ease) backwards; }
.stage__word:nth-child(1) { animation-delay: 60ms; }
.stage__word:nth-child(2) { animation-delay: 160ms; }
.stage__word:nth-child(3) { animation-delay: 260ms; }
.stage__word:nth-child(4) { animation-delay: 360ms; }
.stage__word:nth-child(n + 5) { animation-delay: 440ms; }
@keyframes word-in { from { opacity: 0; transform: translateY(0.42em) scale(0.94) rotate(1.6deg); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.stage__lead { font-size: var(--fs-lg); color: var(--stage-soft); max-width: 52ch; margin: 0; }
.stage__actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.btn--stage { --btn-bg: var(--stage-ink); --btn-fg: var(--stage-ink-2); --btn-border: transparent; box-shadow: 0 16px 34px -16px rgba(8, 5, 24, 0.75); }
.btn--stage:hover { box-shadow: 0 24px 46px -16px rgba(8, 5, 24, 0.85); }
.btn--stage-ghost { --btn-bg: var(--stage-glass); --btn-fg: var(--stage-ink); --btn-border: var(--stage-line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--stage-ghost:hover { --btn-bg: rgba(255, 255, 255, 0.26); box-shadow: none; }

.stage__scroll { display: inline-flex; align-items: center; gap: var(--sp-3); justify-self: center; color: var(--stage-soft); text-decoration: none; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.18em; text-transform: uppercase; }
.stage__scroll:hover { color: var(--stage-ink); }
.stage__scroll-line { position: relative; width: 2px; height: 46px; border-radius: 2px; background: var(--stage-line); overflow: hidden; }
.stage__scroll-line::after { content: ""; position: absolute; inset: 0; background: var(--stage-ink); transform-origin: 50% 0; animation: scroll-cue 2.2s var(--ease) infinite; }
@keyframes scroll-cue {
  0% { transform: translateY(-100%) scaleY(0.35); }
  55% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(100%) scaleY(0.35); }
}
/* Scroll progress of the stage itself; --stage-progress is written by app.js
   and stays 0 (invisible) when scripting is off. */
.stage__gauge { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--stage-glass); }
.stage__gauge-bar { display: block; height: 100%; background: var(--grad-aurora); background-size: 200% 100%; transform: scaleX(var(--stage-progress)); transform-origin: 0 50%; animation: shimmer 4s ease infinite; }

@media (max-width: 900px) {
  /* The ridge already carries the landscape on small screens: keep one chip. */
  .stage__art--party, .stage__art--wind { display: none; }
  .stage__art--music { top: 4%; right: 3%; width: 118px; opacity: 0.75; }
}

/* ---------- Marquee ----------
   Two identical tracks side by side, each shifted by exactly its own width, so
   the second one always lands where the first started: no seam, no gap. */
.marquee {
  display: flex; overflow: hidden; margin-bottom: var(--sp-6);
  padding-block: var(--sp-4); border-bottom: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; flex: none; align-items: center; gap: var(--sp-6); min-width: 100%; justify-content: space-evenly; animation: marquee 34s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-display); font-size: var(--fs-lg); text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-muted); white-space: nowrap; }
.marquee__item .icon { color: var(--brand); }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Vibe band ---------- */
.vibe { display: grid; gap: var(--sp-5); }
.vibe__grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.vibe__card { --mx: 50%; --my: 0%; --vibe-tint: var(--grad-aurora); position: relative; overflow: hidden; display: grid; gap: var(--sp-3); align-content: start; padding: var(--sp-5); }
.vibe__card > * { position: relative; z-index: 1; }
.vibe__card--music { --vibe-tint: var(--grad-glacier); }
.vibe__card--party { --vibe-tint: var(--grad-sunset); }
.vibe__card--wind { --vibe-tint: var(--grad-lagoon); }
.vibe__card--aurora { --vibe-tint: var(--grad-aurora); }
a.vibe__card { color: var(--text); text-decoration: none; grid-template-rows: auto auto 1fr auto; }
.vibe__card:focus-visible::after { opacity: 1; }
.vibe__cta { justify-self: start; }
.vibe__head .section-title { margin-bottom: var(--sp-5); }
/* Soft tint and pointer spotlight: app.js writes --mx/--my, both sit at rest
   values so the effect never depends on scripting. */
.vibe__card::before { content: ""; position: absolute; top: -42%; right: -32%; width: 250px; height: 250px; border-radius: 50%; background: var(--vibe-tint); filter: blur(52px); opacity: 0.2; transition: opacity var(--t) var(--ease), transform var(--t-slow) var(--ease); }
.vibe__card:hover::before { opacity: 0.38; transform: scale(1.18); }
.vibe__card::after { content: ""; position: absolute; inset: 0; z-index: 0; opacity: 0; background: radial-gradient(230px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.45), transparent 62%); transition: opacity var(--t) var(--ease); pointer-events: none; }
.vibe__card:hover::after, .vibe__card:focus-within::after { opacity: 1; }
.vibe__art { width: 150px; max-width: 62%; }
.vibe__title { margin: 0; font-size: var(--fs-xl); }

/* ---------- Art: inline SVG scenes ----------
   Parts are positioned with attributes; CSS only animates inner wrappers, so
   no stylesheet rule can accidentally cancel a placement transform. */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art--music { color: var(--c-violet); }
.art-disc__plate { fill: var(--art-plate, var(--surface)); stroke: currentColor; stroke-width: 2.5; }
.art-disc__groove { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.45; }
.art-disc__label { fill: currentColor; opacity: 0.85; }
.art-disc__spindle { fill: var(--surface); }
.art-disc__arm { fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; }
circle.art-disc__arm { fill: currentColor; }
.art-music__disc { transform-origin: 120px 104px; animation: spin 9s linear infinite; }
.art-note__head, .art-note__flag { fill: currentColor; }
.art-note__stem { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.art-music__note-in--1 { animation: note-float 5.5s var(--ease) infinite alternate; }
.art-music__note-in--2 { animation: note-float 4.2s var(--ease) -1.4s infinite alternate; }
@keyframes note-float { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-16px) rotate(7deg); } }
.art-eq__bar { fill: currentColor; transform-box: fill-box; transform-origin: 50% 100%; animation: eq 1.1s var(--ease) infinite alternate; }
@keyframes eq { from { transform: scaleY(0.32); } to { transform: scaleY(1); } }
.art-eq__bar--1 { animation-delay: -0.05s; }
.art-eq__bar--2 { animation-delay: -0.42s; }
.art-eq__bar--3 { animation-delay: -0.18s; }
.art-eq__bar--4 { animation-delay: -0.66s; }
.art-eq__bar--5 { animation-delay: -0.3s; }
.art-eq__bar--6 { animation-delay: -0.78s; }
.art-eq__bar--7 { animation-delay: -0.12s; }
.art-eq__bar--8 { animation-delay: -0.55s; }

.art--party { color: var(--c-amber); }
.art-ball__shell { fill: var(--art-shell, var(--surface)); stroke: currentColor; stroke-width: 2.5; }
.art-ball__facets { fill: none; stroke: currentColor; stroke-width: 1.1; opacity: 0.5; }
.art-ball__glints path { fill: currentColor; opacity: 0; animation: glint 4s var(--ease) infinite; }
.art-ball__glints path:nth-child(2) { animation-delay: -0.8s; }
.art-ball__glints path:nth-child(3) { animation-delay: -1.6s; }
.art-ball__glints path:nth-child(4) { animation-delay: -2.4s; }
.art-ball__glints path:nth-child(5) { animation-delay: -3.2s; }
@keyframes glint { 0%, 72%, 100% { opacity: 0; } 12%, 42% { opacity: 0.9; } }
.art-party__ball { transform-origin: 120px 84px; animation: spin 16s linear infinite; }
.art-ball__cord { fill: none; stroke: currentColor; stroke-width: 2; opacity: 0.5; }
.art-beam path { fill: currentColor; filter: blur(1.5px); }
.art-beam { transform-origin: 120px 84px; animation: beam 5.5s var(--ease) infinite alternate; }
.art-beam--1 { animation-delay: -0.2s; }
.art-beam--2 { animation-delay: -1.1s; animation-duration: 6.4s; }
.art-beam--3 { animation-delay: -2.3s; animation-duration: 7.1s; }
.art-beam--4 { animation-delay: -3.2s; animation-duration: 6.8s; }
.art-beam--5 { animation-delay: -4.4s; animation-duration: 5.9s; }
@keyframes beam {
  from { opacity: 0.08; transform: rotate(-9deg) scaleY(0.9); }
  to { opacity: 0.55; transform: rotate(9deg) scaleY(1.06); }
}
.art-confetti__bit { fill: currentColor; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: confetti-fall 5.5s linear infinite; }
@keyframes confetti-fall {
  0% { opacity: 0; transform: translate(0, -34px) rotate(0deg); }
  14% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(var(--dx, 16px), 250px) rotate(520deg); }
}
.art-confetti__bit--1 { --dx: 22px; animation-delay: -0.2s; }
.art-confetti__bit--2 { --dx: -18px; animation-delay: -1.1s; }
.art-confetti__bit--3 { --dx: 10px; animation-delay: -2.4s; }
.art-confetti__bit--4 { --dx: -26px; animation-delay: -3.1s; }
.art-confetti__bit--5 { --dx: 16px; animation-delay: -4.2s; }
.art-confetti__bit--6 { --dx: -12px; animation-delay: -0.7s; }
.art-confetti__bit--7 { --dx: 24px; animation-delay: -1.8s; }
.art-confetti__bit--8 { --dx: -20px; animation-delay: -2.9s; }
.art-confetti__bit--9 { --dx: 14px; animation-delay: -3.6s; }
.art-confetti__bit--10 { --dx: -16px; animation-delay: -4.6s; }
.art-confetti__bit--11 { --dx: 20px; animation-delay: -5s; }
.art-confetti__bit--12 { --dx: -22px; animation-delay: -1.4s; }

.art--wind { --art-ridge-back: var(--surface-2); --art-ridge-front: var(--border-strong); --art-ridge-snow: var(--surface); color: var(--c-cyan); }
.art-gust { animation: gust-drift 9s var(--ease) infinite alternate; }
.art-gust--1 { animation-duration: 7.5s; }
.art-gust--2 { animation-duration: 9.5s; animation-delay: -2s; opacity: 0.82; }
.art-gust--3 { animation-duration: 11s; animation-delay: -4s; opacity: 0.62; }
@keyframes gust-drift { from { transform: translateX(-14px); } to { transform: translateX(16px); } }
.art-gust__line { stroke-dasharray: 74 260; animation: gust-draw 6s var(--ease) infinite alternate; }
.art-gust__curl { opacity: 0.6; }
.art-gust__line, .art-gust__curl { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
@keyframes gust-draw { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -250; } }
.art-spark { fill: currentColor; transform-box: fill-box; transform-origin: 50% 50%; }
.art-spark--1 { animation: spark-fly 6.5s var(--ease) infinite; }
.art-spark--2 { animation: spark-fly 8.5s var(--ease) -3s infinite; }
@keyframes spark-fly {
  0% { opacity: 0; transform: translate(-26px, 16px) scale(0.6); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(38px, -22px) scale(1.1); }
}
.art-ridge--back { fill: var(--art-ridge-back, var(--border)); }
.art-ridge__slope { fill: var(--art-ridge-front, var(--surface-2)); }
.art-ridge__snow { fill: var(--art-ridge-snow, var(--surface)); }

@media (prefers-reduced-motion: reduce) {
  .art-party__confetti, .art-wind__sparks { display: none; }
}

/* ---------- Gallery / lightbox (albums) ---------- */
.gallery-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.gallery-item { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 1; background: var(--surface-2); border: none; padding: 0; cursor: zoom-in; box-shadow: var(--shadow-sm); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease), filter var(--t); }
.gallery-item:hover img { transform: scale(1.08); filter: saturate(1.2); }
.gallery-item__overlay { position: absolute; inset: auto 0 0 0; display: flex; gap: var(--sp-1); justify-content: flex-end; padding: var(--sp-2); background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent); opacity: 0; transition: opacity var(--t); }
.gallery-item:hover .gallery-item__overlay, .gallery-item:focus-within .gallery-item__overlay { opacity: 1; }
.album-card { overflow: hidden; padding: 0; text-decoration: none; color: inherit; display: block; }
.album-card__cover { aspect-ratio: 16 / 10; background: var(--grad-glacier); overflow: hidden; display: grid; place-items: center; color: var(--text-inverse); }
.album-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.album-card:hover .album-card__cover img { transform: scale(1.06); }
.album-card__body { padding: var(--sp-4); display: grid; gap: var(--sp-1); }
.lightbox { position: fixed; inset: 0; z-index: 97; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3); padding: var(--sp-4); background: rgba(6, 4, 16, 0.92); animation: fade-in var(--t) var(--ease); }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 86vh; margin: 0 auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); animation: pop var(--t) var(--ease); }
.lightbox__close { position: absolute; top: var(--sp-4); right: var(--sp-4); }
.lightbox__counter { position: absolute; bottom: var(--sp-4); left: 50%; transform: translateX(-50%); color: var(--text-inverse); font-size: var(--fs-sm); }

/* ---------- QR / tickets ---------- */
.qr-card { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; }
.qr-card img { width: min(280px, 100%); border-radius: var(--radius); background: #fff; padding: var(--sp-2); box-shadow: var(--shadow); }
.ticket { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-lg); }
.ticket__head { padding: var(--sp-5); color: var(--text-inverse); background: var(--grad-aurora); background-size: 200% 200%; animation: shimmer 6s ease infinite; }
.ticket__body { padding: var(--sp-5); display: grid; gap: var(--sp-3); }
.code-display { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-xl); letter-spacing: 0.15em; font-weight: var(--fw-bold); }
.scanner { width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); border: 2px dashed var(--border-strong); }

/* ---------- Raffle draw animation ---------- */
.draw-stage { display: grid; place-items: center; gap: var(--sp-4); padding: var(--sp-7) var(--sp-4); border-radius: var(--radius-lg); background: var(--grad-aurora); background-size: 200% 200%; animation: shimmer 4s ease infinite; color: var(--text-inverse); text-align: center; overflow: hidden; position: relative; }
.draw-stage__name { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 3.4rem); font-weight: var(--fw-bold); min-height: 1.2em; }
.draw-stage.is-rolling .draw-stage__name { animation: roll 90ms linear infinite; }
.draw-stage.is-winner .draw-stage__name { animation: winner 900ms var(--ease); }
@keyframes roll { 50% { transform: translateY(-4px); opacity: 0.7; } }
@keyframes winner { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.confetti { position: absolute; top: -10px; width: 10px; height: 14px; border-radius: 2px; animation: confetti 2.8s linear forwards; }
@keyframes confetti { to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; } }

.countdown { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.countdown__unit { display: grid; justify-items: center; min-width: 72px; padding: var(--sp-3); border-radius: var(--radius); background: var(--surface-glass); border: 1px solid var(--border); }
.countdown__num { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.countdown__label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; }

/* ---------- Error page ---------- */
.error-page { display: grid; place-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-8) var(--sp-4); }
.error-page__code { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 9rem); font-weight: var(--fw-bold); line-height: 1; background: var(--grad-aurora); -webkit-background-clip: text; background-clip: text; color: transparent; animation: bob 4s ease-in-out infinite; }

/* ---------- Detail lists ---------- */
.detail-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-5); margin: 0; }
.detail-list dt { color: var(--text-muted); font-size: var(--fs-sm); }
.detail-list dd { margin: 0; font-weight: var(--fw-medium); }
@media (max-width: 560px) { .detail-list { grid-template-columns: 1fr; } .detail-list dd { margin-bottom: var(--sp-2); } }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .sidebar, .topbar, .site-header, .aurora, .toast-region, .page-actions, .no-print { display: none !important; }
  .app-shell { display: block; }
  body { background: #fff; }
  /* The company stage prints as plain text: no gradient, no motion, no art. */
  .stage__scene, .stage__gauge, .stage__scroll, .marquee, .vibe__art { display: none !important; }
  .stage { min-height: 0; margin-top: 0; color: #000; background: none; box-shadow: none; }
  .stage__inner { padding-block: 0; }
  .stage__title { text-shadow: none; }
  .stage__lead, .stage__eyebrow, .stage__scroll-label { color: #000; }
  .stage__eyebrow { background: none; border-color: #999; }
  .stage__word { animation: none !important; }
  .btn--stage, .btn--stage-ghost { --btn-bg: #fff; --btn-fg: #000; --btn-border: #666; }
}

/* Heading size utilities for semantic headings that need another visual size. */
.h2 { font-size: var(--fs-2xl); }
.h3 { font-size: var(--fs-xl); }

/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }
