/* The MunLen design system: tokens and components. Below this comment the file is the upload
   page's stylesheet, unchanged (munlen-portal: apps/upload/src/page/styles.css), so the site
   and the upload page look the same. Do not edit a rule here on its own: change both files
   together. test/design-system.test.js fails when they differ. What only this site needs is
   in site.css. Fonts are served from this origin: the page asks no third party for a font. */

@font-face {
  font-family: 'Barlow';
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/barlow-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/barlow-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/barlow-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2');
}

:root {
  --color-bg: #f2f2f3;
  --color-surface: #e9e9ea;
  --color-text: #1d1f20;
  --color-accent: #5980a6;
  --color-accent-600: #597ea3;
  --color-accent-700: #416180;
  --color-accent-800: #2c455d;
  --color-danger: #8f2d2d;
  --color-ok: #2f6b4a;
  --color-divider: color-mix(in srgb, #1d1f20 16%, transparent);
  --font-heading: 'Barlow Condensed', system-ui, sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(38px, 6vw, 60px);
  margin-bottom: 28px;
}
h2 {
  font-size: 25px;
}
p {
  margin: 0 0 12px;
}
a {
  color: var(--color-accent-700);
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Test environments only. In the page's flow and sticky, so it pushes the page down and stays
   in view without ever covering the form. It cannot be dismissed. */
.test-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 16px;
  background: #9b1c1c;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  text-align: center;
}

.client-name {
  margin: -14px 0 28px;
  font-size: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* The short reassurance above the form: a badge and one line. */
.assurance {
  margin: 0 0 20px;
}
.assurance p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.45;
}
.assurance[data-kind='development'] p {
  color: var(--color-danger);
  font-weight: 500;
}
/* The longer statement, closed until asked for. Small when closed, so the form keeps its
   place on the first screen of a phone. */
.protection {
  margin: 6px 0 0;
  font-size: 15px;
}
.protection summary {
  display: inline-block;
  padding: 4px 0;
  cursor: pointer;
  color: var(--color-accent-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.protection summary::-webkit-details-marker {
  display: none;
}
.protection summary::before {
  content: '+ ';
  text-decoration: none;
  display: inline-block;
  width: 1ch;
  margin-right: 4px;
}
.protection[open] summary::before {
  content: '\2212 ';
}
.protection[open] summary {
  margin-bottom: 6px;
}
.statement {
  margin: 0;
  padding: 10px 14px 10px 30px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
}
.statement li {
  margin-bottom: 6px;
  line-height: 1.45;
}
.statement li:last-child {
  margin-bottom: 0;
}
.statement[data-kind='development'] {
  color: var(--color-danger);
  font-weight: 500;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-accent-800);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.badge-icon {
  display: block;
  flex: none;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}
main.wrap {
  flex: 1;
  padding-top: 56px;
  padding-bottom: 72px;
}
.mono {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kicker {
  color: var(--color-accent-700);
  margin-bottom: 16px;
}
.muted {
  color: color-mix(in srgb, var(--color-text) 68%, transparent);
  font-size: 14px;
}

.top {
  border-bottom: 1px solid var(--color-divider);
}
.top-row,
.bottom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--color-text);
  text-decoration: none;
}
.brand-small {
  font-size: 17px;
}
.brand-mark {
  display: block;
  flex: none;
  width: 0.68em;
  height: 0.68em;
  background: var(--color-accent);
}
.bottom {
  border-top: 1px solid var(--color-divider);
}
.bottom-row {
  padding-top: 24px;
  padding-bottom: 24px;
}

.panel {
  border: 1px solid var(--color-divider);
  padding: 24px;
  margin-bottom: 24px;
}
.field > label {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  letter-spacing: 0.04em;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: 0;
}
.input:hover {
  border-color: color-mix(in srgb, var(--color-text) 45%, transparent);
}
.input:focus-visible {
  border-color: var(--color-accent);
  outline-offset: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  margin: 16px 0;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: 0;
  padding: 12px 22px;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
}
.btn-primary:hover {
  background: var(--color-accent-600);
}
.btn-primary:active {
  background: var(--color-accent-700);
}
.file-button {
  position: relative;
}
.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-button:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.notice {
  border-left: 3px solid var(--color-accent);
  padding: 8px 12px;
  background: var(--color-surface);
  font-size: 15px;
}
.notice-error {
  border-left-color: var(--color-danger);
  color: var(--color-danger);
}

.notice-ok {
  border-left-color: var(--color-ok);
  color: var(--color-ok);
  font-weight: 600;
}
.btn-small {
  font-size: 15px;
  padding: 0 14px;
  min-height: 44px;
}
.file-button.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.file-button.is-disabled input {
  cursor: not-allowed;
}
h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.1;
  margin: 20px 0 0;
}

/* Where files are chosen, or dropped on a computer. */
.drop-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 16px 0;
  padding: 16px;
  border: 2px dashed var(--color-divider);
}
.drop-zone.is-over {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}
.drop-zone.is-locked {
  border-style: solid;
}
.drop-hint {
  display: none;
}
/* Dragging needs a mouse. A phone is not told about it. */
@media (hover: hover) and (pointer: fine) {
  .drop-hint {
    display: inline;
  }
  .drop-zone.is-locked .drop-hint {
    display: none;
  }
}

.file-list {
  list-style: none;
  margin: 8px 0 16px;
  padding: 0;
  border-top: 1px solid var(--color-divider);
}
.file-list:empty {
  display: none;
}
.file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 2px 12px;
  align-items: center;
  min-height: 52px;
  padding: 4px 0;
  border-bottom: 1px solid var(--color-divider);
}
.file-name {
  overflow-wrap: anywhere;
  font-weight: 500;
}
.file-state {
  font-size: 14px;
  white-space: nowrap;
}
.file-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.file-detail {
  grid-column: 1 / -1;
  font-size: 14px;
  color: var(--color-danger);
  padding-bottom: 6px;
}
/* A touch target of 44 by 44, whatever the size of the icon in it. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: 0;
}
.icon-btn:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
}
.file-list li[data-state='rejected'] .file-name {
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.file-list li[data-state='sent'] .file-state {
  color: var(--color-ok);
  font-weight: 700;
}
.file-list li[data-state='failed'] .file-state {
  color: var(--color-danger);
  font-weight: 700;
}

/* The question before sending. A native modal dialog: the browser dims and locks the page. */
.dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: 0;
}
.dialog::backdrop {
  background: rgb(29 31 32 / 0.6);
}
.dialog[open] {
  display: flex;
}
.dialog-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  padding: 20px;
}
.dialog-body h2 {
  margin-bottom: 10px;
}
/* A long list scrolls here, so the question and the two buttons are always on screen. */
.confirm-list {
  flex: 1 1 auto;
  min-height: 48px;
  overflow-y: auto;
  margin: 4px 0 12px;
  padding: 0 12px;
  list-style: none;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
}
.confirm-list li {
  padding: 8px 0;
  overflow-wrap: anywhere;
  font-weight: 500;
  border-bottom: 1px solid var(--color-divider);
}
.confirm-list li:last-child {
  border-bottom: 0;
}
.dialog-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin: 4px 0 0;
}
.dialog-actions .btn {
  min-height: 44px;
}

/* Small screens: less air, so the password field is on the first screen of a phone. Last in
   the file, so it wins over the rules above. */
@media (max-width: 600px) {
  main.wrap {
    padding-top: 20px;
    padding-bottom: 40px;
  }
  h1 {
    font-size: 32px;
    margin-bottom: 22px;
  }
  .client-name {
    margin: -12px 0 14px;
    font-size: 18px;
  }
  .panel {
    padding: 16px;
  }
  .top-row {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
