/*
 * The approve page, laid out like the app's Parents only sheet (Figma 07). Every colour, size
 * and type style is a variable from tokens.css, written from src/theme/tokens.ts at build time.
 */
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito_400Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito_600SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito_700Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito_800ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(var(--pad-top), env(safe-area-inset-top)) var(--pad-x)
    max(var(--pad-bottom), env(safe-area-inset-bottom));
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font), system-ui, sans-serif;
}

main {
  width: 100%;
  max-width: calc(3 * var(--key-size) + 2 * var(--key-col-gap) + 2 * var(--pad-x));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  margin: 0;
  font-size: var(--title-size);
  line-height: var(--title-leading);
  font-weight: var(--title-weight);
  letter-spacing: var(--title-tracking);
}

.prompt {
  margin: var(--subtitle-gap) 0 0;
  font-size: var(--prompt-size);
  line-height: var(--prompt-leading);
  font-weight: var(--prompt-weight);
  color: var(--muted);
}

.prompt.error {
  font-size: var(--message-size);
  line-height: var(--message-leading);
  font-weight: var(--message-weight);
  color: var(--destructive);
}

.task {
  margin: var(--task-gap) 0 0;
  font-size: var(--task-size);
  line-height: var(--task-leading);
  font-weight: var(--task-weight);
  color: var(--task);
  overflow-wrap: anywhere;
}

.dots {
  display: flex;
  gap: var(--dot-gap);
  margin-top: var(--dots-top);
}

.dot {
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: 50%;
  border: var(--dot-ring) solid var(--key-border);
  background: var(--key);
}

.dot.on {
  border-color: var(--primary);
  background: var(--primary);
}

.shake {
  animation: shake calc(var(--shake-duration) * (var(--shake-swings) + 1)) ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(calc(-1 * var(--shake-distance)));
  }
  40%,
  80% {
    transform: translateX(var(--shake-distance));
  }
}

.keys {
  display: grid;
  grid-template-columns: repeat(3, var(--key-size));
  gap: var(--key-row-gap) var(--key-col-gap);
  margin-top: var(--keys-top);
}

.key {
  width: var(--key-size);
  height: var(--key-size);
  padding: 0;
  border-radius: 50%;
  border: var(--key-ring) solid var(--key-border);
  background: var(--key);
  color: var(--foreground);
  font-family: inherit;
  font-size: var(--key-label-size);
  line-height: var(--key-label-leading);
  font-weight: var(--key-label-weight);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 80ms ease-out;
}

.key:active:not(:disabled) {
  transform: scale(0.92);
}

.key:disabled {
  cursor: default;
  opacity: 0.5;
}

.key.blank {
  visibility: hidden;
}

.key svg {
  width: var(--delete-icon);
  height: var(--delete-icon);
  stroke: var(--muted);
}

.note {
  font-size: var(--note-icon);
  line-height: 1;
}

.note + h1 {
  margin-top: var(--keys-top);
}

.button {
  min-width: var(--button-width);
  height: var(--button-height);
  margin-top: var(--link-gap);
  padding: 0 var(--pad-x);
  border: 0;
  border-radius: calc(var(--button-height) / 2);
  background: var(--button);
  color: var(--foreground);
  font-family: inherit;
  font-size: var(--button-size);
  line-height: var(--button-leading);
  font-weight: var(--button-weight);
  cursor: pointer;
}

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

@media (prefers-reduced-motion: reduce) {
  .shake {
    animation: none;
  }
  .key {
    transition: none;
  }
}
