:root {
  --bg: #040816;
  --bg-deep: #0b1230;
  --panel: rgba(9, 15, 37, 0.86);
  --panel-strong: rgba(14, 23, 53, 0.96);
  --line: rgba(255, 255, 255, 0.11);
  --text: #eef4ff;
  --muted: #aab7d8;
  --gold: #ffd282;
  --gold-deep: #f1a53a;
  --blue: #7fb5ff;
  --success: #67d9ad;
  --danger: #ff8a92;
  --warning: #ffc66d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 18%, rgba(255, 210, 130, 0.16), transparent 26%),
    radial-gradient(circle at 82% 16%, rgba(124, 157, 255, 0.18), transparent 24%),
    radial-gradient(circle at 65% 78%, rgba(255, 92, 146, 0.12), transparent 24%),
    linear-gradient(160deg, #040816 0%, #0a1230 46%, #160d2a 100%);
}

code {
  font-family: Consolas, "Courier New", monospace;
}

.aurora {
  position: fixed;
  inset: auto;
  width: 20rem;
  height: 20rem;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.3;
  pointer-events: none;
}

.aurora-left {
  top: 2rem;
  left: -4rem;
  background: rgba(255, 212, 130, 0.34);
}

.aurora-right {
  right: -5rem;
  bottom: 3rem;
  background: rgba(119, 156, 255, 0.28);
}

.page-shell {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.surface-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 26, 58, 0.88), rgba(7, 12, 30, 0.94));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-panel {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
  padding: 1.8rem;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 210, 130, 0.08), transparent 40%),
    linear-gradient(305deg, rgba(120, 156, 255, 0.1), transparent 40%);
  pointer-events: none;
}

.brand-stack,
.hero-callout {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker,
.callout-label,
.event-status {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.1rem;
}

.hero-copy {
  max-width: 45rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

.hero-callout {
  align-self: stretch;
  padding: 1.2rem 1.15rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 214, 134, 0.25);
}

.callout-text {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.callout-subtext {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.section-panel {
  padding: 1.35rem;
}

.section-panel:nth-child(1) {
  grid-column: span 4;
}

.section-panel.form-panel {
  grid-column: span 8;
}

.dashboard-grid > .section-panel:nth-child(3),
.dashboard-grid > .section-panel:nth-child(4) {
  grid-column: span 6;
}

.section-panel.events-panel {
  grid-column: span 12;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.events-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.neutral {
  color: var(--muted);
}

.status-badge.info {
  color: var(--blue);
  border-color: rgba(127, 181, 255, 0.34);
}

.status-badge.emphasis {
  color: var(--gold);
  border-color: rgba(255, 214, 134, 0.38);
}

.status-badge.success {
  color: var(--success);
  border-color: rgba(103, 217, 173, 0.4);
}

.status-badge.danger {
  color: var(--danger);
  border-color: rgba(255, 138, 146, 0.42);
}

.status-badge.warning {
  color: var(--warning);
  border-color: rgba(255, 198, 109, 0.42);
}

.message-card {
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.6;
}

.message-card.info {
  border-color: rgba(127, 181, 255, 0.26);
  background: rgba(127, 181, 255, 0.08);
}

.message-card.muted {
  color: var(--muted);
}

.message-card.danger {
  border-color: rgba(255, 138, 146, 0.36);
  background: rgba(255, 138, 146, 0.08);
  color: #ffdfe2;
}

.message-card.warning {
  border-color: rgba(255, 198, 109, 0.36);
  background: rgba(255, 198, 109, 0.08);
  color: #ffe9bc;
}

.message-card.success {
  border-color: rgba(103, 217, 173, 0.36);
  background: rgba(103, 217, 173, 0.08);
}

.auth-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  color: #0b1230;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 14px 28px rgba(241, 165, 58, 0.24);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.primary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.meta-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.2rem 0 0;
}

.meta-list div {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-list dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-list dd {
  margin: 0;
  font-weight: 600;
}

.panel-note,
.submit-help,
.result-empty,
.preview-empty,
.field-hint,
.technical-details pre,
.event-description,
.event-empty-copy,
.event-note {
  color: var(--muted);
}

.overwrite-note {
  margin-bottom: 1rem;
}

.admin-form {
  display: grid;
  gap: 1rem;
}

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

.field {
  display: grid;
  gap: 0.45rem;
}

.field > span {
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 7, 20, 0.75);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(255, 214, 134, 0.52);
  box-shadow: 0 0 0 4px rgba(255, 214, 134, 0.12);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: rgba(255, 138, 146, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 138, 146, 0.12);
}

.preview-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--blue);
  font-size: 0.92rem;
  font-weight: 600;
}

.preview-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 214, 134, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(127, 181, 255, 0.12), rgba(255, 210, 130, 0.06));
  overflow: hidden;
}

.preview-frame img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.submit-help {
  margin-bottom: 0;
  max-width: 34rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

.result-card {
  display: grid;
  gap: 1rem;
}

.result-summary {
  display: grid;
  gap: 0.8rem;
}

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

.result-item,
.event-meta-item {
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-item strong,
.event-meta-item strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--gold);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.technical-details {
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.technical-details summary {
  cursor: pointer;
  font-weight: 700;
}

.technical-details pre {
  margin: 0.8rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
}

.notes-list {
  display: grid;
  gap: 0.85rem;
  padding-left: 1.2rem;
  margin: 0;
  line-height: 1.7;
}

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

.event-card,
.event-empty-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

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

.event-empty-title {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.event-cover-shell {
  min-height: 180px;
}

.event-cover {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.event-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, rgba(127, 181, 255, 0.12), rgba(255, 210, 130, 0.06));
}

.event-body {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.event-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.event-topline h3 {
  margin-bottom: 0;
  word-break: break-word;
}

.event-description {
  margin-bottom: 0;
  line-height: 1.7;
  word-break: break-word;
}

.event-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.event-note {
  margin-bottom: 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.delete-button {
  min-width: 170px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .section-panel:nth-child(1),
  .section-panel.form-panel,
  .dashboard-grid > .section-panel:nth-child(3),
  .dashboard-grid > .section-panel:nth-child(4),
  .section-panel.events-panel {
    grid-column: span 12;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 1rem, 820px);
    padding-top: 1rem;
  }

  .surface-panel {
    border-radius: 24px;
  }

  .section-panel,
  .hero-panel {
    padding: 1rem;
  }

  .field-row,
  .preview-panel,
  .result-grid,
  .event-card,
  .event-meta-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .event-topline {
    flex-direction: column;
  }

  .status-badge {
    align-self: start;
  }

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