/*
 * 6 minut pro zdraví: the shared foundation of the public pages and the admin view.
 * The website's palette (docs/spec/brand.md, "Owner update"): page #DBE4F1, white cards, section shading #C8D3E3,
 * navy #07023A text and selected controls, flat coral #FF5670 buttons with white labels. Poppins 700 for headings
 * and buttons, Roboto for everything else, Font Awesome Free 5.15.3 icons. Spacing, radii and motion follow
 * docs/spec/design-tokens.json, so the web and the app share one design language.
 */

@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins-700.woff2?v=11f044af2869e839") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-var.woff2?v=f57466d858aece24") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour: the website's own values. */
  --page: #dbe4f1;
  --card: #ffffff;
  --shade: #c8d3e3;
  --tint: #edf2f9;          /* hover and selected rows: the page colour halfway to white */
  --ink: #07023a;
  --ink-2: #4c4971;         /* secondary text: 8.4:1 on white, 6.6:1 on the page */
  --line: #c8d3e3;
  --control: #54595f;       /* control outlines, as on the website: 7:1 on white */
  --coral: #ff5670;
  --coral-strong: #ee3d59;
  --on-coral: #ffffff;
  --danger: #b4141b;        /* a field's error text: 6.9:1 on white */

  /* The partner's verdict colours (panel PDF page 2) and their row fills lightened into chart zones. */
  --verdict-normal: #42b23b;
  --verdict-moderate: #fddd04;
  --verdict-marked: #ed1c24;
  --zone-normal: #e2f2dc;
  --zone-moderate: #fff6c2;
  --zone-marked: #fde0da;

  /* The environment bands. */
  --band-testing: #fddd04;
  --band-testing-stripe: #f2ce00;
  --band-development: #07023a;

  /* Space (4 8 12 16 24 32 48) and shape (8 12 16 24, pills), as the app. */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-dialog: 20px;
  --r-pill: 999px;

  /* Type. */
  --head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Roboto", "Segoe UI", system-ui, sans-serif;

  /* Motion (design-tokens.json motion_ms) and one easing. */
  --t-quick: 100ms;
  --t-short: 150ms;
  --t-medium: 250ms;
  --t-long: 350ms;
  --t-reveal: 600ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --shadow-float: 0 12px 32px rgba(7, 2, 58, 0.18), 0 2px 6px rgba(7, 2, 58, 0.08);

  /* The website has one palette; a browser's forced darkening would invert the partner's verdict colours. */
  color-scheme: only light;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.005em;
}

p {
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

img,
svg {
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

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

.skip {
  position: absolute;
  left: var(--s4);
  top: -100px;
  z-index: 1000;
  padding: var(--s2) var(--s4);
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
  font-family: var(--head);
  text-decoration: none;
}

.skip:focus {
  top: var(--s3);
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* Buttons: coral for the one main action of a place, outlined navy for the rest. The coral button's label is
 * Poppins 700 at 19px, WCAG's large text, where the website's white-on-coral pairing (3.1:1) passes. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0 var(--s5);
  border: 0;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--on-coral);
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--t-short) var(--ease), transform var(--t-quick) var(--ease);
}

.button:hover {
  background: var(--coral-strong);
  text-decoration: none;
}

.button:active {
  transform: scale(0.98);
}

.button[disabled],
.button[aria-disabled="true"] {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.button--quiet {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font-size: 1rem;
  min-height: 44px;
  padding: 0 var(--s4);
}

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

.button--plain {
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  min-height: 40px;
  padding: 0 var(--s3);
}

.button--plain:hover {
  background: rgba(7, 2, 58, 0.06);
}

.button .icon {
  width: 0.95em;
  height: 0.95em;
}

/* Form fields (the admin view's dialogs and filter editor, the sign-in and set-up pages). */
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}

.field__label {
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0;
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s4);
  border: 1px solid var(--control);
  border-radius: var(--r-md);
  background: #fff;
  font-size: 1rem;
}

.field__input:hover {
  border-color: var(--ink);
}

.field__input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.field__input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.field__unit {
  position: relative;
  display: flex;
  align-items: center;
}

.field__unit .field__input {
  padding-right: 52px;
}

.field__suffix {
  position: absolute;
  right: var(--s4);
  color: var(--ink-2);
  pointer-events: none;
}

.field__reveal {
  position: absolute;
  right: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-md);
  background: none;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
}

.field__reveal:hover {
  color: var(--ink);
  background: var(--tint);
}

.field__hint {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.field__error {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--danger);
}

.field__error:empty {
  display: none;
}

/* The environment band under the top bar (testing and development only). */
.env-band {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 var(--s3);
  padding: var(--s2) var(--s4);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: center;
}

.env-band__title {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1rem;
}

.env-band--testing {
  color: var(--ink);
  background:
    repeating-linear-gradient(-45deg, var(--band-testing) 0 16px, var(--band-testing-stripe) 16px 32px);
  box-shadow: inset 0 -1px 0 rgba(7, 2, 58, 0.18);
}

.env-band--development {
  color: #fff;
  background:
    repeating-linear-gradient(-45deg, var(--band-development) 0 16px, #1b1650 16px 32px);
}

.env-band--development a {
  color: #fff;
}

/* Loading placeholders: the shape of what is coming, a slow shimmer unless motion is reduced. */
.skeleton {
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, #e7edf6 0%, #f3f6fb 40%, #e7edf6 80%);
  background-size: 300% 100%;
  animation: shimmer 1.6s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
