@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Manrope:wght@400;500;600;700;800&display=swap');

/**
 * WKND Design System v1.1
 * Single source of truth for all user-facing screens.
 * Every template and inline page links this file.
 *
 * Tokens → Components → Utilities
 */

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --font-body:    "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --bg:           #F2F0FA;
  --bg-card:      #FFFCFF;
  --purple:       #7C3AED;
  --purple-dk:    #6D28D9;
  --purple-lt:    #EDE9FE;
  --purple-xlt:   #F5F3FF;
  --pink:         #EC4899;
  --orange:       #F97316;
  --dark:         #0F0A1E;
  --body:         #111827;
  --muted:        #6B7280;
  --faint:        #9CA3AF;
  --border:       rgba(124, 58, 237, .09);
  --border-soft:  rgba(0, 0, 0, .06);
  --shadow-sm:    0 1px 3px rgba(0,0,0,.05);
  --shadow-card:  0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(124,58,237,.07);
  --shadow-raise: 0 8px 24px rgba(124,58,237,.13);
  --shadow-float: 0 18px 48px rgba(59, 32, 109, .14);
  --radius-xs:    8px;
  --radius-sm:    12px;
  --radius-md:    16px;
  --radius-lg:    20px;
  --radius-pill:  999px;
  --nav-h:        52px;
  --page-max:     960px;
  --content-max:  760px;
  --surface:      var(--bg-card);
  --surface-muted: var(--purple-xlt);
  --ink:          var(--body);
  --text-muted:   var(--muted);
  --line:         #E5E7EB;
  --focus:        rgba(124, 58, 237, .28);
  --success-bg:   #ECFDF5;
  --warning-bg:   #FFFBEB;
  --shell-sm:     480px;
  --shell-md:     900px;
  --space-page:   20px;
  --control-min:  44px;
  --wknd-public-sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --wknd-public-mono: "DM Mono", ui-monospace, monospace;
}

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

/* ── Base ───────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--body);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Mobile operating-surface foundations */
button, a, input, select, textarea { touch-action: manipulation; }
@supports (padding: max(0px)) {
  .wknd-safe-bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
.wknd-dialog-close {
  width: var(--control-min);
  height: var(--control-min);
  min-width: var(--control-min);
  min-height: var(--control-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Shared constraints for opt-in dialogs and bottom sheets. */
.wknd-dialog,
.wknd-sheet {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - max(32px, env(safe-area-inset-top)) - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.wknd-sheet {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

/* ── Sticky glass nav ───────────────────────────────────── */
.wknd-nav-wrap {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(242, 240, 250, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.wknd-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  max-width: var(--page-max);
  margin: 0 auto;
  height: var(--nav-h);
  gap: 12px;
}
.wknd-logo {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: var(--purple);
  text-decoration: none;
  flex-shrink: 0;
}
.wknd-logo:hover { color: var(--purple-dk); }
.wknd-nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.wknd-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wknd-nav-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  transition: color .15s, background .15s;
  min-height: var(--control-min);
}
.wknd-nav-link:hover { color: var(--purple); background: var(--purple-xlt); }

/* ── Buttons ────────────────────────────────────────────── */
.wknd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  min-height: 44px;
}
.wknd-btn:active { transform: scale(.98); }

.wknd-btn-primary {
  background: var(--purple);
  color: #fff;
}
.wknd-btn-primary:hover { background: var(--purple-dk); }
.wknd-btn-primary:focus-visible { outline: 3px solid var(--purple-lt); outline-offset: 2px; }

.wknd-btn-ghost {
  background: var(--bg-card);
  color: var(--purple);
  border: 1.5px solid rgba(124, 58, 237, .22);
}
.wknd-btn-ghost:hover { border-color: var(--purple); background: var(--purple-xlt); }

.wknd-btn-sm  { padding: 7px 14px; font-size: 12px; }
.wknd-btn-lg  { padding: 13px 28px; font-size: 16px; }
.wknd-btn-full { width: 100%; }
.wknd-btn-danger { background: #FEF2F2; color: #B42318; }
.wknd-btn-danger:hover { background: #FEE2E2; }

/* ── Cards ──────────────────────────────────────────────── */
.wknd-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1.5px solid rgba(124, 58, 237, .07);
}
.wknd-card-body  { padding: 20px; }
.wknd-card-hover { transition: box-shadow .15s, transform .12s; }
.wknd-card-hover:hover { box-shadow: var(--shadow-raise); transform: translateY(-2px); }

/* ── Forms ──────────────────────────────────────────────── */
.wknd-field { margin-bottom: 16px; }
.wknd-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.wknd-input {
  width: 100%;
  background: #fafafa;
  border: 1.5px solid #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--dark);
  outline: none;
  transition: border-color .15s, background .15s;
  line-height: 1.4;
}
.wknd-input:focus { border-color: var(--purple); background: #fff; }
.wknd-input::placeholder { color: var(--faint); }
.wknd-input-select { appearance: none; -webkit-appearance: none; padding-right: 40px; }

/* ── Chips / badges ─────────────────────────────────────── */
.wknd-chip {
  display: inline-block;
  background: var(--purple-lt);
  color: var(--purple);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}
.wknd-chip-sm { padding: 3px 9px; font-size: 11px; }
.wknd-chip-muted { background: #F3F4F6; color: var(--muted); }

/* ── Shared active loading panel ────────────────────────── */
.wknd-loading-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid rgba(124, 58, 237, .14);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #fff, var(--purple-xlt));
  color: var(--body);
  text-align: left;
  box-shadow: 0 6px 20px rgba(124, 58, 237, .08);
}
.wknd-loading-panel[hidden] { display: none !important; }
.wknd-loading-spinner {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 3px solid #DDD6FE;
  border-top-color: var(--purple);
  border-right-color: var(--pink);
  border-radius: 50%;
  animation: wknd-loading-spin .85s linear infinite;
}
.wknd-loading-spinner::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 2px solid rgba(249, 115, 22, .28);
  border-bottom-color: var(--orange);
  animation: wknd-loading-spin 1.2s linear infinite reverse;
}
.wknd-loading-copy { min-width: 0; flex: 1; }
.wknd-loading-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--dark);
}
.wknd-loading-detail {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.wknd-loading-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple);
}
.wknd-loading-elapsed {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--purple-lt);
  white-space: nowrap;
}
.wknd-loading-retry {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-min);
  padding: 6px 10px;
  border: 1px solid rgba(124, 58, 237, .24);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--purple-dk);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.wknd-loading-retry:hover { background: var(--purple-xlt); }
.wknd-loading-panel.is-long-wait { border-color: rgba(249, 115, 22, .26); }
.wknd-loading-panel.is-long-wait .wknd-loading-elapsed { background: #FFF7ED; color: #C2410C; }
.wknd-loading-panel.is-error { background: #FFF7F7; border-color: #FECACA; }
.wknd-loading-panel.is-error .wknd-loading-title { color: #991B1B; }
.wknd-loading-panel.is-success { background: var(--success-bg); border-color: #A7F3D0; }
.wknd-loading-panel.is-success .wknd-loading-title { color: #047857; }
.wknd-inline-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 28px 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.wknd-inline-wait::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 0 0 0 rgba(124, 58, 237, .3);
  animation: wknd-loading-pulse 1.5s ease-out infinite;
}
@keyframes wknd-loading-spin { to { transform: rotate(360deg); } }
@keyframes wknd-loading-pulse {
  0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .3); opacity: 1; }
  70% { box-shadow: 0 0 0 8px rgba(124, 58, 237, 0); opacity: .72; }
  100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); opacity: 1; }
}
@media (max-width: 420px) {
  .wknd-loading-panel { align-items: flex-start; padding: 14px; }
  .wknd-loading-meta { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .wknd-loading-spinner, .wknd-loading-spinner::after, .wknd-inline-wait::before { animation: none; }
}

/* ── Hero section ───────────────────────────────────────── */
.wknd-hero {
  text-align: center;
  padding: 52px 20px 0;
  max-width: 680px;
  margin: 0 auto;
}
.wknd-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-lt);
  color: var(--purple);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.wknd-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--dark);
}
.wknd-hero h1 em { font-style: normal; color: var(--purple); }
.wknd-hero p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 16px auto 0;
}

/* ── Page layout ────────────────────────────────────────── */
.wknd-page        { background: var(--bg); min-height: 100vh; }
.wknd-main        { min-height: 100dvh; background: var(--bg); }
.wknd-shell       { width: 100%; max-width: var(--shell-sm); margin: 0 auto; padding: 28px var(--space-page) 56px; }
.wknd-shell-wide  { width: 100%; max-width: var(--page-max); margin: 0 auto; }
.wknd-page-pad    { padding-left: var(--space-page); padding-right: var(--space-page); }
.wknd-surface     {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.wknd-section     { max-width: var(--content-max); margin: 44px auto 0; padding: 0 20px; }
.wknd-section-sm  { max-width: 520px; margin: 36px auto 0; padding: 0 20px; }
.wknd-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.wknd-section-title { font-size: 14px; font-weight: 800; color: var(--dark); }
.wknd-section-link  {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  text-decoration: none;
}
.wknd-section-link:hover { text-decoration: underline; }

/* ── Divider ────────────────────────────────────────────── */
.wknd-divider {
  border: none;
  border-top: 1px solid rgba(124, 58, 237, .08);
  margin: 32px 0;
}

/* ── Empty state ────────────────────────────────────────── */
.wknd-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.wknd-empty-icon { font-size: 36px; margin-bottom: 12px; }
.wknd-empty h3   { font-size: 16px; font-weight: 700; color: var(--body); margin-bottom: 6px; }
.wknd-empty p    { font-size: 14px; line-height: 1.55; margin-bottom: 16px; }

/* ── Toast / alert ──────────────────────────────────────── */
.wknd-alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.wknd-alert-info    { background: var(--purple-xlt); color: var(--purple); }
.wknd-alert-success { background: #ECFDF5; color: #065F46; }
.wknd-alert-warn    { background: #FFFBEB; color: #92400E; }
.wknd-alert-error   { background: #FEF2F2; color: #991B1B; }

/* ── Horizontal scroll row ──────────────────────────────── */
.wknd-hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wknd-hscroll::-webkit-scrollbar { display: none; }

/* ── Footer ─────────────────────────────────────────────── */
.wknd-footer {
  text-align: center;
  padding: 48px 24px 32px;
  color: var(--faint);
  font-size: 12px;
}
.wknd-footer a { color: var(--purple); text-decoration: none; margin: 0 6px; }
.wknd-footer a:hover { text-decoration: underline; }

/* ── Spinner ────────────────────────────────────────────── */
.wknd-spin {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(124,58,237,.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: wknd-spin .7s linear infinite;
}
@keyframes wknd-spin { to { transform: rotate(360deg); } }

/* ── Step indicator ─────────────────────────────────────── */
.wknd-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 16px 20px 0;
}
.wknd-step-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(124,58,237,.2);
  transition: background .2s, width .2s;
}
.wknd-step-dot.active { background: var(--purple); width: 18px; border-radius: 3px; }

/* ── Vendor-facing brand bar (non-sticky, minimal) ──────── */
.wknd-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.wknd-brand-bar .wknd-logo { font-size: 18px; }
.wknd-brand-bar-context {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid rgba(124,58,237,.15);
  margin-left: 10px;
}
.wknd-brand-bar-right {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.wknd-brand-bar-right:hover { color: var(--purple); }

/* ── Action-bar pill + icon pattern ─────────────────────── */
/* Matches the event-detail sticky action bar; shared across
   all vendor-facing pages (apply, RSVP, invite accept). */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 99px;
  border: 2px solid transparent;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all .18s;
  white-space: nowrap;
  line-height: 1;
  min-height: 48px;
}
.btn-pill:active { transform: scale(.97); }
.btn-pill-primary {
  background: linear-gradient(135deg, #7C3AED, #9333EA);
  color: #fff;
  border-color: transparent;
}
.btn-pill-primary:hover { filter: brightness(1.07); }
.btn-pill-ghost {
  background: #fff;
  color: #374151;
  border-color: #E5E7EB;
}
.btn-pill-ghost:hover { background: #F3F4F6; border-color: #D1D5DB; }
/* Secondary 44px icon-circle (calendar, share, etc.) */
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #F3F4F6;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  transition: background .15s;
  flex-shrink: 0;
  font-family: inherit;
}
.btn-icon:hover { background: #E5E7EB; }
.btn-icon svg { display: block; }

:where(a, button, input, select, textarea, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Test-only role controls occupy a small top-right slot, never the footer. */
#wknd-ps {
  top: max(6px, env(safe-area-inset-top)) !important;
  right: max(8px, env(safe-area-inset-right)) !important;
  bottom: auto !important;
}

/* ── Shared product-flow shell ─────────────────────────────
   Public discovery, RSVP, invite, auth, and organizer screens
   opt into this class while retaining their route-specific layout. */
.wknd-flow {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(236,72,153,.09), transparent 28rem),
    radial-gradient(circle at 95% 8%, rgba(124,58,237,.12), transparent 30rem),
    var(--bg);
}
.wknd-flow :where(h1, h2, h3, .wknd-display) {
  font-family: var(--font-display);
  letter-spacing: -.025em;
}
.wknd-flow :where(button, input, select, textarea) { font-family: inherit; }
.wknd-flow :where(input, select, textarea) {
  border-color: var(--line);
  border-radius: var(--radius-sm);
}
.wknd-flow :where(input, select, textarea):focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--focus);
  outline: none;
}
.wknd-flow :where(.wknd-flow-card, .wknd-flow-state) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.wknd-flow-state {
  max-width: 560px;
  margin: 32px auto;
  padding: clamp(28px, 6vw, 52px) 24px;
  text-align: center;
}
.wknd-flow-kicker {
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ── Public discovery entry ────────────────────────────────
   Public search, vendor profiles, and account entry points opt in with
   `.wknd-public-entry`. This preserves the operational dashboard's existing
   DM Sans language while making the outward-facing path feel continuous with
   WKND's field-guide landing pages. */
.wknd-public-entry {
  --bg: #fff8ed;
  --bg-card: #fffdf8;
  --surface: #fffdf8;
  --surface-muted: #fff1d8;
  --ink: #172335;
  --body: #172335;
  --dark: #172335;
  --muted: #596474;
  --line: #d9ddd6;
  --purple: #4e4393;
  --purple-dk: #3d3379;
  --purple-lt: #eee9ff;
  --purple-xlt: #f4f2ff;
  --focus: rgba(241, 90, 64, .42);
  font-family: var(--wknd-public-sans);
  background: var(--bg);
  color: var(--ink);
}
.wknd-public-entry :where(h1, h2, h3, .wknd-display) {
  font-family: var(--wknd-public-sans);
  letter-spacing: -.045em;
}
.wknd-public-entry :where(button, input, select, textarea) {
  font-family: var(--wknd-public-sans);
}
.wknd-public-entry :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #f15a40;
  outline-offset: 3px;
}

/* ── Responsive helpers ─────────────────────────────────── */
@media (max-width: 600px) {
  .wknd-hide-mobile { display: none !important; }
  .wknd-nav { padding: 0 16px; }
  .wknd-hero { padding: 40px 16px 0; }
  .wknd-section { padding: 0 16px; }
}
@media (min-width: 601px) {
  .wknd-hide-desktop { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
