/* Fonts and colours follow skydive.se (Open Sans, Montserrat, club red). */
@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url("fonts/open-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url("fonts/open-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url("fonts/open-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("fonts/montserrat-600.woff2") format("woff2"); }

:root {
  --text: #1f2937;
  --muted: #4b5563;
  --line: #d1d5db;
  --line-soft: #e5e7eb;
  --wash: #f8f9fa;
  --red: #dd3333;
  --red-dark: #c91f1f;
  --red-wash: #fdf2f2;
  --green: #17914a;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* The logo lines up with the left edge of the form below. */
.site-header {
  background: var(--wash);
  border-bottom: 1px solid var(--line-soft);
  padding-inline: max(0px, calc((100% - 40rem) / 2));
}
.logo { display: block; width: max-content; padding: 12px 16px; }
.logo img { display: block; height: 56px; width: auto; }

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 16px 4rem;
}

h1 {
  font-weight: 700;
  font-size: clamp(1.625rem, 6vw, 2.125rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 1.75rem;
}

.notice {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--red-wash);
  color: var(--red-dark);
  font-weight: 600;
}

/* ---- Fields ---- */

.form { display: grid; gap: 1.25rem; }

.field { margin: 0; padding: 0; border: 0; min-width: 0; }

label, legend {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  padding: 0;
}

input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  min-height: 2.75rem;
}
input[type="text"]:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
input[aria-invalid="true"] { border-color: var(--red); }

.categories { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.category { position: relative; }
.category input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.category span {
  display: inline-block;
  font-family: "Montserrat", "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.4375rem 0.9375rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.category input:hover + span { border-color: #9ca3af; }
.category input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.category input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.category input:disabled + span { opacity: 0.6; }
.categories[aria-invalid="true"] .category span { border-color: var(--red); }

/* ---- Drop area ---- */

.drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: var(--wash);
  padding: 1.5rem 1.25rem;
  text-align: center;
}
.drop.is-over { border-color: var(--red); background: var(--red-wash); }
.drop.is-disabled { opacity: 0.6; }

.drop-text { margin: 0; }

.choose {
  font: inherit;
  font-weight: 600;
  color: var(--red-dark);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.choose:disabled { cursor: not-allowed; }

.limits { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); }

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

/* ---- File list ---- */

.files { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.files:empty { display: none; }

.file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 4rem;
  align-items: baseline;
  column-gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.file-name { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-zip .file-name { font-weight: 600; }
.in-zip .file-name, .in-zip .file-status, .in-zip .file-bar { margin-left: 1rem; }
.file-size { grid-column: 2; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.file-remove {
  grid-column: 3;
  justify-self: end;
  font: inherit;
  font-size: 0.875rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.file-remove:hover { color: var(--text); }

.file-status {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.file-status:empty { display: none; }
.file[data-state="done"] .file-status { color: var(--green); font-weight: 600; }
.file[data-state="error"] .file-status { color: var(--red-dark); }

.file-bar {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 0.375rem;
  border-radius: 2px;
  background: var(--line-soft);
  overflow: hidden;
}
.file-bar > span { display: block; height: 100%; width: 0; background: var(--red); transition: width 200ms linear; }
.file[data-state="done"] .file-bar > span { background: var(--green); }
.file:not([data-state="uploading"]) .file-bar { display: none; }

/* ---- Submit ---- */

.form-error { margin: 0; color: var(--red-dark); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }

.button {
  font-family: "Montserrat", "Open Sans", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 8px;
  padding: 0.625rem 1.5rem;
  cursor: pointer;
}
.button:hover { background: var(--red-dark); border-color: var(--red-dark); }
.button:disabled { opacity: 0.5; cursor: not-allowed; background: var(--red); border-color: var(--red); }

.summary { margin: 0; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

.turnstile:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
