/* ──────────────────────────────────────────────────────────────────────
   Crwdly organiser portal — shared styles
   Brand tokens from PRODUCT.md:
   - Warm white #FAFAF8 (never pure white)
   - Electric blue #0057FF (primary action)
   - Pink #FF3D6B (secondary)
   - Yellow #FFE566 (section break only)
   - DM Sans 400/500/600/700/800
   ────────────────────────────────────────────────────────────────────── */

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

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F4F4F0;
  --surface-3: #ECECE6;
  --text: #0A0A0A;
  --text-2: rgba(10, 10, 10, 0.65);
  --muted: rgba(10, 10, 10, 0.45);
  --border: rgba(10, 10, 10, 0.08);
  --border-strong: rgba(10, 10, 10, 0.16);

  --blue: #0057FF;
  --blue-hover: #0048D6;
  --blue-tint: #EEF3FF;
  --pink: #FF3D6B;
  --pink-tint: #FFF0F3;
  --yellow: #FFE566;
  --yellow-tint: #FFFBE6;
  --green: #1E8F5A;
  --green-tint: #EAF7E5;
  --red: #E8503A;
  --red-tint: #FCEEEB;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(10,10,10,0.04), 0 0 0 0.5px rgba(10,10,10,0.05);
  --shadow: 0 1px 3px rgba(10,10,10,0.06), 0 4px 12px rgba(10,10,10,0.04);
  --shadow-lg: 0 4px 16px rgba(10,10,10,0.08), 0 24px 48px rgba(10,10,10,0.06);

  --hdr: 56px;
}

html, body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Top bar */
.cr-topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--hdr);
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 18px;
}
.cr-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 14px;
  letter-spacing: -0.01em;
}
.cr-brand-mark {
  width: 24px; height: 24px;
  background: var(--blue);
  border-radius: 6px;
}
.cr-topbar-nav {
  display: flex; gap: 4px;
  margin-left: 18px;
}
.cr-topbar-nav a {
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 120ms, color 120ms;
  text-decoration: none;
}
.cr-topbar-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.cr-topbar-nav a.active { color: var(--text); background: var(--surface-2); }
.cr-topbar-spacer { flex: 1; }
.cr-topbar-right { display: flex; align-items: center; gap: 10px; }

/* Page wrapper */
.cr-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.cr-page-narrow {
  max-width: 440px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}

/* Hero / page header */
.cr-hd {
  margin-bottom: 32px;
}
.cr-hd-eyebrow {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.cr-hd-h1 {
  font-size: 32px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15;
  color: var(--text);
}
.cr-hd-sub {
  font-size: 15px; color: var(--text-2);
  margin-top: 8px; line-height: 1.55;
}

/* Forms */
.cr-form { display: flex; flex-direction: column; gap: 14px; }
.cr-field { display: flex; flex-direction: column; gap: 5px; }
.cr-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted);
}
.cr-input, .cr-textarea, .cr-select {
  width: 100%;
  font-family: inherit; font-size: 14px;
  background: var(--surface);
  color: var(--text);
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 11px 14px;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.cr-input:focus, .cr-textarea:focus, .cr-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}
.cr-input::placeholder { color: var(--muted); }
.cr-textarea { min-height: 100px; resize: vertical; }
.cr-hint { font-size: 11px; color: var(--muted); }
.cr-error { font-size: 12px; color: var(--red); }

/* Buttons */
.cr-btn {
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: none; cursor: pointer;
  transition: background 120ms, opacity 120ms, transform 120ms;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none;
}
.cr-btn:active { transform: translateY(0.5px); }
.cr-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cr-btn-primary { background: var(--blue); color: #fff; }
.cr-btn-primary:hover { background: var(--blue-hover); }
.cr-btn-secondary { background: var(--surface); color: var(--text); border: 0.5px solid var(--border-strong); }
.cr-btn-secondary:hover { background: var(--surface-2); }
.cr-btn-ghost { background: transparent; color: var(--text-2); }
.cr-btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.cr-btn-block { width: 100%; padding: 13px 18px; }
.cr-btn-lg { padding: 14px 24px; font-size: 14px; }

/* Card */
.cr-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* Status badges */
.cr-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.cr-badge-live    { background: var(--green); color: #fff; }
.cr-badge-upcoming{ background: var(--blue);  color: #fff; }
.cr-badge-draft   { background: var(--surface-3); color: var(--text-2); }
.cr-badge-ended   { background: transparent; color: var(--muted); }

/* Toast */
.cr-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 100px);
  background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 220ms cubic-bezier(0.16,1,0.3,1), opacity 220ms;
  opacity: 0;
}
.cr-toast.show { transform: translate(-50%, 0); opacity: 1; }
.cr-toast.err { background: var(--red); }
.cr-toast.ok  { background: var(--green); }

/* Brand banner / split layout for auth */
.cr-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 880px) {
  .cr-auth-shell { grid-template-columns: 1.05fr 1fr; }
}
.cr-auth-pane {
  display: flex; flex-direction: column;
  padding: 48px 56px;
  min-height: 100vh;
}
.cr-auth-pane-brand {
  background: var(--text);
  color: rgba(255,255,255,0.85);
  display: none;
}
@media (min-width: 880px) {
  .cr-auth-pane-brand { display: flex; }
}
.cr-auth-brand-mark {
  font-weight: 800; font-size: 16px; color: #fff;
  letter-spacing: -0.01em;
}
.cr-auth-quote {
  margin-top: auto;
}
.cr-auth-quote-text {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.2;
  color: #fff;
  max-width: 420px;
}
.cr-auth-quote-author {
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-top: 18px;
}
.cr-auth-form-pane {
  max-width: 440px; margin: 0 auto;
  width: 100%;
  justify-content: center;
}
.cr-auth-form-pane > .cr-hd { margin-bottom: 28px; }
.cr-auth-footer {
  margin-top: 22px;
  font-size: 13px; color: var(--text-2);
}
.cr-auth-divider {
  margin: 28px 0;
  display: flex; align-items: center; gap: 14px;
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.cr-auth-divider::before, .cr-auth-divider::after {
  content: ''; flex: 1; height: 0.5px; background: var(--border);
}

/* Spinner */
.cr-spin {
  display: inline-block; width: 14px; height: 14px;
  border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: crSpin 700ms linear infinite;
}
@keyframes crSpin { to { transform: rotate(360deg); } }
