/* The upload page (bins/upload/src/page.rs) and the Zestaw information page (src/zestaw.rs).
   Served from /assets under CSP style-src 'self':
   no inline styles, no style attributes. The font is self-hosted (OFL, fonts/OFL.txt); the
   latin-ext files carry the Polish letters. */

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/poppins-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/poppins-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/poppins-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/poppins-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --green: #00834A;
  --green-deep: #00633A;
  --surface: #E4F6D4;
  --ink: #33382F;
  --ink-dim: #5C6157;
  --hair: #D3D9CD;
  --paper: #FFFFFF;
  --page: #F4F8F0;
  --error: #B3261E;
  --error-soft: #FCE8E6;
  --radius: 16px;
  color-scheme: light;
}

[hidden] { display: none !important; }

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  width: 100%;
  max-width: 30rem;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Texts from the copy crate may hold line breaks. */
.copy { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }

.head { display: flex; align-items: center; gap: 12px; }
.mark { flex: none; width: 44px; height: 44px; }
h1 { margin: 0; font-size: 1.3rem; font-weight: 600; line-height: 1.3; }

.trust { color: var(--ink-dim); font-size: 0.95rem; }

.card, .result {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 20px;
}

form { display: flex; flex-direction: column; gap: 16px; margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
  border: 2px dashed var(--hair);
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.zone:hover, .zone.is-drag { border-color: var(--green); background: var(--surface); }
#file:focus-visible + .zone { outline: 3px solid var(--green); outline-offset: 2px; }
.zone-icon { width: 36px; height: 36px; color: var(--green); }
.zone-pick { font-weight: 600; }
.zone-hint { color: var(--ink-dim); font-size: 0.85rem; }
.zone-file {
  max-width: 100%;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-error { color: var(--error); font-size: 0.9rem; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green); }

.privacy { margin: -8px 0 0 30px; font-size: 0.9rem; }
a { color: var(--green-deep); text-underline-offset: 2px; }

button {
  font: inherit;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
}
.send { width: 100%; border: 0; background: var(--green); color: var(--paper); }
.send:hover:not(:disabled) { background: var(--green-deep); }
.send:disabled { background: #BDC3B8; cursor: not-allowed; }
.retry { margin-top: 16px; width: 100%; border: 2px solid var(--green); background: var(--paper); color: var(--ink); }
button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.sending { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--ink-dim); }
progress { width: 100%; height: 8px; accent-color: var(--green); }

.result { display: flex; flex-direction: column; align-items: center; text-align: center; }
.result-icon { width: 40px; height: 40px; margin-bottom: 12px; color: var(--green); }
.result-error { border-color: var(--error); background: var(--error-soft); }

.notice { color: var(--ink-dim); font-size: 0.8rem; }

/* The Zestaw information page: one line per item, its facts as a label/value grid. */
.zestaw-name { margin: 0; font-size: 1.15rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.zestaw-hint { margin: 4px 0 0; color: var(--ink-dim); font-size: 0.9rem; }
.zestaw-empty { margin-top: 12px; }
.items { list-style: none; margin: 12px 0 0; padding: 0; }
.item { padding: 14px 0 0; margin-top: 14px; border-top: 1px solid var(--hair); }
.item:first-child { margin-top: 0; }
.item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; }
.item-name { font-weight: 600; overflow-wrap: anywhere; }
.item-qty { flex: none; white-space: nowrap; color: var(--ink-dim); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; font-size: 0.9rem; }
.facts dt { color: var(--ink-dim); }
.facts dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.facts strong { font-weight: 600; }
.unconfirmed { display: block; color: var(--error); }
.flag { display: inline-block; margin: 10px 0 0; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; background: var(--surface); }
.flag-durable { background: var(--page); border: 1px solid var(--hair); }

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