/* FAMES MANAGEMENT — shared design tokens & primitives (public site, invitations, admin) */
:root {
  /* Black & emerald theme */
  --bg: #F4F5F4;              /* main background (soft white) */
  --mint: #EEF0EF;            /* neutral light grey (no pastels) */
  --sage: #E6E9E7;
  --sand: #F2F2F0;
  --amber: #E9A23B;           /* progress & attention highlights */
  --accent: #167A43;          /* emerald accent: links, active states (5.4:1 with white) */
  --accent-bright: #4ADE80;   /* green on black panels (10.9:1) */
  --accent-700: #10612F;
  --accent-50: #EDF1EE;
  --ink: #0E1110;             /* black: headings, primary buttons, dark panels */
  --ink-700: #1F2321;
  --charcoal: #1A1D1C;
  --muted: #5C6460;           /* 5.6:1 on soft white */
  --line: #E1E5E2;
  --white: #FFFFFF;
  --sage-ink: #14532D;
  --sand-ink: #7A4E00;
  --mint-ink: #14532D;
  --danger: #A32727;
  --danger-bg: #FBE4E1;
  --info-bg: #E6EEF8;
  --wa: #167A43;              /* WhatsApp buttons use the emerald accent */

  --font-display: 'Unbounded', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --shadow-sm: 0 1px 2px rgba(14, 17, 16, .06);
  --shadow: 0 10px 30px -12px rgba(22, 122, 67, .22);
  --shadow-lg: 0 30px 60px -24px rgba(14, 17, 16, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--charcoal);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-700); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.1; letter-spacing: -.01em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.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; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 100; transition: top .2s; }
.skip-link:focus { top: 12px; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* Buttons */
.btn {
  --bg: var(--accent); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: .7em 1.4em; border: 2px solid transparent; border-radius: 999px;
  background: var(--bg); color: var(--fg); font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s, box-shadow .18s, color .18s, border-color .18s;
  white-space: nowrap;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:hover { color: var(--fg); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { --bg: var(--ink); --fg: #fff; }
.btn-primary:hover { --bg: var(--accent); }
.btn-ghost { --bg: transparent; --fg: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { --bg: var(--accent-50); }
.btn-soft { --bg: var(--mint); --fg: var(--accent); }
.btn-soft:hover { --bg: #E1E5E2; }
.btn-light { --bg: var(--bg); --fg: var(--accent); }
.btn-outline-light { --bg: transparent; --fg: #fff; border-color: rgba(255,255,255,.7); }
.btn-whatsapp { --bg: var(--wa); --fg: #fff; }
.btn-whatsapp:hover { --bg: var(--accent-700); }
.btn-danger { --bg: var(--danger); --fg: #fff; }
.btn-danger-ghost { --bg: transparent; --fg: var(--danger); border-color: currentColor; }
.btn-sm { min-height: 36px; padding: .45em 1em; font-size: .9rem; }
.btn-lg { min-height: 54px; padding: .85em 1.7em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 1.1em; height: 1.1em; border-radius: 50%;
  border: 2px solid var(--fg); border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status pills — always icon + text, never colour alone */
.status-pill {
  display: inline-flex; align-items: center; gap: .35em; padding: .25em .75em; border-radius: 999px;
  font: 600 .8rem/1.4 var(--font-body); white-space: nowrap; border: 1px solid transparent;
}
.status-pill svg { width: 1em; height: 1em; }
.s-attending { background: #DDEFE7; color: #1D5A47; border-color: #BFDDCF; }
.s-declined { background: #F8E3DF; color: #8A2C22; border-color: #EEC5BE; }
.s-pending { background: #FCEFD8; color: #7A4E00; border-color: #F1D6A6; }
.s-checked { background: var(--accent); color: #fff; }
.s-neutral { background: #EFECE8; color: var(--charcoal); border-color: var(--line); }
.s-fail { background: var(--danger-bg); color: var(--danger); border-color: #F2C3BD; }
.s-demo { background: #FFF3C4; color: #6B4E00; border-color: #EAD68A; }

/* Forms */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
label, legend { font-weight: 600; font-size: .95rem; color: var(--charcoal); }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; font: 400 1rem/1.4 var(--font-body); color: var(--charcoal);
  background: #fff; border: 1.5px solid #CFDAD6; border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input:hover, select:hover, textarea:hover { border-color: #A9BDB8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 122, 67, .22); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.field-error { color: var(--danger); font-size: .875rem; margin: 0; font-weight: 500; }
.field-error::before { content: '⚠ '; }
.hint { font-size: .85rem; color: var(--muted); margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 14px 16px; border-radius: var(--r-sm); font-size: .95rem; border: 1px solid transparent; }
.alert-error { background: var(--danger-bg); color: #7C1D1D; border-color: #F2C3BD; }
.alert-info { background: var(--info-bg); color: #1F3A5F; border-color: #C9D8EC; }
.alert-success { background: var(--sage); color: var(--sage-ink); border-color: #C3D9C3; }
.alert-warn { background: #FFF3C4; color: #5C4300; border-color: #EAD68A; }

/* Placeholder marking */
.ph-text { background: repeating-linear-gradient(-45deg, rgba(253, 241, 222, .9) 0 6px, rgba(233, 162, 59, .18) 6px 12px); outline: 1px dashed #E2B76B; border-radius: 4px; padding: 0 4px; color: var(--sand-ink); }

.card { background: #fff; border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.tone-lavender { background-color: var(--mint); }
.tone-sage { background-color: var(--sage); }
.tone-peach { background-color: var(--sand); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
[hidden] { display: none !important; }
