/* =====================================================
   Events feature styles.
   Loaded once from index.html. Scope: the resident's
   Events panel (list, empty state, create form, live-row lift).
   Event detail (modal) still uses the pass-ticket vocabulary
   from pass.css.
   ===================================================== */

/* ---------- Form section grouping ----------
   Two-tier form pattern used across long forms: a small tracked
   caps label ("WHEN", "ABOUT") over a bordered group card that
   holds related fields. Sits above .field so its own styles win.
*/
.form-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.form-section__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
  margin: 0;
  padding-left: 4px;
}
.form-section__group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
}
/* A side-by-side pair inside a group (Starts / Ends). Collapses to
   stacked on very narrow phones so native pickers don't clip. */
.form-section__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 340px) {
  .form-section__row { grid-template-columns: 1fr; }
}

/* Live-composed "when" phrase, echoed back to the host as they
   fill the date/time inputs. Warm tint so it reads as a preview,
   not another input. */
.evt-when-preview {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--text-primary);
  text-align: center;
  min-height: 1.4em;
  transition: color var(--duration-fast);
}
.evt-when-preview--empty {
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 400;
}

/* ---------- Empty state (warmer) ----------
   The Events tab is opt-in; a lot of residents will never open it
   unless something invites them in. Softer paper card with a serif
   line and a real prompt.
*/
.evt-empty {
  background:
    linear-gradient(180deg, var(--surface-sunken) 0%, var(--surface-raised) 70%);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 34px 22px 26px;
  text-align: center;
}
.evt-empty__eyebrow {
  font-style: italic;
  font-weight: 400;
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.evt-empty__title {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 auto 10px;
  max-width: 18ch;
  color: var(--text-primary);
  text-wrap: balance;
}
.evt-empty__sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 0 auto 20px;
  max-width: 32ch;
  line-height: 1.5;
}
.evt-empty__cta {
  padding: 12px 22px;
}

/* ---------- Event row ----------
   Dedicated row (not pass-row) because events carry an arrival
   count column and a live-lift state that passes don't.
*/
.evt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast),
    background var(--duration-fast);
}
.evt-row + .evt-row { margin-top: 10px; }
.evt-row:hover { background: var(--surface-sunken); }
.evt-row:focus-visible {
  outline: 2px solid var(--color-focus, #4c8bf5);
  outline-offset: 2px;
}

.evt-row__chip {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--text-primary);
  color: var(--surface-raised);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
}
.evt-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.evt-row__name {
  font-size: 14.5px;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evt-row__sub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.evt-row__count {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1.2;
  flex-shrink: 0;
  min-width: 46px;
}
.evt-row__count strong {
  display: block;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

/* Live lift: happening right now. Green ring at low opacity so the
   row draws the eye in a list without shouting. Same pulse motion
   as elsewhere in the app; if it pulses, it's live. */
.evt-row--live {
  border-color: rgba(13, 157, 88, 0.35);
  box-shadow: 0 0 0 3px rgba(13, 157, 88, 0.06);
}
.evt-row--live .evt-row__chip {
  background: var(--color-allow, #0d9d58);
  color: #fff;
}

/* Live badge (dot + label) used inside .evt-row__sub. */
.evt-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(13, 157, 88, 0.12);
  color: #0a7a44;
  font-size: 10.5px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.evt-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-allow, #0d9d58);
  box-shadow: 0 0 0 0 rgba(13, 157, 88, 0.55);
  animation: evt-live-pulse 2.4s ease-in-out infinite;
}
@keyframes evt-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 157, 88, 0.55); }
  50%      { box-shadow: 0 0 0 4px rgba(13, 157, 88, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .evt-live-dot { animation: none; }
}
