:root {
  --bg-start: #fffaf1;
  --bg-end: #e9f4ff;
  --ink: #202229;
  --muted: #5a6375;
  --card: #ffffffd9;
  --line: #ccd5e2;
  --brand: #0f5cc0;
  --brand-strong: #083f86;
  --accent: #ff6a3c;
  --radius: 18px;
  --shadow: 0 16px 40px rgba(14, 28, 55, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(15, 92, 192, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 92, 192, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 15%, black 35%, transparent 85%);
  pointer-events: none;
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 20px 80px;
  position: relative;
}

.hero {
  margin-bottom: 20px;
  animation: slide-in 0.7s ease both;
}

.eyebrow {
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 8px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-family: "Fraunces", serif;
  line-height: 1.1;
}

.intro {
  max-width: 60ch;
  color: var(--muted);
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
  padding: 22px;
  animation: rise 0.8s ease both;
}

.progress-wrap {
  margin-bottom: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 220ms ease;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin: 0 0 18px;
}

legend {
  padding: 0 8px;
  color: var(--brand-strong);
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
  color: #2e3340;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 92, 192, 0.28);
  border-color: var(--brand);
}

.checkbox-row {
  align-items: center;
  grid-template-columns: auto 1fr;
  font-weight: 400;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.subcard {
  border: 1px solid #d8e0ec;
  border-radius: 12px;
  padding: 14px;
  background: #ffffffb5;
}

.subcard h3 {
  margin: 0 0 12px;
  color: #1f4c8e;
  font-size: 1rem;
}

.add-row {
  margin-top: 6px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

button.primary {
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-strong));
}

button.ghost {
  color: var(--brand-strong);
  background: #eaf1ff;
}

.status {
  margin-bottom: 14px;
  border-radius: 12px;
  padding: 12px;
  font-weight: 500;
}

.status.success {
  background: #e8f8ec;
  color: #0d5a2f;
  border: 1px solid #9bd7ad;
}

.status.info {
  background: #e8f0fb;
  color: #0a3f8d;
  border: 1px solid #9cc0ef;
}

.hidden {
  display: none;
}

.submit-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(13, 22, 38, 0.55);
  z-index: 30;
  padding: 18px;
}

.submit-modal {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 18px 45px rgba(8, 30, 68, 0.32);
}

.submit-overlay.hidden {
  display: none;
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 35;
  width: min(360px, calc(100% - 28px));
  background: #ffffff;
  border: 1px solid #c6dbff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(8, 30, 68, 0.2);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

.toast.hidden {
  display: none;
}

.toast-body strong {
  display: block;
  color: #124b98;
  margin-bottom: 3px;
}

.toast-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.toast-close {
  border: 0;
  background: transparent;
  color: #3f4d66;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.submit-modal h2 {
  margin: 4px 0 8px;
  font-family: "Fraunces", serif;
}

.submit-modal p {
  margin: 0 0 14px;
  color: var(--muted);
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  margin: 0 auto 8px;
  border: 4px solid #d7e6ff;
  border-top-color: var(--brand);
  animation: spin 0.85s linear infinite;
}

.submit-modal.success .spinner {
  display: none;
}

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

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

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 36px 14px 54px;
  }

  .card {
    padding: 14px;
  }

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

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

  .toast {
    top: auto;
    bottom: 14px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}
