:root {
  /* Light theme, matching the homepage: lavender page, white cards,
     purple/pink accents. */
  --bg: #faf7ff;
  --card: #ffffff;
  --card-2: #f4eefc;
  --line: #e7ddf7;
  --text: #14061f;
  --muted: #6b5b7a;
  --accent: #6d28d9;
  --accent-press: #5b21b6;
  --accent-2: #ff3d7f;
  --grad: linear-gradient(135deg, #6d28d9, #ff3d7f);
  --good: #16a34a;
  --danger: #e11d48;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  flex: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 18px;
  margin-bottom: 22px;
}
.brand .dot {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--grad);
  display: grid; place-items: center; font-size: 15px;
}

h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 18px; margin: 0 0 12px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }

/* ---- Homepage hero ---- */
.hero { text-align: center; margin: 6px 0 24px; }
.hero h1 { font-size: 31px; line-height: 1.1; margin: 0 0 14px; }
.lede {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 42ch;
}

.create-card { margin-bottom: 8px; }

/* 3-step flow */
ol.flow {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 13px;
}
ol.flow li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.4;
}
ol.flow b { color: var(--text); font-weight: 600; }
.flow-n {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 600;
}

input[type="text"], input[type="email"] {
  width: 100%;
  font-size: 17px; /* >=16px avoids iOS zoom-on-focus */
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  margin-bottom: 14px;
  transition: border-color .15s ease;
}
input:focus { outline: none; border-color: var(--accent); }

button {
  width: 100%;
  font-size: 17px;
  font-weight: 700;
  padding: 15px 16px;
  border: none;
  border-radius: 12px;
  background: var(--grad);
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(109, 40, 217, .22);
  transition: filter .15s ease, transform .05s ease, box-shadow .2s ease;
}
button:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(109, 40, 217, .3); }
button:active { transform: scale(0.99); }
button:disabled { opacity: .5; cursor: not-allowed; }

button.secondary {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
button.secondary:hover { background: #ece2fb; filter: none; box-shadow: none; }

.error { color: var(--danger); font-size: 14px; margin: 6px 0 0; min-height: 18px; }
.hidden { display: none !important; }

/* QR + share block */
.qr-wrap { text-align: center; }
.qr-wrap img {
  width: 100%;
  max-width: 280px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
}
.linkrow {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.linkrow input { margin-bottom: 0; font-size: 14px; }
.linkrow button { width: auto; padding: 0 16px; white-space: nowrap; }

/* Attendee list */
.count-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; margin-bottom: 14px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(56,193,114,.6); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(56,193,114,.5); }
  70% { box-shadow: 0 0 0 7px rgba(56,193,114,0); }
  100% { box-shadow: 0 0 0 0 rgba(56,193,114,0); }
}
.live-dot.off { background: var(--muted); animation: none; }

ul.people { list-style: none; padding: 0; margin: 0; }
ul.people li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
}
ul.people li:last-child { border-bottom: none; }
.people .nm { font-weight: 600; }
.people .em { color: var(--muted); font-size: 14px; text-decoration: none; }
.people .em:hover { color: var(--accent); }
.people .me { color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #14061f; color: #fff; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  box-shadow: 0 12px 30px rgba(20, 6, 31, .3);
  transition: opacity .2s ease, transform .2s ease; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* "Your events" (localStorage) */
#myEvents { margin-top: 28px; }
ul.events { list-style: none; padding: 0; margin: 0; }
ul.events li { display: flex; gap: 8px; margin-bottom: 8px; }
.evt-open {
  flex: 1; text-align: left; background: var(--card); border: 1px solid var(--line);
  color: var(--text); box-shadow: none;
  border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 3px;
}
.evt-open:hover { background: var(--card-2); filter: none; box-shadow: none; }
.evt-open .evt-name { font-weight: 600; font-size: 16px; }
.evt-open .evt-meta { color: var(--muted); font-size: 12px; }
.evt-forget {
  width: 46px; flex: 0 0 auto; background: var(--card); border: 1px solid var(--line);
  color: var(--muted); border-radius: 12px; font-size: 15px; box-shadow: none;
}
.evt-forget:hover { background: var(--card-2); color: var(--danger); filter: none; box-shadow: none; }

.ev-name-small { font-weight: 600; text-align: center; margin: 14px 0 0; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row button { width: 100%; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: 16px 0; line-height: 1.5; }
#shareBtn { margin-top: 16px; }
#copyImg { margin-top: 10px; }
#newEvent { margin-top: 18px; }

footer {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 18px; opacity: .8; line-height: 1.6;
}
a.plain { color: var(--accent); text-decoration: none; }
a.plain:hover { text-decoration: underline; }

/* ---- My events index page (/events) -------------------------------------- */
.ev-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.ev-item { display: flex; align-items: stretch; gap: 10px; }
.ev-main-link {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: transform .06s ease, box-shadow .2s ease;
}
.ev-main-link:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(109, 40, 217, .12); }
.ev-qr {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  padding: 0 18px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .01em;
  text-decoration: none;
  transition: transform .06s ease, box-shadow .2s ease, background .15s ease;
}
.ev-qr:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(109, 40, 217, .12); background: var(--card-2); }
.ev-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.ev-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-nm { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-meta { color: var(--muted); font-size: 12.5px; }
.ev-tag {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 750;
  text-transform: uppercase; letter-spacing: .03em;
  padding: 5px 11px; border-radius: 999px; color: #fff;
}
.ev-tag.organizer { background: var(--grad); }
.ev-tag.attendee { background: linear-gradient(135deg, #3d8bff, #3dd7ff); }

.empty-events {
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-size: 15px; line-height: 1.5;
}
.empty-events .ic { font-size: 34px; margin-bottom: 10px; }
.empty-events .btn { margin-top: 18px; }

/* Profile entry point at the foot of the events page */
.ev-profile { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.ev-profile .btn { display: block; }

/* ---- Shared bits: nav, tags, extra inputs, anchor buttons ---------------- */
.brand-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--text); }

.req { color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.opt { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.muted { color: var(--muted); }

input[type="tel"], input[type="url"], textarea {
  width: 100%;
  font-size: 17px; /* >=16px avoids iOS zoom-on-focus */
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  margin-bottom: 14px;
  font-family: inherit;
  transition: border-color .15s ease;
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
textarea:focus { outline: none; border-color: var(--accent); }

/* Anchor styled as a button */
.btn {
  display: inline-block; text-align: center; text-decoration: none;
  font-size: 16px; font-weight: 700; padding: 14px 20px;
  border-radius: 12px; background: var(--grad); color: #fff;
  box-shadow: 0 8px 20px rgba(109, 40, 217, .22);
  transition: filter .15s ease, transform .05s ease, box-shadow .2s ease;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(109, 40, 217, .3); }
.btn:active { transform: scale(0.99); }
.btn.secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.secondary:hover { background: #ece2fb; filter: none; box-shadow: none; }

/* ---- Marketing homepage -------------------------------------------------- */
.hero { text-align: center; margin: 10px 0 40px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--card-2); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 34px; line-height: 1.08; margin: 0 0 14px; }
.hero .lede { max-width: 44ch; }
.cta-row { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 12px; }
.cta-row .btn { width: 100%; }
.microcopy { color: var(--muted); font-size: 13px; margin: 0; }
@media (min-width: 480px) { .cta-row { flex-direction: row; } }

.how { margin: 8px 0 34px; }
.how h2 { text-align: center; margin-bottom: 18px; }
.how-grid { display: grid; gap: 12px; }
.how-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.how-ic { font-size: 26px; margin-bottom: 8px; }
.how-card h3 { margin: 0 0 6px; font-size: 16px; }
.how-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.organizer-cta .card { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.organizer-cta h3 { margin: 0 0 6px; }

/* ---- Your details page --------------------------------------------------- */
/* .privacy-banner is shared: it's the "before you enter anything" note on both
   /profile (stays local) and the join gate (goes public). */
.privacy-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(109, 40, 217, .06); border: 1px solid rgba(109, 40, 217, .18);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 16px;
  font-size: 13.5px; line-height: 1.5; color: var(--text);
}
.pb-ic { flex: 0 0 auto; }
.saved-msg { color: var(--good); font-weight: 600; font-size: 14px; text-align: center; margin: 14px 0 0; }
.danger-btn { margin-top: 22px; }
.danger-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ---- Print-only sheet ---------------------------------------------------- */
.print-only { display: none; }

/* Zero page margins so Chrome/Safari drop their date/title/URL/page-number
   headers (they only render when the margin leaves room for them). The sheet
   supplies its own 0.5in padding, so nothing lands in the unprintable edge. */
@page { margin: 0; }

@media print {
  /* Percentage heights resolve against the page box, so the sheet is exactly
     one page in either orientation — no fixed inches to overflow into page 2. */
  html, body { height: 100%; margin: 0; padding: 0; background: #fff; color: #000; }
  body > *:not(#printSheet) { display: none !important; }
  .print-only {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28in;
    box-sizing: border-box;
    height: 100%;
    padding: 0.5in;
    text-align: center;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
  }
  /* The QR SVG carries only a viewBox (no width/height), so `height: auto`
     has nothing to resolve against and it stretches to fill. Size it in
     absolute units instead — 2.4in scans fine from across a table. */
  #printSheet .ps-qr { width: 2.4in; height: 2.4in; }
  #printSheet .ps-qr svg, #printSheet .ps-qr img {
    width: 2.4in; height: 2.4in; aspect-ratio: 1 / 1; display: block;
  }
  #printSheet .ps-name { font-size: 26pt; font-weight: 800; letter-spacing: -0.02em; max-width: 90%; }
  #printSheet .ps-cta { font-size: 18pt; font-weight: 700; }
  #printSheet .ps-url { font-size: 11pt; color: #333; word-break: break-all; }
}
