@import url("https://fonts.googleapis.com/css2?family=Forum&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  color-scheme: dark;
  --page-bg: #172313;
  --button-bg: #f4dfb3;
  --button-fg: #111111;
  --event-type-color: #f8f4ec;
  --event-title-color: #f8f4ec;
  --details-color: #f8f4ec;
  --address-color: #d7d2c8;
  --description-color: #f8f4ec;
  --registration-color: #f8f4ec;
  --attendee-color: #f8f4ec;
  --map-color: #f8f4ec;
  --text: #f8f4ec;
  --event-type-size: clamp(28px, 4.3vw, 50px);
  --event-title-size: clamp(38px, 5.7vw, 66px);
  --muted: rgba(248, 244, 236, 0.72);
  --faint: rgba(248, 244, 236, 0.48);
  --line: rgba(248, 244, 236, 0.16);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --display-font: "Forum", Georgia, serif;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
}

.public-page.app-loading .event-shell {
  visibility: hidden;
}

body,
button,
input,
select,
textarea,
.rich-editor {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input,
select,
textarea,
.rich-editor {
  border-radius: var(--radius);
}

button {
  cursor: pointer;
}

.topbar {
  width: min(calc(100% - 32px), 1120px);
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 700;
}

.topbar-actions a {
  color: var(--muted);
}

.topbar-actions a:hover {
  color: var(--text);
}

.topbar-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 800;
}

.event-shell {
  width: min(calc(100% - 32px), 930px);
  margin: 0 auto;
  padding: 54px 0 96px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.event-sidebar {
  position: sticky;
  top: 24px;
}

.event-cover-wrap {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.event-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.side-block {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.attendee-panel,
.attendee-panel .side-label,
.attendee-count,
.attendee-names {
  color: var(--attendee-color);
}

.side-label,
.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.attendee-count {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
}

.avatar-strip {
  min-height: 34px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-left: 2px;
}

.avatar {
  width: 32px;
  height: 32px;
  margin-left: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--page-bg);
  border-radius: 999px;
  background: var(--button-bg);
  color: #172313;
  font-size: 11px;
  font-weight: 900;
}

.avatar:first-child {
  margin-left: 0;
}

.attendee-names {
  min-height: 22px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.secondary-action,
.ghost-button,
.primary-button,
.waze-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  font-weight: 700;
}

.secondary-action {
  width: 100%;
  margin-top: 20px;
  padding: 0 18px;
  background: var(--button-bg);
  color: var(--button-fg);
  border: 1px solid var(--line);
}

.instagram-action {
  width: 38px;
  height: 38px;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.instagram-action span {
  width: 28px;
  height: 28px;
  display: block;
  background: var(--button-bg);
  -webkit-mask: url("assets/instagram.svg") center / contain no-repeat;
  mask: url("assets/instagram.svg") center / contain no-repeat;
}

.instagram-action:hover {
  filter: brightness(1.06);
}

.event-main {
  min-width: 0;
}

.event-kicker {
  margin: 4px 0 8px;
}

.pill {
  display: block;
  color: var(--event-type-color);
  font-family: var(--display-font);
  font-size: var(--event-type-size);
  font-weight: 200;
  line-height: 1.02;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: var(--event-title-size);
  line-height: 1.02;
  letter-spacing: 0;
}

#eventTitle {
  color: var(--event-title-color);
  font-family: var(--display-font);
  font-weight: 200;
}

h2 {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.event-facts {
  margin: 28px 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.event-facts,
.event-facts .fact-title,
.event-facts .fact-subtitle,
.date-tile {
  color: var(--details-color);
}

.fact-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.date-tile,
.fact-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.date-tile {
  flex-direction: column;
  gap: 1px;
}

.date-tile span {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.date-tile strong {
  font-size: 18px;
  line-height: 1;
}

.fact-icon {
  color: var(--details-color);
  font-size: 24px;
}

.fact-title,
.fact-subtitle {
  margin: 0;
}

.fact-title {
  font-weight: 700;
  line-height: 1.35;
}

.fact-subtitle {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.35;
}

.address-line {
  margin: 8px 0 28px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--address-color);
  font-size: 14px;
  line-height: 1.35;
}

.waze-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  background: var(--button-bg);
  color: var(--button-fg);
}

.waze-button img {
  width: 21px;
  height: 21px;
}

.content-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.description-text {
  margin: 0;
  white-space: normal;
  color: var(--description-color);
  font-size: 17px;
  font-weight: 350;
  line-height: 1.55;
}

.description-text p,
.description-text div {
  margin: 0 0 1em;
}

.description-text > :last-child {
  margin-bottom: 0;
}

.registration-card {
  margin: 10px 0 26px;
  border: 1px solid color-mix(in srgb, var(--button-bg) 38%, var(--line));
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.registration-card h2 {
  margin: 0;
  padding: 14px 16px;
  background: var(--panel-strong);
  color: var(--registration-color);
  border-bottom: 1px solid var(--line);
}

#registrationState {
  padding: 18px 16px 16px;
}

.registration-form {
  display: grid;
  gap: 14px;
}

.registration-card,
.registration-card .field,
.success-title,
.payment-note {
  color: var(--registration-color);
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #131313;
  padding: 0 13px;
  outline: none;
  font-weight: 500;
}

.field textarea {
  min-height: 150px;
  padding: 12px 13px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--button-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-bg) 22%, transparent);
}

.rich-field {
  gap: 10px;
}

.rich-toolbar {
  display: grid;
  grid-template-columns: 1.2fr 1fr 46px 92px 76px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.rich-toolbar label,
.rich-toolbar .color-format-field {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.rich-toolbar select,
.rich-toolbar input,
.color-toggle {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #131313;
  padding: 0 9px;
  outline: none;
}

.rich-toolbar input[type="color"] {
  padding: 4px;
}

.color-format-field {
  position: relative;
}

.color-toggle {
  align-items: center;
  justify-content: center;
  display: grid;
  grid-template-columns: 18px auto;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
}

.color-preview-dot {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 50%;
  background: #f8f4ec;
}

.color-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 224px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--page-bg);
  box-shadow: var(--shadow);
}

.color-native-field {
  margin-bottom: 10px;
}

.color-native-field input[type="color"] {
  width: 100%;
  min-height: 54px;
  padding: 4px;
  cursor: pointer;
}

.format-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 700;
}

.format-button.is-active {
  background: var(--button-bg);
  color: var(--button-fg);
}

.format-ok-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--button-fg);
  font-size: 12px;
  font-weight: 900;
}

.rich-editor {
  min-height: 230px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  color: #131313;
  outline: none;
  line-height: 1.55;
  overflow-y: auto;
}

.rich-editor:focus {
  border-color: var(--button-bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--button-bg) 22%, transparent);
}

.rich-editor p,
.rich-editor div {
  margin: 0 0 1em;
}

.rich-editor > :last-child {
  margin-bottom: 0;
}

.primary-button {
  padding: 0 20px;
  background: var(--button-bg);
  color: var(--button-fg);
}

.primary-button.wide {
  width: 100%;
}

.form-error {
  margin: 0;
  color: #ffd3d3;
  font-size: 14px;
  font-weight: 750;
}

.success-block {
  display: grid;
  gap: 16px;
}

.success-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.payment-note {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.payment-note a {
  color: var(--button-bg);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.map-location-name,
.map-address {
  margin: 0;
  color: var(--map-color);
}

#mapTitle {
  color: var(--map-color);
}

.map-location-name {
  font-weight: 700;
}

.map-address {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
}

.map-link {
  display: block;
  position: relative;
  margin-top: 16px;
  height: 260px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
}

.map-link iframe {
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.map-hit {
  position: absolute;
  inset: 0;
  display: block;
}

.admin-shell,
.auth-shell {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  padding: 12px 0 90px;
}

.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 430px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-bottom: 22px;
  font-size: clamp(38px, 8vw, 64px);
}

.login-form {
  display: grid;
  gap: 14px;
}

.admin-hero,
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-hero {
  margin-bottom: 22px;
}

.admin-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.admin-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.admin-card h2 {
  color: var(--text);
}

.admin-subtitle {
  margin: 24px 0 14px;
  color: var(--text);
  font-size: 16px;
}

.admin-card form,
.admin-card {
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
}

.admin-preview-wrap {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
}

.admin-preview {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.compact {
  min-height: 38px;
}

.waze-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.ghost-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.ghost-button:hover,
.secondary-action:hover {
  filter: brightness(1.05);
}

.ghost-button.danger {
  color: #ffd3d3;
}

.color-field input {
  width: 82px;
  min-height: 44px;
  padding: 4px;
  background: transparent;
}

.color-controls {
  display: grid;
  gap: 12px;
}

.color-preview {
  min-height: 54px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 900;
}

.admin-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.registrations-admin {
  margin-top: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
}

td {
  color: var(--text);
  font-weight: 650;
}

.table-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: #ffd3d3;
  font-weight: 800;
}

.empty-table {
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--button-bg);
  color: var(--button-fg);
  font-weight: 900;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .event-shell {
    display: flex;
    flex-direction: column;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .event-sidebar {
    display: contents;
    position: static;
  }

  .event-cover-wrap {
    order: 1;
    width: min(100%, 520px);
    margin: 0 auto;
  }

  .event-main {
    order: 2;
    text-align: center;
  }

  .attendee-panel {
    order: 3;
  }

  .secondary-action {
    order: 4;
    margin-top: -14px;
  }

  .instagram-action {
    order: 5;
  }

  .event-facts {
    grid-template-columns: 1fr;
  }

  .public-page h1 {
    margin-inline: auto;
  }

  .public-page .pill,
  .public-page .content-section,
  .public-page .registration-card,
  .public-page .attendee-panel,
  .public-page .secondary-action,
  .public-page .instagram-action {
    text-align: center;
  }

  .public-page .fact-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .public-page .avatar-strip {
    justify-content: center;
  }

  .public-page .registration-form,
  .public-page .registration-form .field {
    text-align: left;
  }

  .admin-hero,
  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar {
    width: min(calc(100% - 24px), 1120px);
  }

  .event-shell,
  .admin-shell,
  .auth-shell {
    width: min(calc(100% - 24px), 1120px);
  }

  .event-shell {
    padding-top: 24px;
  }

  .address-line,
  .waze-admin-row,
  .field-row {
    grid-template-columns: 1fr;
  }

  .address-line {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .waze-button {
    width: 100%;
  }

  .map-link {
    height: 220px;
  }

  .rich-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .format-button {
    width: 100%;
  }
}
