:root {
  --bg-top: #f4f7fb;
  --bg-bottom: #eef2f8;
  --shape-main: #cde8ef;
  --shape-alt: #d7e2f2;
  --card: rgba(255, 255, 255, 0.95);
  --text-main: #1f242d;
  --text-soft: #6b717f;
  --border-soft: #d2d8e4;
  --brand: #106a86;
  --ok: #1f9d55;
  --error: #c53030;
  --shadow: 0 16px 45px rgba(29, 48, 74, 0.12);
  --radius: 26px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-x: hidden;
}

.background-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  opacity: 0.6;
  filter: blur(2px);
  animation: float 8s ease-in-out infinite alternate;
}

.shape-a {
  width: 420px;
  height: 420px;
  background: var(--shape-main);
  top: -210px;
  right: -120px;
  border-radius: 52% 48% 44% 56% / 51% 41% 59% 49%;
}

.shape-b {
  width: 330px;
  height: 330px;
  background: var(--shape-alt);
  bottom: -160px;
  left: -80px;
  border-radius: 40% 60% 66% 34% / 35% 44% 56% 65%;
  animation-delay: 0.8s;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(950px, calc(100% - 2rem));
  margin: 2.3rem auto 3rem;
  display: grid;
  gap: 1rem;
}

.app-shell-wide {
  width: min(1780px, calc(100% - 2rem));
}

.panel {
  background: var(--card);
  backdrop-filter: blur(3px);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(50, 77, 108, 0.12);
  animation: rise 700ms ease-out;
}

.auth-panel {
  max-width: 860px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  background: #e9edf4;
  color: #4e5a6c;
  cursor: pointer;
  font-weight: 600;
}

.tab.is-active {
  background: var(--brand);
  color: #f5fbff;
}

.stack,
.register-grid {
  display: grid;
  gap: 1rem;
}

.register-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-soft);
}

.full {
  grid-column: 1 / -1;
}

.form-title {
  margin: 0 0 1.5rem;
  font-family: "Fraunces", Georgia, serif;
  text-align: center;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  color: #202530;
}

.required {
  color: #e6465c;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font: inherit;
  background: #ffffff;
  color: var(--text-main);
  padding: 0.8rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea {
  border-radius: 16px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #4993a8;
  box-shadow: 0 0 0 3px rgba(73, 147, 168, 0.18);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 5.6rem;
}

.icon-btn {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  border: 0;
  color: #3a4d58;
  background: #edf2f7;
  padding: 0.38rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 700;
}

button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  color: #fff;
  background: var(--brand);
}

button:hover {
  filter: brightness(1.03);
}

button.ghost {
  color: var(--text-main);
  background: #e3eaf1;
}

.primary-btn {
  background: var(--brand);
}

.secondary-btn {
  background: #ffffff;
  color: #4d5563;
  border: 1px solid var(--border-soft);
}

.hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.message {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  font-weight: 600;
}

.message.success {
  color: var(--ok);
}

.message.error {
  color: var(--error);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-title-row h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.dashboard-panel {
  width: 100%;
  margin: 0 auto;
}

.user-panel {
  width: 100%;
  margin: 0 auto;
}

.user-page-title {
  margin: 0 0 1.2rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}

.user-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.2rem;
  border: 1px solid #ebeff4;
  border-radius: 14px;
  overflow: hidden;
}

.user-sidebar {
  background: #fbfdff;
  border-right: 1px solid #ebeff4;
  padding: 0.4rem 0;
  position: sticky;
  top: 1rem;
  align-self: start;
  height: fit-content;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #4d5767;
  border-radius: 0;
  padding: 0.8rem 1rem;
  font-weight: 500;
}

.user-menu-item.is-active {
  background: #ffffff;
  color: #0d5d78;
  border-left: 3px solid #0d6e8f;
  padding-left: 0.85rem;
}

.user-content {
  padding: 1.4rem 1.2rem;
}

.user-header-row {
  margin-bottom: 0.9rem;
}

.user-header-row h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
}

.user-tabs {
  display: inline-flex;
  border-bottom: 1px solid #ebeff4;
  width: 100%;
  margin-bottom: 1rem;
  gap: 0.3rem;
}

.user-tab {
  display: inline-block;
  padding: 0.6rem 0.85rem;
  border: 1px solid #ebeff4;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  color: #708091;
  font-size: 0.92rem;
}

.user-tab.is-active {
  color: #0d5d78;
  background: #ffffff;
  font-weight: 700;
}

.user-info-list {
  display: grid;
}

.user-info-item {
  padding: 0.95rem 0;
  border-bottom: 1px solid #edf1f6;
}

.user-label {
  margin: 0;
  font-size: 0.9rem;
  color: #6d7584;
}

.user-value {
  margin: 0.2rem 0 0;
  font-size: 0.96rem;
  color: #2a3342;
}

.events-list {
  display: grid;
  gap: 1.35rem;
}

.event-card {
  border: 1px solid #e7edf5;
  border-radius: 14px;
  padding: 1.15rem 1.2rem;
  background: #ffffff;
}

.event-card[role="button"] {
  cursor: pointer;
}

.event-card[role="button"]:focus-visible {
  outline: 3px solid rgba(16, 106, 134, 0.18);
  outline-offset: 2px;
}

.event-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
}

.event-desc {
  margin: 0;
  color: #5c697b;
  line-height: 1.45;
}

.event-meta {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.35rem;
  color: #6e7a8e;
  font-size: 0.9rem;
  line-height: 1.45;
}

.event-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.admin-list-wrap {
  margin-bottom: 1.35rem;
}

.participants-section {
  margin-top: 1.4rem;
  border-top: 1px solid #e9eef5;
  padding-top: 1.35rem;
}

.admin-detail-wrap {
  margin-top: 1.4rem;
  border-top: 1px solid #e9eef5;
  padding-top: 1.35rem;
}

.admin-detail-card {
  border: 1px solid #e7edf5;
  border-radius: 14px;
  padding: 1.2rem;
  background: #ffffff;
}

.admin-detail-card h4 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
}

.admin-detail-card .event-meta {
  margin-top: 0.85rem;
}

.event-detail-page {
  width: min(1760px, calc(100% - 2rem));
}

.event-detail-panel {
  width: 100%;
}

.event-detail-topbar {
  align-items: start;
  margin-bottom: 1.35rem;
}

.event-detail-kicker {
  margin: 0 0 0.25rem;
  color: #6c7584;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 700;
}

.event-detail-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1.1;
}

.event-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
  gap: 1rem;
}

.event-detail-main,
.event-detail-sidebar {
  display: grid;
  gap: 1rem;
}

.event-detail-card,
.event-detail-side-card {
  border: 1px solid #e7edf5;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.event-detail-card {
  padding: 1.25rem;
}

.event-detail-section-title {
  margin: 0 0 1rem;
  font-size: 1.02rem;
  color: #2a3342;
}

.event-detail-info-list {
  display: grid;
  gap: 0.8rem;
}

.event-detail-meta-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  color: #546173;
}

.event-detail-label {
  font-weight: 700;
  color: #2a3342;
}

.event-detail-story p {
  margin: 0 0 1rem;
  color: #465364;
  line-height: 1.75;
}

.event-detail-side-card {
  position: sticky;
  top: 1rem;
}

.event-detail-banner {
  min-height: 220px;
  background: var(--brand);
  color: #ffffff;
  padding: 1.25rem;
  display: grid;
  align-content: end;
  gap: 0.65rem;
}

.event-detail-banner-badge {
  width: fit-content;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
  font-weight: 700;
}

.event-detail-banner-text {
  display: grid;
  gap: 0.25rem;
}

.event-detail-banner-text strong {
  font-size: 1.35rem;
  line-height: 1.05;
}

.event-detail-banner-text span {
  font-size: 0.95rem;
  opacity: 0.92;
}

.event-detail-side-body {
  padding: 1.1rem 1.15rem 1.2rem;
  display: grid;
  gap: 0.85rem;
}

.event-detail-status {
  margin: 0;
  font-weight: 700;
  color: #17485e;
}

.event-detail-countdown {
  margin: 0;
  color: #617287;
  line-height: 1.6;
}

.event-detail-primary-btn,
.event-detail-secondary-btn {
  width: 100%;
}

.event-detail-secondary-btn.event-detail-leave-btn {
  border-color: #b42318;
  color: #b42318;
}

.event-detail-secondary-btn.event-detail-leave-btn:hover:not(:disabled) {
  background: #fff1f0;
}

.event-detail-secondary-btn {
  color: #4d5563;
}

.event-detail-page .user-layout {
  margin-top: 0;
}

.admin-export-actions {
  flex-wrap: wrap;
}

.events-subheader h3 {
  margin: 0;
  font-size: 1rem;
}

.selection-limit {
  color: #617287;
  font-size: 0.9rem;
}

.participants-list {
  display: grid;
  gap: 0.75rem;
}

.admin-key-block,
.admin-form-wrap,
.admin-list-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9eef5;
}

.admin-section-title {
  margin: 0 0 0.9rem;
  font-size: 1.03rem;
}

.field-help {
  display: block;
  margin-top: 0.4rem;
  color: #6e7a8e;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.4;
}

textarea[name="description"] {
  line-height: 1.5;
  resize: vertical;
}

.admin-key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #4f5b6b;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
}

.admin-detail-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e9eef5;
}

.admin-export-actions {
  margin-top: 0;
}

.admin-stats-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.admin-stat-item {
  border: 1px solid #e7edf5;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #fbfdff;
  display: grid;
  gap: 0.25rem;
}

.admin-stat-item strong {
  font-size: 1.25rem;
  color: #17485e;
}

.admin-stat-item span {
  color: #66748a;
  font-size: 0.9rem;
}

.admin-detail-columns {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-detail-card {
  border: 1px solid #e7edf5;
  border-radius: 12px;
  padding: 0.8rem;
  background: #ffffff;
}

.admin-detail-card h4 {
  margin: 0 0 0.7rem;
  font-size: 0.98rem;
  color: #2d3e51;
}

.admin-detail-list {
  display: grid;
  gap: 0.6rem;
  max-height: 360px;
  overflow: auto;
  padding-right: 0.2rem;
}

.admin-list-item {
  border: 1px solid #edf2f7;
  border-radius: 10px;
  padding: 0.6rem;
  background: #fbfdff;
}

.admin-list-item p {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: #6b7586;
}

.participant-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border: 1px solid #e7edf5;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #ffffff;
}

.participant-item input[type="checkbox"] {
  margin-top: 0.3rem;
}

.participant-item p {
  margin: 0.2rem 0 0;
  color: #6b7585;
  font-size: 0.9rem;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2rem;
  min-height: 620px;
}

.dashboard-sidebar {
  padding-top: 1rem;
}

.dashboard-steps {
  display: grid;
  gap: 0.8rem;
}

.dashboard-steps-inline {
  margin-bottom: 1.2rem;
}

.entity-tabs {
  display: flex;
  align-items: end;
  overflow-x: auto;
  margin: 0 0 1.2rem;
  border-bottom: 1px solid #e4e8ed;
}

.entity-tab {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  border: 1px solid #e4e8ed;
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #f7f7f7;
  color: var(--text-main);
  font-weight: 500;
}

.entity-tab.is-active {
  background: #ffffff;
  color: var(--brand);
  font-weight: 700;
}

.dashboard-panel.profile-mode .wizard-next,
.dashboard-panel.profile-mode .wizard-prev {
  display: none;
}

.dashboard-panel.profile-mode .profile-save,
.dashboard-panel.profile-mode .profile-save-actions {
  display: flex;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: transparent;
  color: #6e7481;
  padding: 0;
  border-radius: 0;
  font-weight: 500;
  text-align: left;
}

.step-item.is-active {
  color: var(--text-main);
  background: transparent;
}

.step-item.is-complete .step-index {
  background: #b8d7df;
  color: #0b5f7a;
}

.step-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #efefef;
  color: #6f7684;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.step-item.is-active .step-index {
  background: var(--brand);
  color: #ffffff;
}

.step-label {
  font-size: 0.98rem;
}

.dashboard-content {
  padding-right: 0.25rem;
}

.dashboard-header-row {
  margin-bottom: 1.25rem;
}

.section-divider {
  height: 1px;
  background: #eceff4;
  margin: 0.7rem 0 1.5rem;
}

select {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font: inherit;
  background: #ffffff;
  color: var(--text-main);
  padding: 0.8rem 1rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  appearance: none;
}

select:focus {
  outline: none;
  border-color: #4993a8;
  box-shadow: 0 0 0 3px rgba(73, 147, 168, 0.18);
}

.char-counter {
  justify-self: end;
  margin-top: -0.4rem;
  font-size: 0.82rem;
  color: #8a93a3;
}

.wizard-step {
  display: none;
}

.wizard-step.is-active {
  display: block;
}

.step-grid {
  margin-bottom: 1.25rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

.wizard-actions .secondary-btn,
.wizard-actions .primary-btn {
  min-width: 92px;
}

.dashboard-eyebrow {
  margin-bottom: 0.35rem;
}

.dashboard-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: var(--text-main);
}

.dashboard-copy {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.wizard-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-main);
}

.dashboard-form {
  margin-top: 0.5rem;
}

.logo-block {
  display: grid;
  gap: 0.95rem;
  margin-bottom: 0.4rem;
}

.logo-preview-card {
  min-height: 154px;
}

.logo-preview-wrap {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed #c7d1db;
  border-radius: 18px;
  background: #f8fbfd;
  overflow: hidden;
}

.logo-preview {
  width: 100%;
  max-width: 260px;
  max-height: 130px;
  object-fit: contain;
}

.logo-placeholder {
  color: #7c8697;
  font-size: 0.95rem;
}

.logo-input-label input[type="file"] {
  padding: 0.72rem 0.9rem;
  border-radius: 14px;
  background: #ffffff;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.hidden {
  display: none;
}

@keyframes rise {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, 18px, 0) scale(1.04);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(1080px, calc(100% - 1rem));
    margin-top: 1rem;
    margin-bottom: 1.5rem;
  }

  .app-shell-wide {
    width: min(1080px, calc(100% - 1rem));
  }

  .panel {
    padding: 1.2rem 1rem;
    border-radius: 18px;
  }

  .register-grid,
  .two-cols {
    grid-template-columns: 1fr;
  }

  .admin-key-row,
  .admin-stats-grid,
  .admin-detail-columns {
    grid-template-columns: 1fr;
  }

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

  .event-detail-meta-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .user-layout {
    grid-template-columns: 1fr;
  }

  .user-sidebar {
    border-right: 0;
    border-bottom: 1px solid #ebeff4;
  }

  .dashboard-sidebar {
    padding-top: 0;
  }

  .dashboard-steps {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .step-item {
    white-space: nowrap;
  }

  .wizard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-title {
    font-size: 1.52rem;
  }
}
