/* =========================================================
   Live — event components
   Extends the shared theme in email_manager/css/app.css.
   Flat surfaces, hairline borders, colour only where it means
   something.
   ========================================================= */

/* ---------- Brand lockup ---------- */
.ev-logo { height: 30px; width: auto; display: block; }
.ev-logo-lg { height: 84px; width: auto; }
.ev-byline {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border-left: 1px solid var(--line);
  padding-left: 0.6rem;
  white-space: nowrap;
}

/* =========================================================
   Public event page
   ========================================================= */

.ev-hero { margin-bottom: 2rem; animation: ev-rise 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .ev-hero, .page-head, .rise, .rise-d1, .rise-d2, .rise-d3, .rise-d4, .rise-d5, .rise-d6 {
    animation: none;
  }
}
.ev-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0.85rem 0 0;
  max-width: 20ch;
}
.ev-hero .ev-tagline {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.6;
  max-width: 58ch;
  margin: 0.9rem 0 0;
}

.ev-facts { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.5rem; }
.ev-fact {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.92rem; color: var(--ink-2);
}
.ev-fact i { color: var(--violet); font-size: 1.05rem; }

/* Cover images: shown as they are, in a simple frame.
   Organisers upload flyers, posters and banners; each is displayed at its own
   aspect ratio, centred, capped so a tall poster cannot take over the page.
   Nothing is cropped and nothing is padded out. The intrinsic width/height are
   emitted on the tag so the frame reserves the right space before the file
   arrives instead of collapsing. */
.ev-cover {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 2rem auto 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--canvas-2);
  line-height: 0;
}
.ev-cover img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 380px;
}
@media (max-width: 575.98px) {
  .ev-cover { margin-top: 1.5rem; }
  .ev-cover img { max-height: 300px; }
}

/* The flyer in the event page's left column: it fills that column's width
   rather than sitting small in the middle of it, but still keeps its own
   aspect ratio and is capped so a tall poster does not run past the ticket
   panel beside it. */
.ev-cover-panel { margin: 0 auto; }
.ev-cover-panel img { max-height: 560px; }
@media (max-width: 991.98px) {
  .ev-cover-panel img { max-height: 380px; }
}

/* Fixed-height frames — wizard preview and dashboard tiles — keep the grid
   tidy. The image still keeps its ratio inside them. */
.ev-cover-sm,
.ev-cover-tile { width: 100%; margin: 0; }
.ev-cover-sm img,
.ev-cover-tile img {
  width: 100%;
  object-fit: contain;
  margin: 0 auto;
}
.ev-cover-sm { border-radius: var(--r-lg); }
.ev-cover-sm img { height: 190px; max-height: 190px; }
.ev-cover-tile { border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.ev-cover-tile img { height: 168px; max-height: 168px; }

.ev-cover-placeholder,
.ev-card-cover-placeholder {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  color: var(--faint);
  background: var(--canvas-2);
}
.ev-cover-placeholder {
  height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.ev-card-cover-placeholder {
  width: 100%;
  height: 168px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* Rich description */
.ev-description { color: var(--text); font-size: 1rem; line-height: 1.75; }
.ev-description > *:first-child { margin-top: 0; }
.ev-description h2, .ev-description h3, .ev-description h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 1.6rem 0 0.6rem;
}
.ev-description h2 { font-size: 1.35rem; }
.ev-description h3 { font-size: 1.15rem; }
.ev-description a { color: var(--brand); border-bottom: 1px solid var(--brand-line); }
.ev-description ul, .ev-description ol { padding-left: 1.2rem; }
.ev-description li { margin-bottom: 0.35rem; }
.ev-description blockquote {
  border-left: 2px solid var(--brand-line);
  margin: 1.2rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  color: var(--muted);
}

/* Ticket / summary card */
.ev-ticket { position: sticky; top: 1.5rem; }
/* The event details scroll in their own area on desktop, so the flyer and the
   ticket panel beside them never leave the screen. The scrollbar itself is
   hidden — the region still scrolls by wheel, trackpad, touch and keyboard. */
@media (min-width: 992px) {
  .ev-aside {
    position: sticky;
    top: 1.5rem;
  }
  .ev-detail-scroll {
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    /* Deliberately NOT overscroll-behavior: contain — reaching the end of the
       details should carry on scrolling the page, and a region short enough to
       fit never becomes a scroll trap in the first place. */
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* legacy Edge */
  }
  .ev-detail-scroll::-webkit-scrollbar { width: 0; height: 0; }
}
/* Stacked on smaller screens: one page, one scroll. */
@media (max-width: 991.98px) {
  .ev-aside { position: static; }
  .ev-detail-scroll { max-height: none; overflow: visible; }
}
.ev-price {
  font-family: var(--font-display);
  font-size: 1.85rem; font-weight: 600; color: var(--ink); line-height: 1;
}
.ev-price small { font-family: var(--font-ui); font-size: 0.85rem; }
.ev-row {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--text); font-size: 0.92rem;
}
.ev-row:last-child { border-bottom: none; }
.ev-row-plain { border-bottom: 0 !important; }
.ev-row i { color: var(--violet); font-size: 1rem; margin-top: 1px; }
.ev-row .ev-row-label {
  display: block; font-size: 0.7rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint);
  margin-bottom: 2px;
}

/* Capacity meter */
.ev-meter-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem;
}

/* ---------- Location ---------- */
.ev-map iframe {
  width: 100%; height: 240px; border: 0;
  border-radius: var(--r); display: block;
}
/* Shown when no Maps API key is configured: a quiet card that hands the
   visitor off to Google Maps rather than an empty embed. */
.ev-map-link {
  display: flex; align-items: center; gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--canvas-2);
  padding: 1rem 1.1rem;
  color: var(--ink-2);
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.ev-map-link:hover {
  border-color: var(--brand-line); background: var(--brand-softer);
  box-shadow: var(--shadow-sm);
}
.ev-maps-icon {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: var(--r-sm);
  display: block;
  box-shadow: 0 1px 3px rgba(23, 20, 42, 0.12);
}
.ev-map-link .ev-map-title { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.ev-map-link .ev-map-sub { font-size: 0.83rem; color: var(--muted); }
.ev-map-link .ev-map-go { margin-left: auto; color: var(--violet); font-size: 1.1rem; }

/* =========================================================
   Registration form (public)
   ========================================================= */

.ev-form-section {
  margin: 2.25rem 0 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.ev-form-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.ev-form-section h2 {
  font-family: var(--font-display);
  font-size: 1.2rem; color: var(--ink); margin: 0 0 0.25rem;
}
.ev-form-note {
  background: var(--brand-softer);
  border: 1px solid var(--brand-line);
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.89rem;
  margin-bottom: 1.25rem;
}
.ev-field { margin-bottom: 1.3rem; }
.ev-field > label, .ev-field .ev-field-label {
  display: block;
  font-weight: 600; font-size: 0.88rem; color: var(--ink-2);
  margin-bottom: 0.4rem;
}
.ev-req { color: var(--bad); margin-left: 2px; }
.ev-field .form-text { margin-top: 0.3rem; }
.ev-field-error {
  display: flex; align-items: center; gap: 0.35rem;
  color: var(--bad); font-size: 0.82rem; font-weight: 550; margin-top: 0.35rem;
}
.ev-field.has-error .form-control,
.ev-field.has-error .form-select { border-color: #eeb4b4; }

/* Clickable choice cards */
.ev-choices { display: grid; gap: 0.4rem; padding: 0; margin: 0; list-style: none; }
.ev-choices[data-scrollable="true"] {
  max-height: 250px; overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--canvas-2);
}
.ev-choice-group {
  font-size: 0.73rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--faint); padding: 0.5rem 0.2rem 0.1rem;
}
.ev-choice {
  display: flex; align-items: center; gap: 0.7rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0.7rem 0.9rem;
  cursor: pointer; margin: 0;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.ev-choice:hover { border-color: var(--brand-line); background: var(--brand-softer); }
.ev-choice:has(input:checked) {
  border-color: var(--violet);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(109, 29, 232, 0.08);
}
.ev-choice input {
  width: 17px; height: 17px; flex-shrink: 0;
  accent-color: var(--violet); cursor: pointer;
}
.ev-choice-label { color: var(--ink-2); font-weight: 500; font-size: 0.94rem; }

/* Consent / agreement */
.ev-consent {
  display: flex; align-items: flex-start; gap: 0.7rem;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 0.85rem 1rem;
}
.ev-consent .form-check-input { margin-top: 0.15rem; flex-shrink: 0; }
.ev-consent label { font-size: 0.91rem; color: var(--ink-2); margin: 0; cursor: pointer; }

/* File input */
.ev-file input[type="file"] { padding: 0.45rem 0.8rem; }
.ev-file input[type="file"]::file-selector-button {
  border: 0; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 600; font-size: 0.84rem;
  padding: 0.32rem 0.8rem; margin-right: 0.8rem;
  cursor: pointer;
}

/* =========================================================
   Wizard stepper
   ========================================================= */

.ev-steps {
  display: flex; flex-wrap: nowrap; gap: 0.2rem; align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  margin-bottom: 1.75rem;
  overflow-x: auto;
}
.ev-step {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.82rem; font-weight: 550; color: var(--muted);
  padding: 0.42rem 0.75rem; border-radius: var(--pill);
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.ev-step:hover { background: var(--canvas-2); color: var(--ink-2); }
.ev-step .ev-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.67rem; font-weight: 700;
  background: var(--canvas-2); color: var(--faint);
}
.ev-step.active {
  color: var(--brand); background: var(--brand-soft);
  font-weight: 650; box-shadow: 0 0 0 3px rgba(109, 29, 232, 0.06);
}
.ev-step.active .ev-step-num { background: var(--brand); color: #fff; }
.ev-step.done .ev-step-num { background: var(--ok-soft); color: var(--ok); }

/* Public-link strip */
.ev-linkbar {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 0.3rem 0.35rem 0.3rem 0.7rem;
  font-size: 0.82rem;
  max-width: 100%;
}
.ev-linkbar .ev-link-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 44ch;
}

/* =========================================================
   Form builder
   ========================================================= */

.ev-palette-group + .ev-palette-group { margin-top: 1rem; }
.ev-palette-title {
  font-size: 0.67rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 0.45rem;
}
.ev-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
.ev-type {
  display: flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r-xs);
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.ev-type:hover { border-color: var(--brand-line); background: var(--brand-softer); }
.ev-type i {
  color: var(--muted); font-size: 0.9rem;
  width: 22px; height: 22px; flex: 0 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--canvas-2);
}
.ev-type .ev-type-name {
  font-size: 0.81rem; font-weight: 550; color: var(--ink-2); line-height: 1.2;
}
.ev-type.is-active {
  border-color: var(--violet);
  background: var(--brand-soft);
}
.ev-type.is-active i { background: var(--brand); color: #fff; }
.ev-type.is-active .ev-type-name { color: var(--brand); font-weight: 650; }
.ev-type-hint { color: var(--muted); font-size: 0.79rem; margin: 0.55rem 0 0; min-height: 2.2em; }

.ev-editor-panel { position: sticky; top: 1.5rem; }
.ev-editor-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 1rem;
}
/* Only the blocks relevant to the selected type are shown. */
[data-when-type] { display: none; }
[data-when-type].is-shown { display: block; }

/* Options repeater */
.ev-options { display: flex; flex-direction: column; gap: 0.35rem; }
.ev-option-row {
  display: flex; align-items: center; gap: 0.35rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  padding: 0.2rem 0.3rem 0.2rem 0.4rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ev-option-row:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(109, 29, 232, 0.1);
}
.ev-option-row.is-dragging { opacity: 0.4; }
.ev-option-row .ev-option-grip { color: #c9c5d6; cursor: grab; font-size: 0.95rem; line-height: 1; }
.ev-option-row input[type="text"] {
  flex: 1 1 auto;
  border: 0; outline: none; background: transparent;
  font-size: 0.88rem; color: var(--ink-2);
  padding: 0.35rem 0.1rem;
}
.ev-option-row input[type="text"]::placeholder { color: #bab6c8; }
.ev-option-num {
  font-size: 0.69rem; font-weight: 700; color: var(--faint);
  min-width: 1.3em; text-align: right;
}
.ev-option-remove {
  border: 0; background: transparent; color: var(--faint);
  width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background-color 0.12s ease, color 0.12s ease;
}
.ev-option-remove:hover { background: var(--bad-soft); color: var(--bad); }
.ev-options-add {
  align-self: flex-start;
  border: 1px dashed var(--brand-line);
  background: transparent;
  color: var(--brand);
  font-size: 0.82rem; font-weight: 600;
  border-radius: var(--r-xs);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.ev-options-add:hover { background: var(--brand-soft); }
.ev-options-bulk {
  border: 0; background: transparent; color: var(--muted);
  font-size: 0.79rem; text-decoration: underline; cursor: pointer; padding: 0;
}

/* Key input */
.ev-key-input { display: flex; align-items: stretch; }
.ev-key-input .ev-key-lock {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line-strong); border-right: 0;
  border-radius: var(--r-xs) 0 0 var(--r-xs);
  background: var(--canvas-2); color: var(--faint);
  padding: 0 0.65rem; font-size: 0.82rem;
}
.ev-key-input input {
  border-radius: 0 var(--r-xs) var(--r-xs) 0 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem !important;
}

/* Live preview */
.ev-preview-pane {
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.05rem;
}
.ev-preview-pane .form-control,
.ev-preview-pane .form-select,
.ev-preview-pane .ev-choice { pointer-events: none; }

/* Field list */
.ev-builder-list { display: flex; flex-direction: column; gap: 0.4rem; }
.ev-builder-row {
  display: flex; align-items: center; gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.ev-builder-row:hover { border-color: var(--line-strong); }
.ev-builder-row.is-editing { border-color: var(--violet); background: var(--brand-softer); }
.ev-builder-row.is-dragging { opacity: 0.4; }
.ev-builder-row.is-static { background: var(--canvas-2); }
.ev-builder-row .grip { color: #cdc9d8; font-size: 1rem; cursor: grab; line-height: 1; }
.ev-builder-row .grip:active { cursor: grabbing; }
.ev-builder-row .ev-row-icon {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: var(--r-xs);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand); font-size: 0.88rem;
}
.ev-builder-row .label {
  font-weight: 600; color: var(--ink-2); font-size: 0.92rem;
  display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
}
.ev-builder-row .meta {
  color: var(--muted); font-size: 0.77rem; margin-top: 2px;
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
}
.ev-builder-row .meta code {
  color: var(--ink-2); background: var(--canvas-2);
  border-radius: 4px; padding: 0.05rem 0.3rem; font-size: 0.95em;
}
.ev-builder-row .actions { margin-left: auto; display: flex; align-items: center; gap: 0.15rem; }
.ev-builder-row .actions form { display: inline; margin: 0; }
.ev-tag-req, .ev-mapped-tag {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px; padding: 0.12rem 0.4rem;
}
.ev-tag-req { color: var(--bad); background: var(--bad-soft); }
.ev-mapped-tag { color: var(--brand); background: var(--brand-soft); }

/* =========================================================
   Rich editor + map picker (wizard)
   ========================================================= */

.ev-editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.15rem;
  background: var(--canvas-2);
  border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: var(--r-xs) var(--r-xs) 0 0;
  padding: 0.3rem;
}
.ev-editor-toolbar button {
  border: 0; background: transparent; color: var(--ink-2);
  width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; cursor: pointer;
  transition: background-color 0.12s ease;
}
.ev-editor-toolbar button:hover { background: #fff; color: var(--brand); }
.ev-editor {
  min-height: 220px; background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 var(--r-xs) var(--r-xs);
  padding: 0.95rem 1rem; outline: none;
  line-height: 1.7; color: var(--text);
}
.ev-editor:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(109, 29, 232, 0.12);
}
.ev-editor:empty::before { content: attr(data-placeholder); color: #bab6c8; }
.ev-editor h2 { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }

.ev-map-picker {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-top: 0.6rem;
}
.ev-map-picker #map-canvas { height: 280px; background: var(--canvas-2); }

/* =========================================================
   Success / closed states
   ========================================================= */

.ev-success-icon {
  width: 68px; height: 68px; margin: 0 auto 1.1rem;
  border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 0 0 10px rgba(15, 157, 110, 0.06), var(--shadow-xs);
}
.ev-ref-chip {
  display: inline-block;
  letter-spacing: 0.1em; font-weight: 700; font-size: 1.35rem;
  background: var(--brand-soft); color: var(--brand);
  border-radius: var(--r-sm);
  padding: 0.65rem 1.3rem; margin: 0.35rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Helpers ---------- */
.ev-center { text-align: center; }
.ev-success-title { font-size: clamp(1.8rem, 4vw, 2.5rem); }

/* A gentle callout box for toggles and short rules (wizard settings). */
.ev-switch-card {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r);
  background: var(--brand-softer);
  border: 1px solid var(--brand-line);
}

/* Compact headline used inside the in-page preview. */
.ev-preview-title { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }

/* Expansion row inside the registrations table. */
.reg-answers { background: var(--brand-softer); }

@media (max-width: 991.98px) {
  .ev-ticket, .ev-editor-panel { position: static; }
}
@media (max-width: 575.98px) {
  .ev-palette { grid-template-columns: 1fr; }
  .ev-facts { gap: 0.8rem 1.2rem; }
}
