/*
 * CareHub Plus — Base styles (fonts, reset, type, focus, buttons)
 *
 * Declares the six local font faces (Inter 400/500/600/700 and Averia Sans
 * Libre 400/700, font-display swap, no unicode-range), a small reset, the
 * shared type classes, the screen-reader-only helper, the focus ring and the
 * button family used across the site. Every value comes from tokens.css.
 *
 * Author: Vitoria Lana
 * Created on: 21/10/2026
 * Version: 1.0.0
 * Squad: CareHub Plus
 */

/* ---------- Fonts (local woff2, OFL-1.1, see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/inter-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Averia Sans Libre";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/averia-sans-libre-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Averia Sans Libre";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/averia-sans-libre-latin-700-normal.woff2") format("woff2");
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: var(--fw-400);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden;
}

h1,
h2,
h3,
p,
figure,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

button {
  font: inherit;
  color: inherit;
  margin: 0;
}

[hidden] {
  display: none !important;
}

template {
  display: none;
}

/* ---------- Type classes ---------- */
.t-display {
  font-family: var(--font-display);
  font-weight: var(--fw-700);
  line-height: var(--lh-tight);
}

.t-upper {
  text-transform: uppercase;
}

.t-eyebrow {
  font-family: var(--font-display);
  font-weight: var(--fw-700);
  font-size: var(--fs-11);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-section);
  text-transform: uppercase;
  color: var(--primary-dark);
}

.t-title {
  font-family: var(--font-display);
  font-weight: var(--fw-700);
  font-size: var(--fs-24);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  color: var(--text-primary);
}

.t-body {
  font-family: var(--font-body);
  font-weight: var(--fw-400);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  color: var(--text-primary);
}

.t-small {
  font-family: var(--font-body);
  font-weight: var(--fw-400);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.t-micro {
  font-family: var(--font-body);
  font-weight: var(--fw-400);
  font-size: var(--fs-11);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* ---------- Kinetic type (design §17): split pieces and stacked layers ---------- */
.kt-word,
.kt-char {
  display: inline-block;
}

/* morph: the in-flow glyphs only reserve the 700 width; two pseudo layers
   (700 and 400, from data-text) cross-fade through custom properties. */
.kt-morph-host .kt-word {
  position: relative;
  color: transparent;
}

.kt-morph-host .kt-word::before,
.kt-morph-host .kt-word::after {
  content: attr(data-text);
  position: absolute;
  left: 50%;
  top: 0;
  white-space: nowrap;
  color: var(--kt-color, var(--text-primary));
  pointer-events: none;
}

.kt-morph-host .kt-word::before {
  font-weight: var(--fw-700);
  opacity: var(--kt-solid, 1);
  transform: translateX(-50%) scale(var(--kt-scale, 1));
}

.kt-morph-host .kt-word::after {
  font-weight: var(--fw-400);
  opacity: var(--kt-ghost, 0);
  transform: translateX(-50%);
}

/* burst: a --primary copy of each char fades out over the --primary-dark base. */
.kt-burst-host .kt-char {
  position: relative;
}

.kt-burst-host .kt-char::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  text-shadow: none;
  opacity: var(--kt-top, 0);
  pointer-events: none;
}

/* ---------- Screen-reader only ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Focus ---------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: var(--focus-w) solid var(--primary-dark);
  outline-offset: var(--focus-w);
}

[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0 var(--space-24);
  border: 0;
  border-radius: var(--radius-16);
  font-family: var(--font-body);
  font-weight: var(--fw-600);
  font-size: var(--fs-16);
  line-height: var(--lh-tight);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: box-shadow var(--dur-micro) ease, opacity var(--dur-micro) ease;
}

/* Brand CTA: "Iniciar Jogo", "Girar o Dado", "Jogar de novo" */
.btn-cta {
  min-height: var(--cta-h);
  /* Same fill as the "Continuar" button (.btn-primary): solid --primary-dark, white text. */
  background: var(--primary-dark);
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
  border: var(--outline-w-small) solid var(--primary-light);
}

/* Card and step buttons: white on --primary-dark (7.43:1) */
.btn-primary {
  min-height: var(--cta-h);
  background: var(--primary-dark);
  color: var(--text-inverse);
}

/* Quiet secondary button: --primary-dark on white */
.btn-ghost {
  background: var(--bg);
  color: var(--primary-dark);
  border: 1px solid var(--border-strong);
}

/* Square icon button (carousel arrows) */
.btn-icon {
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--primary-dark);
  border: 1px solid var(--border-strong);
}

.btn-icon svg {
  width: var(--size-icon-20);
  height: var(--size-icon-20);
}

.btn-block {
  width: 100%;
}

/* Busy: aria-disabled (never disabled) keeps focus on the button */
.btn[aria-disabled="true"],
.btn.is-busy {
  opacity: var(--busy-opacity);
  cursor: default;
}

@media (hover: hover) {
  .btn-cta:hover:not([aria-disabled="true"]) {
    box-shadow: var(--shadow-accent), 0 0 0 var(--space-2) var(--pink-light);
  }

  .btn-primary:hover:not([aria-disabled="true"]),
  .btn-ghost:hover:not([aria-disabled="true"]),
  .btn-icon:hover:not([aria-disabled="true"]) {
    box-shadow: 0 0 0 var(--space-2) var(--surface-variant);
  }
}
