/*
 * RightForms — Design System
 * Sister-brand to igdigi.com (igdigi.com/css/agency.css extracted 2026-05-08).
 * Vanilla CSS + custom properties. No Tailwind. Server-rendered + HTMX-friendly.
 */
/* Self-hosted Inter + Playfair Display (was Google Fonts).
   .woff2 subsets (latin + latin-ext) in static/fonts/. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/inter-v20-latin_latin-ext-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-v20-latin_latin-ext-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-v20-latin_latin-ext-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-v20-latin_latin-ext-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-v20-latin_latin-ext-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/playfair-display-v40-latin_latin-ext-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/playfair-display-v40-latin_latin-ext-600.woff2') format('woff2');
}

/* ── Design Tokens ─────────────────────────────────────────────────────────── */

:root {
  /* Color palette — synced with igdigi.com */
  --bg-color:        #ffffff;
  --bg-secondary:    #f8fafc;
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #64748b;
  --accent-color:    #2563eb;
  --accent-hover:    #1d4ed8;
  --accent-soft:     rgba(37, 99, 235, 0.10);
  --border-color:    #e2e8f0;
  --border-strong:   #cbd5e1;
  --card-bg:         #ffffff;

  /* Status colors */
  --success:         #10b981;
  --success-soft:    rgba(16, 185, 129, 0.10);
  --warning:         #f59e0b;
  --warning-soft:    rgba(245, 158, 11, 0.10);
  --danger:          #ef4444;
  --danger-soft:     rgba(239, 68, 68, 0.10);

  /* Shadows */
  --shadow-sm:  0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:  0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-blue:0 10px 20px -10px rgba(37, 99, 235, 0.5);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  /* Subtle grid background */
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
  position: relative;
  z-index: 0;
}

/* Background fade mask — keeps grid subtle, fades center */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0) 0%, #ffffff 80%);
  pointer-events: none;
  z-index: -1;
}

a { text-decoration: none; color: inherit; }
a:hover { color: var(--accent-color); }
img, svg { display: block; max-width: 100%; }

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.container-sm { max-width: 720px; }
.container-md { max-width: 900px; }

main {
  flex: 1;
  padding: 32px 0 60px;
  width: 100%;
}

main.flush { padding-top: 0; }

/* ── Disclaimer banner (legal UPL) ─────────────────────────────────────────── */
/* Disclaimer scrolls AWAY with the page; navbar takes its place via
   position:sticky once disclaimer leaves the viewport. */

.disclaimer {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 8px 24px;
  line-height: 1.5;
}

.disclaimer strong { color: var(--text-secondary); font-weight: 500; }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */

.navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
}

.nav-logo .slash {
  color: var(--accent-color);
  font-weight: 400;
  margin: 0 2px;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a, .nav-links button {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.nav-links a:hover, .nav-links button:hover { color: var(--text-primary); }

.nav-cta {
  background-color: var(--text-primary) !important;
  color: #fff !important;
  padding: 10px 20px !important;
  border-radius: var(--radius-sm) !important;
  transition: background-color 0.2s !important;
}

.nav-cta:hover { background-color: var(--accent-color) !important; }

.lang-select {
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 8px;   /* was 6px 8px → meets 44px minimum touch target */
  min-height: 44px;
  color: var(--text-secondary);
  background: #fff;
  cursor: pointer;
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px;       /* was 8px → 44×44px touch target (Apple HIG / WCAG 2.5.5) */
  min-width: 44px;
  min-height: 44px;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
  }
  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .mobile-menu-btn { display: block; }
  .disclaimer { font-size: 0.72rem; padding: 6px 16px; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 15px 25px -10px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-dark {
  background-color: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}
.btn-dark:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.btn-danger {
  background-color: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }

.btn-sm  { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg  { padding: 16px 32px; font-size: 1.05rem; }

.btn-block { width: 100%; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-tight { padding: 16px; }
.card-loose { padding: 32px; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-meta { color: var(--text-muted); font-size: 0.85rem; }

/* Card with accent left-border (for status / call-out) */
.card-accent { border-left: 3px solid var(--accent-color); }
.card-success { border-left: 3px solid var(--success); }
.card-warning { border-left: 3px solid var(--warning); }
.card-danger  { border-left: 3px solid var(--danger); }

/* Hover lift card (catalog items) */
.card-link {
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.card-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

/* ── Typography ─────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; color: var(--text-primary); }

.h-display {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  background: linear-gradient(135deg, #0f172a 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@media (max-width: 768px) { .h-display { font-size: 2.2rem; } }

h1 { font-size: 2rem; margin-bottom: 16px; }
h2 { font-size: 1.5rem; margin-bottom: 12px; }
h3 { font-size: 1.2rem; margin-bottom: 10px; }
h4 { font-size: 1.05rem; margin-bottom: 8px; }

.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 60ch;
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-color); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.serif { font-family: 'Playfair Display', serif; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-color);
  background: var(--accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */

label, .label {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

label.required::after, .label.required::after {
  content: " *";
  color: var(--danger);
}

input[type=text],
input[type=email],
input[type=password],
input[type=date],
input[type=tel],
input[type=number],
input[type=url],
input[type=search],
textarea,
select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input:disabled, textarea:disabled, select:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea { min-height: 88px; resize: vertical; }

input[type=checkbox], input[type=radio] {
  width: 18px; height: 18px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-error {
  font-size: 0.82rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* ── Pills / Badges ─────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.pill-accent  { background: var(--accent-soft);  color: var(--accent-color);  border-color: rgba(37,99,235,0.2); }
.pill-success { background: var(--success-soft); color: var(--success);       border-color: rgba(16,185,129,0.2); }
.pill-warning { background: var(--warning-soft); color: #b45309;              border-color: rgba(245,158,11,0.25); }
.pill-danger  { background: var(--danger-soft);  color: var(--danger);        border-color: rgba(239,68,68,0.2); }
.pill-neutral { background: #f1f5f9; color: var(--text-secondary); border-color: var(--border-color); }

.pill-dot::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Alerts (flash messages) ────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.alert-info    { background: var(--accent-soft); color: var(--accent-color); border-color: rgba(37,99,235,0.2); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(16,185,129,0.2); }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: rgba(245,158,11,0.25); }
.alert-error,
.alert-danger  { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,0.2); }

/* ── Section header ─────────────────────────────────────────────────────────── */

.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-header p { color: var(--text-secondary); max-width: 60ch; }

/* ── Stack / cluster utility ────────────────────────────────────────────────── */

.stack { display: flex; flex-direction: column; }
.stack-1 { gap: 4px; } .stack-2 { gap: 8px; } .stack-3 { gap: 12px; }
.stack-4 { gap: 16px; } .stack-5 { gap: 24px; } .stack-6 { gap: 32px; }

.cluster { display: flex; flex-wrap: wrap; align-items: center; }
.cluster-2 { gap: 8px; } .cluster-3 { gap: 12px; }
.cluster-4 { gap: 16px; } .cluster-5 { gap: 24px; }

.between { justify-content: space-between; }
.center  { justify-content: center; align-items: center; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 32px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer a { color: var(--text-secondary); }
.footer a:hover { color: var(--accent-color); }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ── Hero (landing) ─────────────────────────────────────────────────────────── */

.hero {
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 60px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}
.hero-orb-1 { top: -100px; right: -100px; width: 400px; height: 400px; background: rgba(37,99,235,0.15); }
.hero-orb-2 { bottom: -150px; left: -100px; width: 300px; height: 300px; background: rgba(16,185,129,0.12); }

/* ── Auth pages (login / register / password) ─────────────────────────────── */

.auth-shell {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-card .auth-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.auth-card .auth-subtitle { color: var(--text-secondary); margin-bottom: 28px; font-size: 0.92rem; }

.auth-foot {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 24px;
}
.auth-foot a { color: var(--accent-color); font-weight: 500; }
.auth-foot a:hover { text-decoration: underline; }

/* ── Dashboard / orders / people lists ────────────────────────────────────── */

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.page-header .lead {
  font-size: 1rem;
  margin: 0;
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }

/* List items (people, orders, documents) */
.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.list-item + .list-item { margin-top: 12px; }
.list-item:hover { border-color: var(--accent-color); box-shadow: var(--shadow-sm); }

.list-item .avatar {
  width: 40px; height: 40px;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-weight: 600;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta .name { font-weight: 500; color: var(--text-primary); }
.list-item .meta .sub  { font-size: 0.85rem; color: var(--text-muted); }

.list-item .actions { display: flex; gap: 8px; align-items: center; }

/* ── Catalog cards (documents grid) ────────────────────────────────────────── */

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
}

.doc-card.is-selected {
  border-color: var(--accent-color);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-color);
}

.doc-card .icon {
  font-size: 1.8rem;
  line-height: 1;
}

.doc-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.doc-card .desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.doc-card .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.doc-card .price {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.doc-card .price-free { color: var(--success); }

/* ── Accordion (data page) ─────────────────────────────────────────────────── */

.accordion-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.accordion-card:hover { border-color: var(--border-strong); }
.accordion-card.is-open { border-color: var(--accent-color); }

.accordion-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  cursor: pointer;
  user-select: none;
  background: var(--card-bg);
}

.accordion-head:hover { background: var(--bg-secondary); }

.accordion-head .title { flex: 1; font-weight: 600; }

.accordion-head .chev {
  transition: transform 0.2s;
  color: var(--text-muted);
}

.accordion-card.is-open .chev { transform: rotate(180deg); }

.accordion-body {
  padding: 0 24px 24px;
  border-top: 1px solid var(--border-color);
}

/* ── Data-page slot row (assigned participants) ──────────────────────────── */

.slot-row {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--bg-secondary);
  margin-bottom: 12px;
}

.slot-row .slot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.slot-row .slot-head .name { font-weight: 500; }
.slot-row .slot-head .badge { margin-left: auto; }

.supplement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 600px) { .supplement-grid { grid-template-columns: 1fr; } }

.supplement-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px dashed var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.supplement-pill:hover { border-color: var(--accent-color); color: var(--text-primary); }
.supplement-pill.has-value { border-style: solid; color: var(--text-primary); background: #fff; }
.supplement-pill .label { font-weight: 500; color: var(--text-secondary); }

/* Save indicator */
.save-indicator {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 8px;
  transition: opacity 0.2s;
}
.save-indicator.saved { color: var(--success); }
.save-indicator.saving { color: var(--text-muted); }
.save-indicator[data-state="saved"] { color: var(--success); }
.save-indicator[data-state="error"] { color: var(--danger); font-weight: 500; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
}

.table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.table tr:last-child td { border-bottom: 0; }

/* ── Selection cart (catalog) ─────────────────────────────────────────────── */

.cart-summary {
  position: sticky;
  bottom: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  margin-top: 32px;
}

.cart-summary .total {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
}

.cart-summary .count { font-size: 0.85rem; opacity: 0.8; }

.cart-summary .btn-primary {
  background: #fff;
  color: var(--text-primary);
  border-color: #fff;
  box-shadow: none;
}
.cart-summary .btn-primary:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

/* ── Misc utilities ─────────────────────────────────────────────────────────── */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }

.mt-2 { margin-top: 8px; }  .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.text-lg { font-size: 1.1rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 768px) { .hide-on-mobile { display: none !important; } }
@media (min-width: 769px) { .show-on-mobile { display: none !important; } }

/* ── HTMX states ─────────────────────────────────────────────────────────── */

.htmx-request .htmx-indicator {
  display: inline !important;
}
.htmx-indicator { display: none; }

/* ── Print (for PDF preview) ──────────────────────────────────────────────── */

@media print {
  body::before, .navbar, .footer, .disclaimer { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Value-reuse helper ("Copy from another person" pill on People forms) ── */

.reuse-group {
  /* No visual chrome around the group itself — fields inside keep their own
     spacing. The mount + pill provide all the affordance. */
  display: contents;
}
.reuse-mount {
  /* Sits above the first input of the group; collapses to 0 when JS finds
     no candidates (mount stays empty). */
  display: contents;
}
.reuse-mount:not(:empty) {
  display: block;
  margin-bottom: 4px;
}

.reuse-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  max-width: 100%;
  text-align: left;
}
.reuse-pill:hover,
.reuse-pill:focus-visible {
  border-color: var(--accent-color);
  color: var(--text-primary);
  background: #fff;
  outline: none;
}
.reuse-pill:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }

.reuse-dropdown {
  position: relative;
  display: inline-block;
}
.reuse-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: 4px;
  min-width: 220px;
  max-width: 320px;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.reuse-menu[hidden] { display: none; }
.reuse-menu li { margin: 0; padding: 0; }
.reuse-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-align: left;
  min-height: 40px;
}
.reuse-menu-item:hover,
.reuse-menu-item:focus-visible {
  background: var(--bg-secondary);
  outline: none;
}
.reuse-menu-item:focus-visible { box-shadow: 0 0 0 2px var(--accent-soft); }
.reuse-menu-name { font-weight: 600; }
.reuse-menu-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
