/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37,99,235,0.08);
  --accent-border: rgba(37,99,235,0.30);

  /* Neutrals */
  --bg:           #ffffff;
  --bg-subtle:    #f9fafb;
  --bg-inset:     #f3f4f6;
  --text:         #0f172a;
  --text-secondary: #374151;
  --muted:        #6b7280;
  --line:         #e5e7eb;
  --line-subtle:  rgba(17,24,39,0.08);

  /* Semantic */
  --success:        #059669;
  --success-bg:     #f0fdf4;
  --success-border: #bbf7d0;
  --warning:        #d97706;
  --warning-bg:     #fffbeb;
  --warning-border: #fde68a;
  --danger:         #dc2626;
  --danger-bg:      #fef2f2;
  --danger-border:  #fecaca;
  --danger-hover:   #b91c1c;

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Radii */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.08);
  --shadow:    0 4px 12px rgba(15,23,42,0.10);
  --shadow-lg: 0 10px 40px rgba(15,23,42,0.12);
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: inherit; }

h1, h2, h3, h4 { margin: 0; }

code {
  font-family: var(--mono);
  background: var(--bg-inset);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container {
  max-width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* ─── Site Header ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(15,23,42,0.05);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  height: 28px;
  width: auto;
}

/* Nav */
.nav {
  display: flex;
  gap: 2px;
  align-items: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-inset);
}

.nav-link.is-active {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}

/* "Sign in" CTA in nav (logged-out state) */
.nav-link-cta {
  border: 1px solid var(--line);
  background: var(--bg);
}
.nav-link-cta:hover {
  border-color: #9ca3af;
  background: var(--bg-subtle);
}
.nav-link-cta.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.site-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* User pill */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.user-pill .avatar {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

/* DFM badge */
.dfm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin-right: 4px;
}
.dfm-badge:hover { color: var(--text); background: var(--bg-inset); }
.dfm-badge.hidden { display: none; }

.dfm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warning);
  flex-shrink: 0;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--text); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  letter-spacing: -0.01em;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border-color: var(--line);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: #9ca3af;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: #9ca3af;
}

.btn-ghost-danger {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost-danger:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

/* Legacy alias */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background-color 0.15s, box-shadow 0.15s;
}
.primary-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.primary-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ─── Status badges ──────────────────────────────────────────────────────── */
.status-ready,
.status-pass   { color: var(--success); font-weight: 600; }
.status-processing,
.status-queued,
.status-warning { color: var(--warning); font-weight: 600; }
.status-failed,
.status-error  { color: var(--danger); font-weight: 600; }
.status-cancelled { color: var(--muted); font-weight: 600; }

/* Alert / message pills */
.msg {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.msg-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.msg-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger-border);  }
.msg-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* ─── Form Inputs ────────────────────────────────────────────────────────── */
.input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: rgba(37,99,235,0.5);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.card .features {
  flex-grow: 1;
  margin: 14px 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}
.card .cost {
  font-size: 18px;
  font-weight: 600;
  margin-top: 14px;
}

/* ─── Upload Module ──────────────────────────────────────────────────────── */
.module {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.upload-area {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.06);
}

.upload-left { display: flex; gap: 14px; align-items: center; }
.upload-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--bg);
  flex-shrink: 0;
  color: var(--accent);
}

.upload-label b  { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.upload-label small { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.file-input-hidden { display: none; }

.meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.first {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--text);
}

.lead {
  max-width: 60ch;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.section {
  margin-top: 32px;
  padding-top: 32px;
}

.section h2 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.section p {
  margin-top: 8px;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.bullets {
  margin-top: 10px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.scrollHint {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
  opacity: 0.7;
}

/* ─── Report Preview ─────────────────────────────────────────────────────── */
.report-preview {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-subtle);
  color: var(--text);
}
.report-preview .fail { color: var(--danger); }
.report-preview .pass { color: var(--success); }

/* ─── Inline utilities ───────────────────────────────────────────────────── */
.muted  { color: var(--muted); }
.mono   { font-family: var(--mono); }

.copy-btn {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  margin-left: 8px;
  transition: color 0.15s;
}
.copy-btn:hover { color: var(--text); }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty-state p { margin-bottom: 16px; font-size: 15px; }

/* ─── Dashboard ──────────────────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
  margin-top: 2rem;
}

.dashboard-section { min-width: 0; }

.dashboard-section h2 {
  margin-bottom: 1rem;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ─── Board cards ────────────────────────────────────────────────────────── */
.board-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.board-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(17,24,39,0.14);
}

/* Thumbnail — flush left edge, no inner border/radius */
.board-thumb-wrap {
  width: 116px;
  min-width: 116px;
  flex-shrink: 0;
  background: var(--bg-inset);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  transition: background 0.15s;
}
.board-thumb-wrap:hover { background: var(--bg-subtle); }

.board-thumb {
  width: 100%;
  height: 100%;
  min-height: 88px;
  object-fit: contain;
  display: block;
  background: var(--bg);
}

.board-thumb-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.board-thumb-wrap.thumb-missing .board-thumb-fallback { display: flex; }

/* Info panel */
.board-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
}

.board-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.board-name-wrap {
  flex: 1;
  min-width: 0;
}

.board-title-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
  color: var(--text);
  padding: 3px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 14px;
  font-family: var(--font);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.board-title-input:hover {
  border-color: var(--line);
  background: var(--bg-subtle);
}
.board-title-input:focus {
  border-color: rgba(37,99,235,0.4);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
  background: var(--bg);
}

.board-name-status {
  min-height: 14px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  padding-left: 2px;
}

/* Status badge pill */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
  text-transform: capitalize;
}
.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-badge-ready {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}
.status-badge-ready::before { background: var(--success); }

.status-badge-processing,
.status-badge-queued {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning-border);
}
.status-badge-processing::before,
.status-badge-queued::before { background: var(--warning); }

.status-badge-failed {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.status-badge-failed::before { background: var(--danger); }

.status-badge-default,
.status-badge-unknown,
.status-badge-pending,
.status-badge-revoked {
  background: var(--bg-inset);
  color: var(--muted);
  border-color: var(--line);
}
.status-badge-default::before,
.status-badge-unknown::before,
.status-badge-pending::before,
.status-badge-revoked::before { background: var(--muted); }

/* Actions row */
.board-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.board-actions .delete-form-inline {
  margin: 0 0 0 auto;  /* push trash to far right */
  display: flex;
}

.delete-form-inline { margin: 0; display: inline; }
.delete-form-inline button { margin: 0; }

/* Icon-only danger button — larger to match btn height */
.btn-icon-danger {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-icon-danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-icon-danger:active { transform: scale(0.95); }

/* ─── Cart ───────────────────────────────────────────────────────────────── */
.cart-card {
  padding: 0;
  overflow: hidden;
}

.cart-shipping {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-subtle);
}

.cart-shipping h3 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.shipping-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.shipping-field { display: flex; flex-direction: column; }

.shipping-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.cart-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.cart-table th,
.cart-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.cart-table tr { height: 54px; }

.cart-table thead th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  background: var(--bg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.col-name { width: auto; min-width: 200px; }
.col-qty  { width: 88px; }
.col-unit { width: 78px; }
.col-line { width: 88px; }
.col-x    { width: 38px; }

.cart-table td.col-unit,
.cart-table th.col-unit,
.cart-table td.col-line,
.cart-table th.col-line {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cart-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  height: 100%;
}

.cart-title {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-sub {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-qty-input {
  width: 70px;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cart-qty-input:focus {
  border-color: rgba(37,99,235,0.5);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-qty-input[type=number] { -moz-appearance: textfield; appearance: textfield; }

.cart-qty-status {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  min-height: 14px;
  text-align: center;
}

.col-qty { vertical-align: middle; }
.col-qty .cart-qty-input  { display: block; margin: 0 auto; }
.col-qty .cart-qty-status { text-align: center; }

.cart-remove-form {
  margin: 0;
  display: flex;
  justify-content: flex-end;
}

.cart-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
}

.cart-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.cart-footer-row.total { margin-top: 4px; }
.cart-footer-row.total strong { font-size: 16px; }

.cart-actions {
  padding: 0 16px 14px;
  display: flex;
  justify-content: flex-end;
}

.cart-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
}

.cart-total { font-size: 1.1rem; }

/* Stripe checkout button */
.primary-btn.stripe-simple {
  width: 100%;
  max-width: 420px;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-top: 0;
}
.primary-btn.stripe-simple:disabled { opacity: 0.65; cursor: not-allowed; }

/* ─── Login ──────────────────────────────────────────────────────────────── */
.login-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 0;
  align-items: start;
}

.login-card {
  background: var(--bg);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo { margin-bottom: 20px; }
.login-logo-img { height: 40px; width: auto; }

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.login-methods {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-method { border-radius: var(--radius-lg); }

.google-login-btn {
  display: block;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: transform 0.15s, box-shadow 0.15s;
}
.google-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.google-btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s, background 0.15s;
}
.google-login-btn:hover .google-btn-content {
  border-color: #d1d5db;
  background: var(--bg-subtle);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
}
.divider-line { flex: 1; height: 1px; background: var(--line); }
.divider-text { font-size: 13px; color: var(--muted); font-weight: 500; }

.guest-option {
  text-align: center;
  padding: 18px;
  background: var(--bg-subtle);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.guest-text {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

.guest-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.guest-btn:hover {
  background: var(--bg-inset);
  border-color: #9ca3af;
  color: var(--text-secondary);
}

.login-footer { margin-top: 28px; text-align: center; }
.footer-text { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.footer-link { color: var(--accent); text-decoration: none; }
.footer-link:hover { text-decoration: underline; }

.login-benefits { padding: 36px 0; }
.login-benefits h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.benefit-icon {
  font-size: 18px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-inset);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.benefit-item div { flex: 1; }
.benefit-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.benefit-item span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── Email signup (index.html) ──────────────────────────────────────────── */
.email-signup-box {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.email-signup-box h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.email-signup-box p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.email-signup-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.email-input {
  flex: 1;
  min-width: 180px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  outline: none;
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.email-input:focus {
  border-color: rgba(37,99,235,0.5);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.email-btn {
  padding: 9px 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
}
.email-btn:hover:not(:disabled) { background: var(--accent-hover); }
.email-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.email-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.email-note { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ─── Global drag-drop overlay ───────────────────────────────────────────── */
.gdrop.hidden { display: none; }

.gdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gdrop-panel {
  width: min(520px, calc(100vw - 48px));
  border-radius: var(--radius-xl);
  padding: 24px 22px;
  text-align: center;
  background: rgba(255,255,255,0.80);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.gdrop-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}

.gdrop-title  { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.gdrop-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.gdrop-progress { margin-top: 10px; }

.gdrop-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-inset);
  overflow: hidden;
}

.gdrop-bar-inner {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 120ms linear;
}

.gdrop-pct {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Subtle entrance for cards */
.card, .module {
  animation: fadein 0.2s ease both;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .login-container {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 460px;
    padding: 20px 0;
  }

  .login-card { padding: 28px 22px; }
  .login-benefits { padding: 16px 0; }
  .login-title { font-size: 21px; }

  .board-thumb-wrap { width: 120px; min-width: 120px; }

  h1 { font-size: 28px; }
}

@media (max-width: 640px) {
  .meta { flex-direction: column; gap: 6px; }
  .email-signup-row { flex-direction: column; }
}
