/* NAIQ Agenda — light liquid-glass UI */

:root {
  --bg: #eef1f8;
  --bg-2: #e6ebf6;
  --ink: #10162a;
  --ink-2: #4a5470;
  --ink-3: #838da8;
  --line: rgba(16, 22, 42, 0.09);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-2: rgba(255, 255, 255, 0.78);
  --accent: #3d5afe;
  --accent-ink: #2136c8;
  --agree: #12a05f;
  --agree-bg: rgba(18, 160, 95, 0.1);
  --contest: #d97706;
  --contest-bg: rgba(217, 119, 6, 0.11);
  --approve: #7c3aed;
  --approve-bg: rgba(124, 58, 237, 0.1);
  --danger: #dc2626;
  --r: 18px;
  --shadow: 0 12px 40px rgba(16, 22, 42, 0.09), 0 2px 6px rgba(16, 22, 42, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 700px at 8% -10%, #dfe7ff 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #f3e6ff 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.glass {
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

/* ── brand ─────────────────────────────────────── */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; letter-spacing: -0.01em; color: var(--ink);
  text-decoration: none; font-weight: 500;
}
.brand b { font-weight: 700; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #4f6bff, #7c3aed);
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 4px 14px rgba(79, 107, 255, 0.4);
}

/* ── gate ──────────────────────────────────────── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; position: relative; }
.gate-glow {
  position: fixed; inset: auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22), transparent 65%);
  filter: blur(30px); pointer-events: none; top: -120px; right: -80px;
}
.gate-card { border-radius: 28px; padding: 40px 34px; max-width: 560px; width: 100%; }
.gate-card h1 {
  font-size: clamp(30px, 5vw, 42px); line-height: 1.1; margin: 22px 0 14px;
  letter-spacing: -0.03em; font-weight: 700;
}
.gate-card h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #3d5afe, #7c3aed 60%, #db2777);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--ink-2); font-size: 15.5px; margin: 0 0 26px; }
.gate-note { font-size: 12.5px; color: var(--ink-3); margin: 12px 0 0; }
.gate-points { list-style: none; padding: 0; margin: 26px 0 0; border-top: 1px solid var(--line); }
.gate-points li {
  font-size: 13.5px; color: var(--ink-2); padding: 11px 0 0; margin-top: 11px;
}
.gate-points li + li { border-top: 1px solid var(--line); }

/* ── buttons ───────────────────────────────────── */
.btn {
  font: inherit; font-size: 14px; font-weight: 550;
  border-radius: 13px; border: 1px solid var(--line);
  padding: 11px 18px; cursor: pointer; color: var(--ink);
  background: var(--glass-2);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 22, 42, 0.1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.btn-primary {
  background: linear-gradient(140deg, #4f6bff, #6d3aed); color: #fff; border-color: transparent;
  box-shadow: 0 6px 20px rgba(79, 107, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(79, 107, 255, 0.45); }
.btn-google { width: 100%; padding: 14px 18px; font-size: 15px; background: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-danger { color: var(--danger); }

/* ── top bar ───────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-radius: 0; border-width: 0 0 1px;
  border-color: rgba(255, 255, 255, 0.55);
}
.spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--glass-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 4px; font: inherit; font-size: 13px; color: var(--ink-2);
}
.user-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #ddd; }

.view { max-width: 940px; margin: 0 auto; padding: 26px 18px 70px; }
.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 0 0 30px; }

/* ── generic cards ─────────────────────────────── */
.card {
  background: var(--glass); backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.7); box-shadow: var(--shadow);
  border-radius: var(--r); padding: 18px;
}
.card + .card { margin-top: 14px; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.muted { color: var(--ink-3); font-size: 13px; }
.sub { color: var(--ink-2); font-size: 14px; margin: 6px 0 0; }

/* thread list */
.thread-card { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.thread-card:hover { transform: translateY(-2px); transition: transform 0.15s ease; }
.thread-row { display: flex; align-items: center; gap: 12px; }
.thread-row h3 { margin: 0; font-size: 16.5px; letter-spacing: -0.01em; }
.meta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

/* progress */
.bar { height: 6px; border-radius: 6px; background: rgba(16, 22, 42, 0.08); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #12a05f, #4f6bff); border-radius: 6px; transition: width 0.3s ease; }

/* pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(16, 22, 42, 0.06); color: var(--ink-2); white-space: nowrap;
}
.pill.agreed { background: var(--agree-bg); color: var(--agree); }
.pill.contested { background: var(--contest-bg); color: var(--contest); }
.pill.approved { background: var(--approve-bg); color: var(--approve); }
.pill.locked { background: rgba(16, 22, 42, 0.82); color: #fff; }
.pill.open { background: rgba(61, 90, 254, 0.1); color: var(--accent-ink); }

/* ── agenda items ──────────────────────────────── */
.item {
  border-radius: var(--r); padding: 16px 16px 12px; margin-top: 12px;
  background: var(--glass-2); border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 22px rgba(16, 22, 42, 0.06);
  border-left: 4px solid rgba(16, 22, 42, 0.12);
}
.item.agreed { border-left-color: var(--agree); }
.item.contested { border-left-color: var(--contest); }
.item.approved { border-left-color: var(--approve); }
.item-head { display: flex; gap: 10px; align-items: flex-start; }
.item-head h4 { margin: 0; font-size: 15.5px; letter-spacing: -0.01em; flex: 1; }
.item-notes { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 0; white-space: pre-wrap; }
.item-facts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--ink-3); }

.vote-row { display: flex; gap: 8px; margin-top: 13px; flex-wrap: wrap; align-items: center; }
.vote {
  font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  border-radius: 11px; padding: 7px 13px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6); color: var(--ink-2);
}
.vote:hover { background: #fff; }
.vote.on.agree { background: var(--agree); border-color: var(--agree); color: #fff; }
.vote.on.disagree { background: var(--contest); border-color: var(--contest); color: #fff; }
.vote.on.abstain { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }

.who { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.who span {
  font-size: 11.5px; padding: 3px 8px; border-radius: 999px;
  background: rgba(16, 22, 42, 0.05); color: var(--ink-2);
}
.who span.a { background: var(--agree-bg); color: var(--agree); }
.who span.d { background: var(--contest-bg); color: var(--contest); }
.who span.p { opacity: 0.65; }

/* comments */
.comments { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment { display: flex; gap: 9px; padding: 6px 0; font-size: 13.5px; }
.comment img { width: 22px; height: 22px; border-radius: 50%; flex: none; background: #ddd; }
.comment b { font-weight: 600; }
.comment .t { color: var(--ink-3); font-size: 11.5px; margin-left: 4px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; }

/* ── forms ─────────────────────────────────────── */
input[type="text"], input[type="date"], input[type="number"], input[type="email"], textarea, select {
  font: inherit; font-size: 14px; width: 100%; color: var(--ink);
  padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.75);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(61, 90, 254, 0.55); box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.13);
}
textarea { resize: vertical; min-height: 74px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 550; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── modal ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; padding: 20px;
  background: rgba(16, 22, 42, 0.32); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.modal { border-radius: 24px; padding: 24px; width: min(520px, 100%); max-height: 88dvh; overflow: auto; }
.modal h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.02em; }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 18px; }

/* ── toast ─────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 80; padding: 11px 18px; border-radius: 13px; font-size: 13.5px;
  background: rgba(16, 22, 42, 0.92); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: min(560px, 92vw);
}
.toast.bad { background: #b91c1c; }

.empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
.log-line { font-size: 12.5px; color: var(--ink-2); padding: 7px 0; border-bottom: 1px solid var(--line); }
.log-line:last-child { border-bottom: 0; }
.log-line time { display: block; color: var(--ink-3); font-size: 11px; }

@media (max-width: 780px) {
  .split { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .gate-card { padding: 30px 22px; }
}
