:root {
  --bg: #f1f5f4;
  --bg-grad: radial-gradient(1200px 600px at 15% -10%, #d9f0ea 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #e6e9fb 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --text: #17211f;
  --muted: #5b6b68;
  --border: #dbe5e2;
  --accent: #0f766e;
  --accent-strong: #0b5d57;
  --accent-soft: #e3f3ef;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 32, 29, 0.05), 0 12px 32px -12px rgba(16, 32, 29, 0.18);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1513;
    --bg-grad: radial-gradient(1200px 600px at 15% -10%, #123c37 0%, transparent 60%),
      radial-gradient(900px 500px at 100% 0%, #1a2140 0%, transparent 55%);
    --surface: #16211f;
    --surface-2: #1b2825;
    --text: #e8f0ee;
    --muted: #9fb1ad;
    --border: #2a3a36;
    --accent: #4fd1bd;
    --accent-strong: #7ee4d3;
    --accent-soft: #123b35;
    --danger: #ff9d95;
    --danger-soft: #3a1d1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}

.skip-link:focus {
  left: 16px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.brand-text {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-link {
  flex: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.admin-link:hover {
  background: var(--accent-soft);
}

.page {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  padding: 28px 28px 4px;
  border-top: 6px solid var(--accent);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.form-desc {
  color: var(--muted);
  font-size: 15px;
  white-space: pre-line;
  max-width: 68ch;
}

.form-desc p {
  margin: 0 0 12px;
}

.required-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
}

.progress-wrap {
  padding: 20px 28px 0;
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #6d8bff));
  transition: width 0.35s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.save-state {
  color: var(--muted);
  font-size: 12.5px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.save-state.is-visible {
  opacity: 1;
}

#form {
  padding: 8px 28px 0;
}

.section-band {
  margin: 20px 0 22px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.section-band h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.section-band .section-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  white-space: pre-line;
}

.field {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.field:last-of-type {
  border-bottom: none;
}

.radio-field {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.radio-field legend {
  padding: 0;
}

.radio-field:last-of-type {
  border-bottom: none;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 15.5px;
  line-height: 1.5;
  white-space: pre-line;
  margin-bottom: 12px;
}

.req {
  color: var(--danger);
  margin-left: 2px;
}

.field-hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  white-space: normal;
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.6;
}

input[type="date"],
input[type="time"] {
  max-width: 260px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.radio-option:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.radio-option input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid color-mix(in srgb, var(--muted) 60%, transparent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.radio-option input::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.radio-option input:checked {
  border-color: var(--accent);
}

.radio-option input:checked::after {
  transform: scale(1);
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.radio-option:has(input:focus-visible) {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.error-text {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.nav {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0 24px;
  margin-top: 8px;
  background: linear-gradient(to top, var(--surface) 70%, transparent);
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
  padding: 11px 26px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}

.nav .btn.primary {
  margin-left: auto;
}

@media (prefers-color-scheme: dark) {
  .btn.primary {
    color: #06231f;
  }
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn.ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: var(--border);
}

.btn.ghost:hover {
  background: var(--accent-soft);
}

.btn[hidden] {
  display: none;
}

.state-card {
  padding: 48px 28px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.state-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.state-text {
  margin: 0;
  color: var(--muted);
  max-width: 46ch;
}

.state-card .btn {
  margin-top: 12px;
}

.done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 6px;
}

.footer {
  padding: 0 20px 32px;
  text-align: center;
}

.footer p {
  margin: 0 auto;
  max-width: 62ch;
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 600px) {
  .page {
    padding: 16px 12px 32px;
  }

  .card-head,
  .progress-wrap,
  #form {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .nav .btn {
    width: 100%;
  }

  input[type="date"],
  input[type="time"] {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

