﻿/* Grind N Grow Eventz — Worker app / public / auth (light-first)
   Marketing homepage styles live in landing.css */

:root {
  --bg: #f4f7fb;
  --bg-accent: rgba(37, 99, 235, 0.07);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --muted: rgba(15, 23, 42, 0.62);
  --faint: rgba(15, 23, 42, 0.42);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --blue: #2563eb;
  --blue-hot: #3b82f6;
  --blue-soft: rgba(37, 99, 235, 0.1);
  --radius: 0.95rem;
  --radius-sm: 0.7rem;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.22);
  --sidebar: #0b1220;
  --sidebar-2: #111827;
  --sidebar-ink: #e2e8f0;
  --sidebar-muted: rgba(226, 232, 240, 0.62);
  --ok: #065f46;
  --ok-bg: #ecfdf5;
  --err: #991b1b;
  --err-bg: #fef2f2;
  --info: #1e40af;
  --info-bg: #eff6ff;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 100% -10%, var(--bg-accent), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--blue);
}
a:hover {
  color: #1d4ed8;
}

h1, h2, h3,
.page-title,
.font-display,
.pub-brand__main,
.sidebar-brand strong,
.auth-page h1,
.card.stat strong {
  font-family: var(--display);
  letter-spacing: -0.03em;
}

.page-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 750;
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
  max-width: 42rem;
}

.muted,
.small {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}

/* ========== Public / auth shell ========== */
.shell-public {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.pub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.35rem;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.pub-brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
}
.pub-brand__main {
  font-weight: 800;
  font-size: 1.1rem;
}
.pub-brand__mark {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
}

.pub-header__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-text {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.55rem;
}
.nav-text:hover {
  color: var(--ink);
}

.pub-main {
  flex: 1;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
}

.pub-footer {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ========== App shell ========== */
.shell-app {
  display: grid;
  grid-template-columns: 15.75rem 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .shell-app {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 0;
  }
  .app-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .app-nav a {
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }
  .app-nav__logout {
    margin-top: 0 !important;
    margin-left: auto;
    border-top: none !important;
    padding-top: 0.45rem !important;
  }
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar-2) 0%, var(--sidebar) 100%);
  color: var(--sidebar-ink);
  padding: 1.25rem 0.9rem 1.5rem;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.55rem 1.1rem;
}
.sidebar-brand strong {
  font-size: 1.2rem;
  color: #fff;
  font-weight: 800;
}
.sidebar-brand span {
  font-size: 0.78rem;
  color: var(--sidebar-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.app-nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.app-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.app-nav a.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.22);
}
.app-nav__logout {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.85rem;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.35rem 1.5rem 0.35rem;
}
.app-top__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.app-content {
  padding: 0.75rem 1.5rem 2.25rem;
  flex: 1;
  width: min(1120px, 100%);
}

.app-content > .card,
.app-content > .stack.card,
.app-content > form.card,
.app-content > form.stack,
.app-content > article.card,
.app-content > .checkout {
  max-width: 48rem;
}

.app-content > .stat-grid,
.app-content > .event-cards,
.app-content > .table-wrap,
.app-content > .grid-3,
.app-content > .settings-nav,
.app-content > section.card.checkin-screen {
  max-width: none;
}

.app-content > section.card {
  max-width: 52rem;
}

.app-content > .card + .card,
.app-content > .card + form,
.app-content > form + form,
.app-content > form + .card {
  margin-top: 1rem;
}

/* ========== Components ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
}
.stack > .btn,
.stack > button.btn,
.stack > a.btn {
  align-self: flex-start;
  width: auto;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.stack > label,
.field-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
}

label.check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
}
label.check input {
  width: auto;
  margin: 0;
}

.field,
input.field,
select.field,
textarea.field,
.stack input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.stack select,
.stack textarea,
.app-content input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.app-content select,
.app-content textarea,
.pub-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.pub-main select,
.pub-main textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-weight: 400;
}
.field:focus,
.stack input:focus,
.stack select:focus,
.stack textarea:focus,
.app-content input:focus,
.app-content select:focus,
.app-content textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--focus);
}

.btn,
a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.05rem;
  font-weight: 650;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary,
a.btn-primary,
button.btn-primary {
  background: linear-gradient(135deg, #4b8fff, #2563eb);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}
.btn-ghost,
a.btn-ghost {
  background: transparent;
}
.btn-sm,
a.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}
.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.btn-link {
  background: none;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
}
.btn-link.danger {
  color: var(--err);
}

.flash,
.flash-success,
.flash-error,
.flash-info,
.flash-warning {
  margin: 0.85rem 1.35rem 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  font-size: 0.92rem;
}
.shell-public .flash,
.shell-public .flash-success,
.shell-public .flash-error,
.shell-public .flash-info,
.shell-public .flash-warning {
  margin-left: auto;
  margin-right: auto;
  width: min(960px, calc(100% - 2.5rem));
}
.flash-success,
.flash.success {
  background: var(--ok-bg);
  border-color: #a7f3d0;
  color: var(--ok);
}
.flash-error,
.flash.error {
  background: var(--err-bg);
  border-color: #fecaca;
  color: var(--err);
}
.flash-info,
.flash.info,
.flash-warning,
.flash.warning {
  background: var(--info-bg);
  border-color: #bfdbfe;
  color: var(--info);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.5rem;
}
.card.stat .stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.card.stat strong {
  font-size: 1.55rem;
  font-weight: 750;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 800px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.toolbar,
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0 0 1rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  background: var(--surface-2);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: rgba(37, 99, 235, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--blue-soft);
  color: var(--blue);
}

.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-plain li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.list-plain li:last-child {
  border-bottom: none;
}

.event-cards {
  display: grid;
  gap: 0.75rem;
}
.event-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.event-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
}
.event-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.event-card .meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-page {
  width: min(420px, 100%);
  margin: 2.5rem auto;
}
.auth-page h1 {
  margin: 0 0 1.1rem;
  font-size: 1.55rem;
  font-weight: 750;
}
.auth-page .btn-primary,
.auth-page button[type="submit"],
.auth-page .stack > .btn,
.auth-page .stack > button.btn {
  width: 100%;
  align-self: stretch;
}

.event-public,
.organiser-public,
.checkout,
.ticket-view {
  max-width: 720px;
  margin: 0 auto;
}
.event-public .page-title {
  margin: 0.35rem 0 0.5rem;
}
.event-cover {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.ticket-list {
  list-style: none;
  margin: 0.75rem 0 1.25rem;
  padding: 0;
}
.ticket-list li {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--surface-2);
}
.organiser-public h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.15rem;
}
.organiser-public ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.organiser-public li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.org-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 1px solid var(--border);
}
.ticket-view {
  text-align: center;
}
.ticket-view img {
  margin: 1rem auto;
  border-radius: 0.75rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.inline-form {
  display: inline;
}

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.settings-nav a {
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--surface);
}
.settings-nav a.active,
.settings-nav a:hover {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.3);
  background: var(--blue-soft);
}

.pricing-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
}
.pricing-card {
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.pricing-card.is-featured {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.pricing-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.pricing-card .price {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 750;
  margin: 0.25rem 0;
}

.scan-status.ok {
  color: #059669;
  font-weight: 700;
}
.scan-status.warn {
  color: #b45309;
  font-weight: 700;
}
.scan-status.err {
  color: #dc2626;
  font-weight: 700;
}
.checkin-screen {
  max-width: 40rem;
}
.checkin-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.04);
}
.checkin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 0.5rem;
  border-radius: 0.55rem;
  cursor: pointer;
}
.checkin-tab.active {
  background: var(--blue-500);
  color: #fff;
}
.qr-reader {
  width: 100%;
  min-height: 16rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #0b1220;
}
.qr-reader video {
  width: 100% !important;
  border-radius: var(--radius-sm);
}
.checkin-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.checkin-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.45);
}
.checkin-search-item > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.org-switcher {
  margin: 0 0 0.75rem;
}
.org-switcher select {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.org-logo {
  max-width: 8rem;
  max-height: 4rem;
  object-fit: contain;
  margin-bottom: 0.75rem;
}
.prose {
  line-height: 1.65;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
}
