:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #62666d;
  --line: #d8d4cc;
  --paper: #fffaf1;
  --panel: #ffffff;
  --leaf: #2e7056;
  --tomato: #c04431;
  --blue: #326c98;
  --gold: #b7791f;
  --shadow: 0 20px 60px rgba(38, 34, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(46, 112, 86, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(192, 68, 49, 0.1), transparent 35%),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--tomato);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.intro-text {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.totals {
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.totals span,
.totals strong {
  display: block;
}

.totals span {
  color: var(--muted);
  font-size: 0.9rem;
}

.totals strong {
  margin-top: 4px;
  font-size: 1.45rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.signup-form,
.summary-panel,
.registration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.signup-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.form-header p,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

label,
fieldset {
  display: grid;
  gap: 8px;
  color: #34363a;
  font-weight: 700;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c9c4bc;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
.category-option:focus-within {
  outline: 3px solid rgba(50, 108, 152, 0.22);
  border-color: var(--blue);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.category-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid #d9d2c7;
  border-radius: 8px;
  background: #fffdf8;
  cursor: pointer;
}

.category-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--leaf);
}

.category-name {
  display: block;
  font-weight: 800;
}

.category-count {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  background: #ecf4ef;
  color: var(--leaf);
  font-size: 0.9rem;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.edit-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

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

.primary-button {
  flex: 1 1 220px;
  min-height: 48px;
  border-radius: 6px;
  background: var(--leaf);
  color: white;
  font-weight: 900;
}

.primary-button:hover {
  background: #245f49;
}

.secondary-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--muted);
  font-weight: 900;
  padding: 0 18px;
}

.summary-panel {
  padding: 22px;
}

.summary-header,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.text-button {
  color: var(--tomato);
  background: transparent;
  font-weight: 800;
}

.category-summary {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.summary-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #34363a;
  font-weight: 800;
}

.summary-label span:last-child {
  color: var(--muted);
  font-weight: 700;
}

.bar-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #eee9df;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.registrations {
  margin-top: 28px;
}

.app-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.82rem;
}

.registration-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.registration-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  box-shadow: none;
}

.registration-category {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.registration-card h3 {
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.registration-meta,
.registration-note {
  margin-bottom: 0;
  color: var(--muted);
}

.registration-note {
  margin-top: 8px;
  color: #45494f;
}

.card-actions {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: end;
}

.card-actions[hidden] {
  display: none;
}

.edit-button {
  min-height: 34px;
  border-radius: 999px;
  background: #edf4f8;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0 12px;
}

.icon-button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f4eee5;
  color: var(--tomato);
  font-size: 1.35rem;
  line-height: 1;
}

.is-empty .registration-list {
  display: none;
}

@media (max-width: 860px) {
  .intro,
  .summary-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .layout,
  .registration-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

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

  .signup-form,
  .summary-panel {
    padding: 18px;
  }
}
