:root {
  --bg: #ffffff;
  --text: #1c1e21;
  --muted: #5d636a;
  --line: #d5d9de;
  --field: #f5f6f7;
  --choice: #fafbfb;
  --accent: #1f5d86;
  --accent-text: #ffffff;
  --accent-soft: #e6eff5;
  --error: #b3261e;
  --ok: #1e6b3a;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141618;
    --text: #e7e9eb;
    --muted: #a3aab1;
    --line: #3a4046;
    --field: #1d2023;
    --choice: #191c1f;
    --accent: #7db4da;
    --accent-text: #0f1a22;
    --accent-soft: #1d2b36;
    --error: #ff8a80;
    --ok: #7fd19b;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.25;
  margin: 48px 0 20px;
}

p {
  margin: 0 0 12px;
}

a {
  color: var(--accent);
}

.intro p {
  color: var(--text);
}

.alert {
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 600;
}

.section-note {
  color: var(--muted);
  margin-top: -8px;
  margin-bottom: 20px;
}

.q {
  border: 0;
  margin: 0 0 32px;
  padding: 0;
  min-width: 0;
}

.q-title {
  display: block;
  font-weight: 650;
  line-height: 1.35;
  margin: 0 0 8px;
  padding: 0;
}

.help {
  color: var(--muted);
  font-size: 0.94rem;
  margin: -2px 0 10px;
}

.sub {
  display: block;
  font-size: 0.97rem;
  font-weight: 600;
  margin: 16px 0 8px;
}

.sub + .help {
  margin-top: -4px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  margin: 0;
}

textarea {
  resize: vertical;
  min-height: 5.5em;
}

textarea[rows="2"] {
  min-height: 0;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.is-missing {
  border-color: var(--error) !important;
}

.choices {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

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

.choices--days {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 46px;
  padding: 11px 12px;
  background: var(--choice);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.35;
  cursor: pointer;
}

.choice input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

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

.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.choices--days .choice {
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  gap: 6px;
}

.choices--days .choice input {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  width: 100%;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.upload {
  display: inline-block;
  position: relative;
  margin-top: 4px;
}

.upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload:has(input:focus-visible) .btn {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upload:has(input:disabled) {
  opacity: 0.55;
}

.upload-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 0.94rem;
}

.upload-list:empty {
  display: none;
}

.upload-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.upload-list .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.upload-list .state {
  flex: none;
  color: var(--muted);
}

.upload-list .is-ok .state {
  color: var(--ok);
}

.upload-list .is-error .state {
  color: var(--error);
}

.submit {
  margin-top: 40px;
}

.status {
  margin: 12px 0 0;
  font-weight: 600;
}

.status:empty {
  display: none;
}

.status.is-error {
  color: var(--error);
}

.saved {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 10px;
}

.done {
  padding-top: 8px;
}

.done:focus {
  outline: none;
}

.done h2 {
  margin-top: 0;
}

.hp,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (min-width: 600px) {
  .page {
    padding-top: 48px;
  }

  h1 {
    font-size: 2rem;
  }

  .choices--days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .btn-primary {
    width: auto;
  }
}

section:first-child h2 {
  margin-top: 32px;
}
