:root {
  --bg-1: #f5efe4;
  --bg-2: #dbe8f4;
  --surface: #ffffff;
  --ink: #112235;
  --muted: #5c6a78;
  --accent: #114e73;
  --accent-2: #c88a3d;
  --ok: #0a7a4b;
  --warn: #b1462f;
  --border: #d8e2ea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 20%, #fdf7ee 0%, transparent 38%),
    radial-gradient(circle at 90% 85%, #d5e6f4 0%, transparent 44%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.toast-viewport {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 1200;
  display: grid;
  gap: 0.55rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(17, 34, 53, 0.28);
  backdrop-filter: blur(2px);
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-card {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  max-width: min(360px, 100%);
  padding: 1rem 1.15rem;
  border: 1px solid #d5e0ea;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 42px -26px rgba(17, 34, 53, 0.8);
  color: #14314a;
  font-weight: 700;
}

.loading-spinner {
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border: 3px solid #cfe0eb;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 720ms linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.toast-item {
  pointer-events: auto;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0.68rem 0.78rem;
  font-size: 0.88rem;
  line-height: 1.28;
  background: #fff;
  box-shadow: 0 14px 30px -22px rgba(17, 34, 53, 0.7);
  animation: toast-in 200ms ease-out;
}

.toast-item.ok {
  border-color: #a8e4c8;
  background: #effaf4;
  color: #0a7a4b;
}

.toast-item.warn {
  border-color: #f2c5b7;
  background: #fff4f1;
  color: #b1462f;
}

.toast-item.info {
  border-color: #bfd9ec;
  background: #edf5fb;
  color: #245375;
}

.event-shell {
  width: min(1100px, 94vw);
  margin: 2rem auto;
}

.event-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 55px -36px rgba(17, 34, 53, 0.65);
  background: var(--surface);
  animation: card-in 360ms ease-out;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-hero {
  position: relative;
  min-height: 280px;
  display: grid;
  align-items: end;
}

.event-image {
  width: 80%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.event-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10%;
  right: 10%;
  background: linear-gradient(180deg, rgba(17, 34, 53, 0.15) 15%, rgba(17, 34, 53, 0.74) 90%);
}

.event-header-copy {
  position: absolute;
  left: calc(10% + 1.4rem);
  right: calc(10% + 1.4rem);
  bottom: 1.2rem;
  transform: translateY(1px);
  color: #fff;
  z-index: 1;
}

.event-kicker {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.92;
}

h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.4rem, 1.9vw + 1rem, 2.4rem);
  line-height: 1.15;
  margin: 0.35rem 0;
}

.event-header-copy p {
  margin: 0;
  max-width: 72ch;
}

.event-form-wrap {
  padding: 1.3rem 1.4rem 1.5rem;
}

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

label {
  display: grid;
  gap: 0.38rem;
}

label > span {
  color: #1e3549;
  font-weight: 700;
  font-size: 0.9rem;
}

.field-help {
  min-height: 1rem;
  color: #5f7180;
  font-size: 0.78rem;
  line-height: 1.2;
}

.field-help.error {
  color: #b1462f;
  font-weight: 600;
}

.comment-meta {
  display: grid;
  gap: 0.32rem;
}

.comment-meta .field-help {
  justify-self: end;
}

.comment-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7eef5;
  border: 1px solid #d0dde8;
}

.comment-progress > span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f6b8f, #2f8ab0);
  transition: width 0.18s ease, background-color 0.18s ease;
}

.comment-progress.is-warning > span {
  background: linear-gradient(90deg, #b7762a, #cf8f3d);
}

.comment-progress.is-danger > span {
  background: linear-gradient(90deg, #b1462f, #c75c45);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfdbe5;
  border-radius: 10px;
  padding: 0.64rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6ea3ca;
  box-shadow: 0 0 0 3px rgba(17, 78, 115, 0.13);
}

input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: #b1462f;
  box-shadow: 0 0 0 3px rgba(177, 70, 47, 0.13);
}

.form-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.btn-primary,
.btn-secondary {
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-primary {
  min-height: 50px;
  padding: 0.65rem 2.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #0f6b8f);
  box-shadow: 0 12px 22px -16px rgba(17, 78, 115, 0.75);
}

.btn-secondary {
  min-height: 40px;
  padding: 0.45rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #385269;
  background: #eef4f9;
  border-color: #cedbe6;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.74;
  transform: none;
}

.feedback {
  min-height: 1.2rem;
  margin-top: 0.8rem;
  font-weight: 600;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(17, 34, 53, 0.5);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(460px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #d5e0ea;
  box-shadow: 0 24px 50px -30px rgba(17, 34, 53, 0.8);
  padding: 1.2rem 1.2rem 1rem;
  display: grid;
  gap: 0.7rem;
}

.modal-card h2 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  color: #14314a;
}

.modal-card p {
  margin: 0;
  color: #2c465d;
  line-height: 1.4;
}

.modal-card .btn-primary {
  justify-self: end;
  min-height: 44px;
  padding-inline: 1.4rem;
}

.feedback.ok {
  color: var(--ok);
}

.feedback.warn {
  color: var(--warn);
}

@media (max-width: 760px) {
  .event-shell {
    width: 96vw;
    margin: 1rem auto;
  }

  .event-hero {
    min-height: 220px;
  }

  .event-image {
    width: 100%;
    min-height: 220px;
    margin: 0;
  }

  .event-overlay {
    left: 0;
    right: 0;
  }

  .grid.two-col {
    grid-template-columns: 1fr;
  }

  .event-form-wrap {
    padding: 1rem;
  }

  .event-kicker {
    font-size: 0.76rem;
    letter-spacing: 0.1em;
  }

  h1 {
    font-size: clamp(1.2rem, 4.8vw, 1.75rem);
  }

  .event-header-copy {
    left: 1rem;
    right: 1rem;
    bottom: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .event-card,
  .toast-item,
  .loading-spinner {
    animation: none;
  }

  .btn-primary,
  .btn-secondary,
  .comment-progress > span {
    transition: none;
  }
}
