/* ----------------------------------------------------------------------------
   event-qr design system
   - Light, modern, mobile-first. Optimized for the registration page being
     scanned-and-filled on a phone outdoors.
   - Three surfaces: app shell (gradient), card (white with soft shadow),
     accent (indigo).
---------------------------------------------------------------------------- */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fafafd;
  --border: #e6e8ef;
  --border-strong: #d6d9e3;

  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;

  --success: #10b981;
  --success-soft: #d1fae5;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;

  /* Default theme = Bixie (emerald). [data-theme] on <html> swaps these. */
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: #d1fae5;
  --accent-grad-1: #10b981;
  --accent-grad-2: #047857;
  --bg-grad-1: #ecfdf5;
  --bg-grad-2: #f0fdfa;
  --shadow-accent-strong: rgba(16, 185, 129, 0.35);
  --shadow-accent-soft: rgba(16, 185, 129, 0.15);
}

/* Bixie — emerald green (default) */
html[data-theme="bixie"] {
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: #d1fae5;
  --accent-grad-1: #10b981;
  --accent-grad-2: #047857;
  --bg-grad-1: #ecfdf5;
  --bg-grad-2: #f0fdfa;
  --shadow-accent-strong: rgba(16, 185, 129, 0.35);
  --shadow-accent-soft: rgba(16, 185, 129, 0.15);
}

/* Cubewire — dark mode, mint + cyan (sampled from cubewire.com) */
html[data-theme="cubewire"] {
  --accent: #3FD48A;
  --accent-hover: #2AA866;
  --accent-soft: rgba(63, 212, 138, 0.10);
  --accent-grad-1: #3FD48A;
  --accent-grad-2: #06B6D4;

  /* Dark surface palette */
  --bg: #070D1D;
  --bg-grad-1: #0D1426;
  --bg-grad-2: #0A1A2A;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #F1F5F9;
  --text-2: #94A3B8;
  --muted: #64748B;

  --shadow-accent-strong: rgba(63, 212, 138, 0.30);
  --shadow-accent-soft: rgba(63, 212, 138, 0.12);
}

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 25px 50px -12px rgba(91, 108, 255, 0.15);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
input, textarea, select, button { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(900px 500px at 100% -10%, var(--bg-grad-2) 0%, transparent 60%),
    radial-gradient(800px 500px at 0% 100%, var(--bg-grad-1) 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.55 Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Cubewire dark theme — subtle dotted grid overlay on the body */
html[data-theme="cubewire"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(63, 212, 138, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 80%);
}
html[data-theme="cubewire"] .container { position: relative; z-index: 1; }

/* ─── Layout ──────────────────────────────────────────────────────────── */

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.container.narrow { max-width: 560px; }

@media (max-width: 480px) {
  .container { padding: 20px 16px 48px; }
}

/* ─── Header / brand ─────────────────────────────────────────────────── */

header.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
header.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 14px var(--shadow-accent-strong);
  overflow: hidden;
}

/* When the logo box contains a real brand image, swap the gradient for
   a white tile so the logo reads cleanly. */
header.brand .logo.brand-logo-img:has(img) {
  background: #fff;
  border: 1px solid var(--border);
  padding: 5px;
  box-shadow: 0 4px 12px var(--shadow-accent-soft);
}
header.brand .logo.brand-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
header.brand h1 {
  font-size: 17px;
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 600;
}
header.brand .sub {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 1px;
}

/* ─── Card ────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.card.elevated { box-shadow: var(--shadow-lg); }
.card > h2 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 650;
  line-height: 1.25;
}
.card > h2 + .desc { margin-top: 0; }
.card .desc {
  color: var(--text-2);
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.55;
}

@media (max-width: 480px) {
  .card { padding: 22px 18px; border-radius: 14px; }
  .card > h2 { font-size: 20px; }
}

/* ─── Form controls ──────────────────────────────────────────────────── */

label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: 0.005em;
}
label .req {
  color: var(--accent);
  margin-left: 2px;
  font-weight: 600;
}

/* Style all text-like inputs uniformly. Includes inputs without an explicit
   `type` attribute (which default to text but wouldn't match input[type="text"]). */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="range"]):not([type="color"]),
textarea,
select {
  width: 100%;
  min-height: var(--tap);
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* 16px = prevents iOS auto-zoom on focus */
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder { color: var(--muted); }
input:not([type="checkbox"]):not([type="radio"]):hover,
textarea:hover,
select:hover { border-color: var(--border-strong); }
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--shadow-accent-soft);
}
textarea { min-height: 96px; resize: vertical; padding-top: 12px; }

/* Native select arrow */
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.5 5.25L7 8.75L10.5 5.25' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* Checkbox row */
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
  min-height: var(--tap);
  margin-bottom: 0;
}
.checkbox-inline:hover { border-color: var(--border-strong); }
.checkbox-inline:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.checkbox-inline input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}

/* ─── Field group spacing (registration form) ────────────────────────── */

.field {
  margin-bottom: 18px;
}
.field:last-of-type { margin-bottom: 0; }
.field .hint {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}

/* ─── Grid rows (admin / create) ─────────────────────────────────────── */

.row { display: grid; gap: 14px; }
.row.two { grid-template-columns: 1fr 1fr; }
.row.three { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 640px) {
  .row.two, .row.three { grid-template-columns: 1fr; }
}

/* ─── Field-builder row (used on create page) ────────────────────────── */

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.1fr) auto;
  grid-template-areas: "label key type actions";
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.field-row .cell-label   { grid-area: label; min-width: 0; }
.field-row .cell-key     { grid-area: key;   min-width: 0; }
.field-row .cell-type    { grid-area: type;  min-width: 0; }
.field-row .cell-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }
.field-row .cell-opts    { grid-column: 1 / -1; }

.field-row .cell-actions .checkbox-inline {
  padding: 8px 12px;
  min-height: auto;
  white-space: nowrap;
}
.field-row .cell-actions .checkbox-inline span { font-size: 13px; }
.field-row .cell-actions button.icon {
  width: 40px; min-width: 40px;
  padding: 0;
  height: 40px;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label   label"
      "key     type"
      "actions actions";
    padding: 12px;
    gap: 8px;
  }
  .field-row .cell-actions {
    justify-content: space-between;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
    margin-top: 2px;
  }
}
@media (max-width: 420px) {
  .field-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "key"
      "type"
      "actions";
  }
}

/* ─── Buttons ────────────────────────────────────────────────────────── */

button, .btn {
  -webkit-appearance: none;
  appearance: none;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 22px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.005em;
  min-height: var(--tap);
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px var(--shadow-accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--accent-hover); box-shadow: 0 4px 12px var(--shadow-accent-strong); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button.full, .btn.full { width: 100%; }
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  box-shadow: none;
}
button.ghost:hover, .btn.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: none;
}
button.danger, .btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
button.danger:hover, .btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
button.small, .btn.small {
  padding: 8px 14px;
  font-size: 13.5px;
  min-height: 36px;
  font-weight: 550;
}

/* Loading spinner inside button */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.toolbar.right { justify-content: flex-end; }

/* ─── Notices ────────────────────────────────────────────────────────── */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--shadow-accent-soft);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 14px;
}
.notice.danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.3);
  color: #7f1d1d;
}
.notice .icon { font-size: 16px; line-height: 1.4; flex-shrink: 0; }

/* ─── Success result (create page) ───────────────────────────────────── */

.result {
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 80%);
  border: 1px solid var(--success-soft);
}
.result h3 {
  margin: 0 0 6px;
  color: var(--success);
  font-size: 18px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result h3::before {
  content: "✓";
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: grid; place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.qr-wrap {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}
.qr-wrap img {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.qr-wrap .meta { flex: 1; min-width: 260px; }

.code {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
  color: var(--text);
  margin-bottom: 14px;
}

/* ─── Table (admin) ──────────────────────────────────────────────────── */

.table-wrap {
  margin: 0 -28px -28px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
}
@media (max-width: 480px) {
  .table-wrap { margin: 0 -18px -22px; }
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}
th {
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
}
tr:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pill::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.delivered { background: var(--success-soft); color: #065f46; }
.pill.pending { background: var(--warn-soft); color: #92400e; }
.pill.failed { background: var(--danger-soft); color: #991b1b; }
.pill.skipped { background: #f1f5f9; color: #475569; }

/* ─── States ─────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-2);
}
.empty-state .emoji {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.6;
}
.empty-state p { margin: 0; font-size: 14px; }

.muted { color: var(--text-2); font-size: 13.5px; }
.center { text-align: center; }
.spacer { height: 14px; }
.hr { height: 1px; background: var(--border); margin: 22px 0; border: 0; }

/* ─── Page header (registration page hero) ───────────────────────────── */

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 12px;
}
.hero {
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  color: #fff;
  padding: 32px 28px 28px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 60%);
  pointer-events: none;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero p {
  margin: 0;
  font-size: 15px;
  opacity: 0.95;
  line-height: 1.5;
}
.hero-body { padding: 28px; }
.hero-body > h3 {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 480px) {
  .hero { padding: 26px 22px 22px; border-radius: 0; }
  .hero h1 { font-size: 24px; }
  .hero-body { padding: 22px 18px; }
  .hero-card { border-radius: 18px; }
}

/* ─── Registration page (public-facing, scanned via QR) ──────────────── */

.reg-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  margin-top: 24px;
  overflow: visible;
}

.reg-hero {
  padding: 36px 32px 28px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}

/* Bixie wordmark lockup — icon + "Bixie" text rendered inline so it
   matches the shape of the Cubewire SVG wordmark. */
.reg-wordmark--bixie {
  align-items: center;
  gap: 10px;
}
.reg-wordmark--bixie img {
  height: 34px;
  width: 34px;
  max-width: none;
}
.reg-wordmark--bixie span {
  font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.reg-hero h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}
.reg-desc {
  margin: 0 auto;
  max-width: 380px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
}

.reg-body {
  padding: 32px 32px 36px;
}
.reg-body .field { margin-bottom: 18px; }
.reg-body label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 7px;
  display: block;
}
.reg-body .req { color: var(--accent); margin-left: 2px; }

.reg-body button[type="submit"] {
  margin-top: 6px;
  height: 52px;
  font-size: 15.5px;
  letter-spacing: 0.005em;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  box-shadow: 0 8px 20px var(--shadow-accent-strong);
}
.reg-body button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  filter: brightness(1.05);
  box-shadow: 0 12px 28px var(--shadow-accent-strong);
}

.reg-footer {
  text-align: center;
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.reg-footer strong { color: var(--text-2); font-weight: 600; }

@media (max-width: 480px) {
  .reg-card { margin-top: 20px; border-radius: 18px; }
  .reg-hero { padding: 32px 22px 24px; }
  .reg-hero h1 { font-size: 22px; }
  .reg-body { padding: 24px 20px 28px; }
  .reg-wordmark--bixie img { height: 30px; width: 30px; }
  .reg-wordmark--bixie span { font-size: 20px; }
}

/* ─── Cubewire-themed register page overrides (dark mode) ──────────────── */

html[data-theme="cubewire"] .reg-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(63, 212, 138, 0.04),
    inset 0 1px 0 rgba(255,255,255,0.06);
  margin-top: 24px;
}
html[data-theme="cubewire"] .reg-hero { border-bottom-color: rgba(255,255,255,0.08); }
.reg-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.reg-wordmark img {
  height: 36px;
  width: auto;
  max-width: 80%;
  display: block;
}
@media (max-width: 480px) {
  .reg-wordmark { margin-bottom: 18px; }
  .reg-wordmark img { height: 30px; }
}
html[data-theme="cubewire"] .reg-hero h1 {
  font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.025em;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 40%, #3FD48A 65%, #06B6D4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="cubewire"] .reg-desc {
  color: #94A3B8;
  font-size: 14.5px;
}
html[data-theme="cubewire"] .brand-mark {
  background: #0F172A;
  border: 1px solid rgba(63, 212, 138, 0.25);
  box-shadow:
    0 0 0 6px rgba(7, 13, 29, 1),
    0 16px 40px rgba(63, 212, 138, 0.25),
    0 4px 10px rgba(0,0,0,0.5);
}
html[data-theme="cubewire"] .reg-body label {
  color: #94A3B8;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
}
html[data-theme="cubewire"] .reg-body input,
html[data-theme="cubewire"] .reg-body textarea,
html[data-theme="cubewire"] .reg-body select {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #F1F5F9;
}
html[data-theme="cubewire"] .reg-body input::placeholder,
html[data-theme="cubewire"] .reg-body textarea::placeholder {
  color: #475569;
}
html[data-theme="cubewire"] .reg-body input:focus,
html[data-theme="cubewire"] .reg-body textarea:focus,
html[data-theme="cubewire"] .reg-body select:focus {
  border-color: #3FD48A;
  background: rgba(63, 212, 138, 0.06);
  box-shadow: 0 0 0 4px rgba(63, 212, 138, 0.12);
}
html[data-theme="cubewire"] .reg-body button[type="submit"] {
  color: #07101F;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-weight: 700;
  background: linear-gradient(135deg, #3FD48A, #06B6D4);
  box-shadow:
    0 10px 30px rgba(63, 212, 138, 0.35),
    0 0 0 1px rgba(63, 212, 138, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.25);
}
html[data-theme="cubewire"] .reg-body button[type="submit"]:hover {
  filter: brightness(1.08);
  box-shadow:
    0 14px 36px rgba(63, 212, 138, 0.45),
    0 0 0 1px rgba(63, 212, 138, 0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
}
html[data-theme="cubewire"] .reg-footer { color: #475569; }
html[data-theme="cubewire"] .reg-footer strong { color: #94A3B8; }

/* Success page on dark */
html[data-theme="cubewire"] .success-page {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  color: #F1F5F9;
}
html[data-theme="cubewire"] .success-page h2 {
  font-family: 'Space Grotesk', Inter, sans-serif;
  color: #fff;
}
html[data-theme="cubewire"] .success-page p { color: #94A3B8; }

/* ─── Success page (post-registration) ───────────────────────────────── */

.success-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  margin-top: 12px;
  animation: rise 0.4s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.success-page .check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  font-size: 42px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.success-page h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.015em;
  font-weight: 650;
}
.success-page p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Loading state ──────────────────────────────────────────────────── */

.loading-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 64px 28px;
  text-align: center;
  margin-top: 12px;
}
.loading-card .spinner {
  width: 32px; height: 32px;
  border-width: 3px;
  color: var(--accent);
  margin: 0 auto 14px;
  display: block;
}
.loading-card p { color: var(--text-2); font-size: 14px; margin: 0; }

/* ─── Stat badge (admin count) ───────────────────────────────────────── */

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.stat .n { font-size: 15px; }

/* ─── Theme chip / signed-in pill ────────────────────────────────────── */

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip > span:not(.avatar) {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.user-chip a { white-space: nowrap; }
.user-chip .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-grad-1), var(--accent-grad-2));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* On small screens, hide the email — keep avatar + Sign out link */
@media (max-width: 480px) {
  .user-chip > span:not(.avatar) { display: none; }
  .user-chip { padding: 4px 10px 4px 4px; }
}

/* Theme picker (radio cards on create page) */
.theme-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.theme-option {
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .15s ease, background .15s ease;
}
.theme-option:hover { border-color: var(--border-strong); }
.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.theme-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-swatch {
  width: 32px; height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.theme-swatch.bixie { background: linear-gradient(135deg, #10b981, #047857); }
.theme-swatch.cubewire { background: linear-gradient(135deg, #3FD48A, #06B6D4); }

.theme-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
  display: grid;
  place-items: center;
}
.theme-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.theme-option .label { font-weight: 600; font-size: 14.5px; }
.theme-option .desc { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }

/* ─── Mobile-only helpers ───────────────────────────────────────────── */

.mobile-only { display: none; }
@media (max-width: 640px) { .mobile-only { display: block; } }
@media (min-width: 641px) { .desktop-only { display: block; } }
