/* Weddio design system */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

:root {
  /* Weddio house style: cool off-white, deep emerald accent, Cabinet Grotesk titles + Geist text */
  --paper: #F2F3EF;
  --card: #FCFCFA;
  --ink: #121513;
  --ink-2: #3A403C;
  --muted: #5B615D;
  --line: #DADDD7;
  --line-2: #E8EAE5;
  --clay: #1F5641;
  --clay-soft: #DCE8E1;
  --on-accent: #F3F7F4;
  --sage: #2A7552;
  --sage-soft: #DCEBE2;
  --gold: #8A6516;
  --gold-soft: #F1EAD6;
  --rose: #B4423F;
  --rose-soft: #F6E0DD;
  --brand: #243B53;
  --brand-accent: #E2B04A;
  --serif: 'Cabinet Grotesk', 'Geist', system-ui, sans-serif;
  --serif-w: 800;
  --serif-track: -.03em;
  --sans: 'Geist', -apple-system, system-ui, sans-serif;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 0 rgba(18, 21, 19, .04), 0 18px 40px -28px rgba(16, 48, 36, .32);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1110; --card: #171A18; --ink: #EEF0EC; --ink-2: #C9CEC9; --muted: #A0A7A2; --line: #2B302D; --line-2: #202422;
    --clay: #7CC3A1; --clay-soft: #16302A; --on-accent: #0B1F17;
    --sage: #5CC492; --sage-soft: #173426; --gold: #D9B25C; --gold-soft: #2E2716; --rose: #E58A82; --rose-soft: #3A1E1C;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -26px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { font-variant-ligatures: no-common-ligatures; font-feature-settings: 'liga' 0, 'clig' 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; font-variant-ligatures: inherit; font-feature-settings: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
.serif { font-family: var(--serif); font-weight: var(--serif-w); letter-spacing: var(--serif-track); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.dark { background: var(--clay); color: var(--on-accent); border-color: var(--clay); }
.btn.dark:hover { filter: brightness(.92); }
.btn.clay { background: var(--clay); border-color: var(--clay); color: var(--on-accent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 15px; }
.btn i { font-size: 17px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.plain::before { display: none; }
.pill.paid, .pill.ready, .pill.signed, .pill.live, .pill.won { background: var(--sage-soft); color: var(--sage); }
.pill.due, .pill.processing, .pill.waiting, .pill.call, .pill.proposal { background: var(--gold-soft); color: var(--gold); }
.pill.overdue, .pill.lost { background: var(--rose-soft); color: var(--rose); }
.pill.new { background: var(--clay-soft); color: var(--clay); }

/* cards + fields */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.input:focus, .field input:not([type=checkbox]):not([type=radio]):focus, .field select:focus, .field textarea:focus { border-color: var(--clay); box-shadow: 0 0 0 4px var(--clay-soft); background: var(--card); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* toggle */
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--clay); }
.switch input:checked + span::after { transform: translateX(16px); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 14px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; transition: background .15s; }
.table tr.click:hover { background: var(--line-2); }
.table .r { text-align: right; }
.table-wrap { overflow-x: auto; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(28, 26, 23, .38); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal.on { opacity: 1; pointer-events: auto; }
.modal .sheet { width: min(560px, 100%); max-height: calc(100svh - 32px); overflow: auto; background: var(--card); color: var(--ink); border-radius: 20px; padding: 26px; transform: translateY(14px) scale(.98); transition: transform .35s var(--ease); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
.modal.on .sheet { transform: none; }
.modal .sheet h3 { font-family: var(--serif); font-weight: var(--serif-w); letter-spacing: var(--serif-track); font-size: 30px; margin-bottom: 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* toast */
#k-toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: var(--r); font-size: 14px; pointer-events: none; transition: all .35s var(--ease); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4); }
#k-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .6s var(--ease) both; }
.rise-kids > * { animation: rise .6s var(--ease) both; }
.rise-kids > *:nth-child(2) { animation-delay: .05s; }
.rise-kids > *:nth-child(3) { animation-delay: .1s; }
.rise-kids > *:nth-child(4) { animation-delay: .15s; }
.rise-kids > *:nth-child(5) { animation-delay: .2s; }
.rise-kids > *:nth-child(6) { animation-delay: .25s; }
.rise-kids > *:nth-child(n+7) { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* prototype banner */
.proto-bar { position: fixed; right: 14px; bottom: 14px; z-index: 70; display: flex; gap: 4px; padding: 4px; background: rgba(28, 26, 23, .88); backdrop-filter: blur(8px); border-radius: 999px; font-size: 12px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.proto-bar a { color: rgba(255, 255, 255, .72); text-decoration: none; padding: 6px 11px; border-radius: 999px; }
.proto-bar a:hover, .proto-bar a.on { color: #fff; background: rgba(255, 255, 255, .12); }
@media (max-width: 860px) { .proto-bar { display: none; } }

/* logo (marks live in shared/logo.js) */
.wd-mk { display: inline-grid; width: 1.05em; height: 1.05em; flex: none; }
.wd-mk svg, .wd-o svg { width: 100%; height: 100%; display: block; overflow: visible; }
.logo .wd-mk { width: 30px; height: 30px; }
.wd-lock { display: inline-flex; align-items: center; gap: .28em; font-family: var(--serif); font-weight: var(--serif-w); letter-spacing: var(--serif-track); line-height: 1; white-space: nowrap; }
.wd-lock .wd-mk { width: 1.1em; height: 1.1em; }
.wd-lock.inline { gap: .02em; align-items: baseline; }
.wd-lock .wd-o { display: inline-block; width: .7em; height: .7em; margin-left: .02em; transform: translateY(.09em); }
.wd-lock .wd-o.wide { width: .96em; height: .96em; margin-left: .01em; transform: translateY(.21em); }
.input.bad, .field input:not([type=checkbox]):not([type=radio]).bad, .field select.bad, .field textarea.bad { border-color: var(--rose); box-shadow: 0 0 0 4px var(--rose-soft); background: var(--card); }
