/* The slice «відмітка присутності»: the page /checkin and the block _checkin.html. Mobile first
   at 375 px. The colours are the palette «М'яке світло» of the site, copied here as the slice's
   own tokens (no dependence on the files of another slice). */

/* The tokens stand on the page column too, so the background reaches the edges of the window. */
.checkin,
.page:has(> .checkin-page) {
  --color-bg: #f7f5ff;
  --color-surface: #ffffff;
  --color-text: #1c1733;
  --color-text-muted: #5b5675; /* 6.9:1 on the surface, 6.4:1 on the background */
  --color-accent: #6236ff; /* 6.0:1 on white; white on it: 6.0:1 */
  --color-line: #e4dff5;
  --color-on-accent: #ffffff;
  --color-error: #b3261e; /* 6.5:1 on white, 6.1:1 on the background */
  --ink: var(--color-text);
  --ink-2: var(--color-text-muted);
  --bg: var(--color-surface);
  --bg-soft: var(--color-bg);
  --line: var(--color-line);
  --accent: var(--color-accent);
}

/* The background fills the whole window, down to the footer zone. */
body:has(.checkin-page) {
  background: #f7f5ff;
}

.page:has(> .checkin-page) {
  max-width: none;
  background: var(--color-bg);
}

.checkin-page {
  padding: 40px var(--side) 8px;
  color: var(--color-text);
}

.checkin {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  background: var(--color-surface);
  scroll-margin-top: 16px;
}

.checkin__title {
  margin: 0;
  font: 800 26px/1.2 var(--font);
}

.checkin__intro {
  margin: 12px 0 0;
}

.checkin__form {
  display: grid;
  gap: 20px;
  margin-top: 16px;
}

.checkin__field {
  display: grid;
  gap: 6px;
}

.checkin__label {
  padding: 0;
  font: 700 16px/1.4 var(--font);
}

.checkin__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--color-text-muted);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
}

.checkin__input--code {
  font-family: var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.checkin__input:focus-visible {
  border-color: var(--accent);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.checkin__hint {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

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

.checkin__choices {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.checkin__choice {
  display: flex;
  flex: 1;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 2px solid var(--color-text-muted);
  border-radius: 12px;
  cursor: pointer;
}

.checkin__radio {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.checkin__choice:focus-within {
  border-color: var(--accent);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.checkin__edges {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.checkin__error {
  margin: 0;
  color: var(--color-error);
  font-weight: 700;
}

.checkin__done {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  scroll-margin-top: 16px;
}

.checkin__done p {
  margin: 12px 0 0;
}

.checkin__button {
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font: 700 16px/1.5 var(--font);
  cursor: pointer;
}

.checkin__button:disabled {
  cursor: progress;
}

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