/* ─────────────────────────────────────────────────────────────
   ApnaEvent — abeto.co-inspired: dark canvas, bold display type,
   electric lime accent, soft grain, generous radii.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #0c0e09;
  --panel: #13160e;
  --card: #171b10;
  --line: rgba(240, 244, 228, 0.09);
  --ink: #f0f4e4;
  --muted: #9aa287;
  --acc: #c8f558;
  --acc-ink: #101403;
  --warn: #ffb454;
  --bad: #ff6b6b;
  --ok: #7fe08c;
  --radius: 22px;
  --radius-sm: 12px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: 0.01em;
}

/* subtle grain over everything */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--acc); color: var(--acc-ink); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand-mark { margin-right: 6px; }
.brand-accent { color: var(--acc); }

.nav { display: flex; align-items: center; gap: 10px; }
.nav .who { color: var(--muted); font-size: 0.85rem; margin-right: 4px; }

/* ── Buttons & pills ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink);
  padding: 10px 20px; font-size: 0.92rem; font-weight: 500;
  cursor: pointer; transition: transform 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-acc {
  background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 600;
}
.btn-acc:hover { background: #d8ff70; color: var(--acc-ink); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }

.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted);
}
.pill-acc  { background: color-mix(in srgb, var(--acc) 16%, transparent); color: var(--acc); border-color: transparent; }
.pill-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
.pill-ok   { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: transparent; }
.pill-bad  { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); border-color: transparent; }

/* ── Layout ──────────────────────────────────────────────── */
.app { flex: 1; width: min(1120px, 100%); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 80px; }

/* ── Hero ────────────────────────────────────────────────── */
.hero { padding: clamp(56px, 10vh, 120px) 0 40px; }

.hero-kicker {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--acc);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.02; letter-spacing: -0.03em; font-weight: 700;
  max-width: 15ch;
}
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--acc); }

.hero p.sub {
  margin-top: 24px; color: var(--muted); font-size: 1.08rem; max-width: 52ch; line-height: 1.6;
}

.hero-cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero-badges { margin-top: 48px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Cards & grids ───────────────────────────────────────── */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 46px 0 20px;
}
.section-title h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.02em; }
.section-title .count { color: var(--muted); font-size: 0.9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

.card {
  background: linear-gradient(160deg, var(--card), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative; overflow: hidden;
  transition: transform 0.18s ease, border-color 0.2s;
}
a.card:hover, .card.clickable:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); }

.card h3 { font-size: 1.25rem; letter-spacing: -0.01em; margin-bottom: 8px; }
.card .meta { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.card .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.card-price {
  position: absolute; top: 20px; right: 20px; text-align: right;
  font-weight: 700; color: var(--acc); font-size: 0.95rem; line-height: 1.3;
}

/* ── Forms ───────────────────────────────────────────────── */
.form { display: grid; gap: 16px; max-width: 640px; }
.form-wide { max-width: none; }
.form-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

label.field { display: grid; gap: 7px; font-size: 0.85rem; color: var(--muted); font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="tel"], textarea, select {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); padding: 12px 14px; font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.2s; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--acc); }
textarea { resize: vertical; min-height: 90px; }

.check {
  display: flex; align-items: center; gap: 10px; font-size: 0.92rem; color: var(--ink);
  cursor: pointer; user-select: none;
}
.check input { accent-color: var(--acc); width: 18px; height: 18px; }

/* toggle block for pricing tiers */
.tier {
  border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 18px;
  transition: border-color 0.2s, background 0.2s;
}
.tier.on { border-style: solid; border-color: color-mix(in srgb, var(--acc) 50%, transparent); background: color-mix(in srgb, var(--acc) 5%, transparent); }
.tier .tier-body { display: none; margin-top: 14px; }
.tier.on .tier-body { display: grid; gap: 12px; }

/* ── Event page ──────────────────────────────────────────── */
.event-head { padding: 44px 0 8px; }
.event-head h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); letter-spacing: -0.03em; line-height: 1.05; max-width: 20ch; }
.event-head .meta-line { margin-top: 14px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; }

.tabs { display: flex; gap: 6px; margin: 30px 0 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  background: none; border: none; color: var(--muted); font-size: 0.95rem; font-weight: 500;
  padding: 10px 18px; cursor: pointer; border-radius: 12px 12px 0 0; position: relative;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--acc); }
.tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--acc);
}

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); margin-bottom: 18px; }
.panel h3 { margin-bottom: 14px; letter-spacing: -0.01em; }
.panel .hint { color: var(--muted); font-size: 0.85rem; line-height: 1.55; }

.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* quote box */
.quote { border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); border-radius: var(--radius-sm); padding: 16px 18px; background: color-mix(in srgb, var(--acc) 6%, transparent); }
.quote .line { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--muted); padding: 3px 0; }
.quote .total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.15rem; color: var(--acc); border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }

.qr-img { max-width: 240px; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; padding: 10px; }

/* ── Tables / lists ──────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.amount-pos { color: var(--ok); font-weight: 600; }
.amount-neg { color: var(--bad); font-weight: 600; }

/* transfers ("who owes whom") */
.transfer {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px;
  background: var(--card);
}
.transfer .arrow { color: var(--acc); font-weight: 700; }
.transfer .amt { margin-left: auto; font-weight: 700; color: var(--acc); font-variant-numeric: tabular-nums; }

/* activities */
.activity { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--card); overflow: hidden; }
.activity summary {
  list-style: none; cursor: pointer; padding: 16px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.activity summary::-webkit-details-marker { display: none; }
.activity summary .when { color: var(--muted); font-size: 0.85rem; }
.activity summary .spacer { flex: 1; }
.activity .body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.activity .assignees { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }

.md { color: var(--ink); font-size: 0.93rem; line-height: 1.65; margin-top: 14px; }
.md ul { margin: 8px 0 8px 20px; }
.md strong { color: var(--acc); }
.md p { margin: 8px 0; }

/* avatar chip */
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 0.85rem;
}
.chip .dot {
  width: 22px; height: 22px; border-radius: 50%; background: var(--acc); color: var(--acc-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700;
}

/* ── Auth panel ──────────────────────────────────────────── */
.auth-wrap { max-width: 460px; margin: 60px auto 0; }
.auth-wrap .panel { padding: 34px; }
.auth-toggle { display: flex; gap: 8px; margin-bottom: 24px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty { text-align: center; color: var(--muted); padding: 60px 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .big { font-size: 2.4rem; margin-bottom: 12px; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--acc); color: var(--acc-ink); font-weight: 600; font-size: 0.92rem;
  padding: 12px 22px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; z-index: 60; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); }
.footer-marquee { overflow: hidden; padding: 18px 0; white-space: nowrap; }
.marquee-track { display: inline-flex; animation: marquee 26s linear infinite; }
.marquee-track span {
  font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--muted);
  padding-right: 12px;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.footer-note { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 0 26px; }

/* fade-in for view changes */
.app > * { animation: fade 0.35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
