/* SVX Certifikáty úväzkov: black #141414, red #BD2525, white; IBM Plex Sans, served from this server.
   Large, simple controls for a tablet. No inline styles are used in the templates (Content-Security-Policy). */

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-Bold.woff2") format("woff2");
}

:root {
  --black: #141414;
  --red: #BD2525;
  --red-dark: #9A1D1D;
  --red-tint: #FBEAEA;
  --white: #FFFFFF;
  --grey-100: #F3F3F3;
  --grey-300: #D2D2D2;
  --grey-600: #6B6B6B;
  --amber: #B26A00;
  --amber-dark: #7A4A00;
  --amber-tint: #FFF4DC;
  --green: #1F7A3A;
  --green-tint: #E8F5EC;
  --radius: 6px;
}

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

/* hidden stays hidden, also for elements the rules below give a display (buttons, flex boxes) */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

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

h1 {
  margin: 0 0 20px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  margin: 32px 0 14px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

/* header */

.site-header {
  border-bottom: 3px solid var(--black);
  background: var(--white);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
}

.brand {
  display: block;
  line-height: 0;
}

.brand img {
  width: auto;
  height: 40px;
}

.nav {
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-bottom: 4px solid transparent;
  color: var(--black);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover {
  border-bottom-color: var(--grey-300);
}

.nav a[aria-current="page"] {
  border-bottom-color: var(--red);
}

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.session__user {
  font-weight: 600;
}

.session form {
  margin: 0;
}

.session .button {
  min-height: 40px;
  padding: 0 14px;
}

.session .badge {
  padding: 5px 10px;
  font-size: 13px;
}

/* narrower than a laptop: the navigation on a line of its own below the logo and the session */
@media (max-width: 1099px) {
  .nav {
    order: 3;
    flex-basis: 100%;
  }
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-test {
  background: var(--red);
}

.badge-live {
  background: var(--black);
}

.badge-cancelled {
  background: var(--grey-600);
}

/* a certificate whose technical fields were entered by the user */
.badge-custom {
  padding: 2px 8px;
  border: 2px solid var(--red);
  background: var(--white);
  color: var(--red);
  font-size: 13px;
  letter-spacing: 0;
  vertical-align: middle;
}

/* page */

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.card {
  padding: 28px;
  border: 2px solid var(--black);
  border-radius: var(--radius);
}

.login {
  max-width: 440px;
  margin: 24px auto;
}

.error-page {
  max-width: 640px;
  margin: 24px auto;
}

/* messages: ok = green, warn = amber, error = solid red */

.message {
  margin: 0 0 20px;
  padding: 14px 18px 14px 14px;
  border: 2px solid var(--green);
  border-left-width: 8px;
  border-radius: var(--radius);
  background: var(--green-tint);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.message-warn {
  border-color: var(--amber);
  background: var(--amber-tint);
}

.message-error {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.message-error a {
  color: var(--white);
}

/* forms and buttons */

.field {
  margin: 0 0 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  font: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 24px;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  border-color: var(--red);
  background: var(--red);
}

.button-primary:hover {
  border-color: var(--red-dark);
  background: var(--red-dark);
}

.button-secondary {
  background: var(--white);
  color: var(--black);
}

.button-secondary:hover {
  background: var(--grey-100);
}

button:disabled,
button:disabled:hover {
  border-color: var(--grey-300);
  background: var(--grey-300);
  color: var(--grey-600);
  cursor: not-allowed;
}

.button-block {
  display: flex;
  width: 100%;
}

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

.hint {
  margin: 8px 0 0;
  color: var(--grey-600);
  font-size: 16px;
}

.technical {
  display: block;
  margin-top: 4px;
  color: var(--grey-600);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 20px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 0;
}

.checkbox input {
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0;
}

/* order facts */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 0 0 20px;
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

/* tables: order items, stamping list */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--grey-300);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  border-bottom: 2px solid var(--black);
}

.table .number {
  text-align: right;
  white-space: nowrap;
}

.product-number {
  display: block;
  color: var(--grey-600);
  font-size: 15px;
}

.item-plain {
  color: var(--grey-600);
}

/* a sling that gets no certificate unless something is put right: a warning, not the grey of other goods */
.item-warning {
  background: var(--amber-tint);
}

.item-warning .flag {
  color: var(--amber-dark);
}

.flag {
  color: var(--red);
}

.fix {
  margin: 6px 0 0;
  font-size: 16px;
}

/* the load values a row of the preview will print */
.load-summary {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

/* a row of the preview whose name on the print-out contradicts its type or length: what differs, and the box that
   the product was checked */
.name-warning {
  grid-column: 1 / -1;
  margin: 4px 0 12px;
}

.name-warning p {
  margin: 6px 0 0;
  font-size: 16px;
}

.name-warning a {
  white-space: nowrap;
}

.name-warning .checkbox {
  align-items: flex-start;
  margin: 12px 0 0;
  font-weight: 600;
}

.name-warning .checkbox input {
  flex: none;
}

/* a milder note than a warning (a missing background photo) */
.note {
  margin: 0 0 20px;
  padding: 10px 16px;
  border-left: 4px solid var(--grey-300);
  color: var(--grey-600);
}

/* shown by static/busy.js while a slow action runs */
.busy-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 2px solid var(--black);
  border-radius: var(--radius);
  background: var(--grey-100);
  font-weight: 600;
}

.busy-notice::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border: 3px solid var(--grey-300);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: busy-turn 0.9s linear infinite;
}

@keyframes busy-turn {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .busy-notice::before {
    animation: none;
  }
}

.assignment {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr);
  gap: 0 12px;
  margin-top: 12px;
  color: var(--black);
}

.assignment .field {
  margin-bottom: 8px;
}

/* a row of the preview: the type over the whole width (its text whole), the length and the count beside each other,
   as wide as their numbers */
.item-assignment {
  grid-template-columns: minmax(0, 10em) minmax(0, 10em) minmax(0, 1fr);
}

.item-assignment > .field:first-child {
  grid-column: 1 / -1;
}

details summary {
  margin-top: 6px;
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
}

.status-missing {
  color: var(--red);
  font-weight: 700;
}

.cancelled td {
  color: var(--grey-600);
  text-decoration: line-through;
}

/* making a missing PDF again: a small form inside a table cell or the actions */

.inline-form {
  display: inline;
  margin: 0;
}

.button-missing {
  min-height: 44px;
  padding: 0 14px;
  border-color: var(--red);
  background: var(--white);
  color: var(--red);
  font-weight: 700;
}

.button-missing:hover {
  background: var(--red-tint);
}

/* the registry */

.filters {
  margin-bottom: 24px;
}

.filters .actions {
  margin-bottom: 0;
}

.result-count {
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

/* the registry: one line per certificate at desktop width where the names allow; secondary columns smaller */
.registry {
  font-size: 16px;
}

.registry th {
  font-size: 15px;
  white-space: nowrap;
}

.registry td {
  white-space: nowrap;
}

.registry td:nth-child(3) {
  min-width: 10em;
  white-space: normal;
}

.registry td:nth-child(5) {
  min-width: 19em;
  white-space: normal;
}

.registry td:nth-child(2),
.registry td:nth-child(n+6) {
  font-size: 15px;
}

.registry td:nth-child(9) {
  max-width: 12em;
  white-space: normal;
}

.row-cancelled td {
  color: var(--grey-600);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.pager a {
  font-weight: 600;
}

/* the e-mail block of an order, the forms of a certificate */

.email-block {
  margin: 32px 0;
}

.email-block h2 {
  margin-top: 0;
}

.email-block .actions {
  margin: 16px 0 8px;
}

.email-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.email-form .field {
  flex: 1 1 280px;
  margin: 0;
}

.form-hint {
  margin: 0 0 20px;
}

/* the print version of the stamping list */

.print-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  font-size: 22px;
}

.print-customer {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 600;
}

.print-page .table th,
.print-page .table td {
  padding: 14px 10px;
  border-bottom: 2px solid var(--black);
}

@media print {
  .no-print {
    display: none;
  }

  .print-page {
    max-width: none;
    padding: 0;
  }
}


/* the settings pages */

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grey-300);
}

.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}

.subnav a:hover {
  background: var(--grey-100);
}

.subnav a[aria-current="page"] {
  background: var(--black);
  color: var(--white);
}

.button-small {
  min-height: 44px;
  padding: 0 14px;
}

.row-actions {
  white-space: nowrap;
}

.row-actions a {
  margin-right: 12px;
}

.row-disabled td {
  color: var(--grey-600);
}

.types .wll,
.types td:first-child {
  white-space: nowrap;
}

.types td:first-child {
  font-size: 15px;
}

.code {
  color: var(--grey-600);
  font-size: 15px;
  white-space: nowrap;
}

.lang-group {
  margin: 0 0 24px;
  padding: 16px 20px 0;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
}

.lang-group legend {
  padding: 0 6px;
  font-weight: 700;
}

.cell-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0 12px;
}

.text-form textarea {
  min-height: 0;
}

.asset {
  margin-bottom: 24px;
}

.asset h2 {
  margin-top: 0;
}

.asset-preview img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border: 1px solid var(--grey-300);
}

.asset-upload {
  margin-top: 24px;
}

.mode-line {
  margin: 0 0 16px;
}

.numbers {
  margin: 0 0 24px;
  padding-left: 22px;
}

.confirm-number {
  font-size: 22px;
  font-weight: 700;
}

/* the printed technical fields of a certificate (manual certificate, preview row, correction) */

.printed-fields {
  margin: 12px 0 0;
  padding: 12px 20px 0;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
  min-width: 0;
}

.printed-fields legend {
  padding: 0 6px;
  font-weight: 700;
}

.printed-fields .checkbox {
  margin: 4px 0 0;
}

.printed-fields > .hint {
  margin: 8px 0 16px;
}

.printed-fields .fields-confirmed {
  margin: 0 0 20px;
}

.item-fields {
  grid-column: 1 / -1;
  color: var(--black);
}

.manual-actions {
  align-items: center;
}

/* the disabled first button of a form whose Enter key must do nothing (author styles would show it despite `hidden`) */
.enter-blocker {
  display: none;
}

/* "Začíname": the first steps of putting the app into use, with their state */

.steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 14px 18px 14px 64px;
  border: 2px solid var(--grey-300);
  border-radius: var(--radius);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grey-100);
  font-weight: 700;
}

.step-done {
  border-color: var(--green);
}

.step-done::before {
  content: "✓";
  background: var(--green);
  color: var(--white);
}

.step a {
  font-size: 20px;
  font-weight: 700;
}

.step-state {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.step-done .step-state {
  background: var(--green-tint);
  color: var(--green);
}

.step-todo .step-state {
  background: var(--amber-tint);
  color: var(--amber-dark);
}

.step .hint {
  margin-top: 4px;
}

/* a page or table with nothing in it yet: what to do */
.empty {
  padding: 16px 18px;
  border: 2px dashed var(--grey-300);
  border-radius: var(--radius);
}

.asset-delete {
  margin-top: 16px;
}

.asset-delete .actions {
  margin: 12px 0 0;
}

/* the text form of a template: its parts, and the save bar that stays at hand while scrolling */

.toc {
  margin: 0 0 8px;
  padding: 14px 20px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius);
}

.toc-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.toc ol {
  columns: 2 280px;
  margin: 0;
  padding-left: 22px;
}

.toc a {
  font-weight: 600;
}

.text-form h2 {
  scroll-margin-top: 16px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 24px -20px 0;
  padding: 0 20px;
  border-top: 2px solid var(--black);
  background: var(--white);
}

.sticky-actions .actions {
  margin: 12px 0;
}

.print-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  font-size: 18px;
}

/* phone width: a compact header, nothing wider than the screen (wide tables scroll in their own box) */

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 21px;
  }

  .site-header__inner,
  .content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .site-header__inner {
    gap: 6px 10px;
    padding-top: 8px;
    padding-bottom: 4px;
  }

  .brand img {
    height: 30px;
  }

  .session {
    gap: 8px;
  }

  .nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 8px;
  }

  .nav a {
    min-height: 40px;
    padding: 0 4px;
    border-bottom-width: 3px;
    font-size: 16px;
  }

  .card {
    padding: 16px;
  }

  .assignment,
  .item-assignment {
    grid-template-columns: 1fr;
  }

  .table th,
  .table td {
    padding: 10px 6px;
  }

  .facts {
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
    gap: 4px 12px;
  }

  /* the items of a preview: number, name and quantity on a line, what the item gets below them */
  .items thead {
    display: none;
  }

  .items,
  .items tbody {
    display: block;
  }

  .items tr {
    display: grid;
    grid-template-columns: 2em minmax(0, 1fr) auto;
    column-gap: 8px;
    padding: 12px 6px;
    border-bottom: 1px solid var(--grey-300);
  }

  .items td {
    padding: 0;
    border: 0;
  }

  .items td:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 8px;
  }

  .items td:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
  }

  .sticky-actions {
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px;
  }
}

@media (max-width: 479px) {
  .session__user {
    display: none;  /* the one account of the app; the header keeps to one line above the navigation */
  }
}

.stamping-list td:nth-child(3) {
  min-width: 10em;
}

@media screen and (max-width: 640px) {
  .print-page {
    padding: 14px;
    font-size: 18px;
  }
}
