/* Lavina design system — warm cream canvas, puzzle-yellow accents, soft
   rounded blocks (see docs/UI/desire.jpg). Typeface: Nunito (see fonts.css).

   This is the one copy. Every app dresses itself from here:
     - content (Next)   imports it in the root layout,
     - games / avatar   import it in main.tsx,
     - auth (no bundler) inlines it into its <style> at startup.
   App-specific rules belong in the app, not here — keep this file free of
   selectors only one site can match. */

:root {
  --bg: #fdfaf2;
  --cream: #f8f0dc;
  --mint: #e9f0e2;
  --peach: #fbeada;
  --yellow: #ffc907;
  --yellow-soft: #ffe9a3;
  --yellow-deep: #f0b400;
  /* Dark gold for link hover: --yellow-deep is ~1.9:1 on the cream bands. */
  --gold-ink: #7a5600;
  --ink: #211f1a;
  --muted: #6f6a5e;
  --line: #eadfc6;
  --white: #ffffff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(84, 66, 15, 0.08);
  /* Body type. Games' accessibility.css scales these per student profile, so
     both live behind a variable rather than a literal. */
  --lavina-font-size: 1.0625rem;
  --lavina-line-height: 1.65;
}

* {
  box-sizing: border-box;
}

html {
  /* The header is sticky, so fragment jumps (e.g. /konsultacijos#forma) must
     clear it or the target lands underneath. */
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: "Nunito Variable", "Nunito", system-ui, sans-serif;
  font-size: var(--lavina-font-size);
  color: var(--ink);
  background: var(--bg);
  line-height: var(--lavina-line-height);
  -webkit-font-smoothing: antialiased;
}

/* Sticky footer: header + main + footer fill at least the viewport. The SPAs
   mount into #root, the Next and auth apps render straight into <body>, so
   both levels carry the column. */
body,
#root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--yellow-soft);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

a {
  color: var(--ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--gold-ink);
}

main.site-main {
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 5rem;
  width: 100%;
  /* Absorbs the leftover height so the footer never rises up the page. */
  flex: 1 0 auto;
}

/* ---------- Header ---------- */

header.site {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(84, 66, 15, 0.06);
}

header.site .inner {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 0.5rem 1.4rem;
  align-items: center;
  flex-wrap: wrap;
}

header.site .brand {
  display: inline-flex;
  align-items: center;
  margin-right: 0.75rem;
}

header.site .brand svg {
  width: auto;
  display: block;
}

header.site nav.main-nav {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  align-items: center;
}

header.site nav.main-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
}

header.site nav.main-nav a:hover {
  background: var(--cream);
  color: var(--ink);
}

header.site .header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

header.site .user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Sign-out is a <button> in the SPAs and an <a> in the content site — the skin
   has to sit on the class, not the element. */
header.site .sign-out {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

header.site .sign-out:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* ---------- Buttons ---------- */

button,
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  border: 2px solid var(--yellow);
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  justify-self: start;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

/* :hover still matches a disabled button, so the hover skin has to opt out of
   one explicitly — otherwise a dead button lights up under the cursor. */
button:hover:not(:disabled),
.btn:hover {
  background: var(--yellow-deep);
  border-color: var(--yellow-deep);
  color: var(--ink);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  button,
  .btn {
    transition: none;
  }

  button:hover,
  .btn:hover {
    transform: none;
  }
}

button.secondary,
.btn--outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

button.secondary:hover:not(:disabled),
.btn--outline:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

button.danger {
  background: #c22f2f;
  border-color: #c22f2f;
  color: #fff;
}

button.danger:hover:not(:disabled) {
  background: #a52626;
  border-color: #a52626;
}

/* Compact buttons for dense rows (tables, list items, toolbars). */
button.small {
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
}

/* The one call to action a page is built around. */
button.large {
  font-size: 1.1rem;
}

a.download {
  display: inline-block;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--yellow);
  border: 2px solid var(--yellow);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

a.download:hover {
  background: var(--yellow-deep);
  border-color: var(--yellow-deep);
  color: var(--ink);
}

.arrow-link {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- Bands (rounded page blocks) ---------- */

.band {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  margin: 0 0 1.25rem;
}

.band--mint {
  background: var(--mint);
}

.band--peach {
  background: var(--peach);
}

.band--yellow {
  background: var(--yellow-soft);
}

.band--plain {
  background: var(--white);
  box-shadow: var(--shadow);
}

/* ---------- Page scaffolding ---------- */

.page-head {
  padding: clamp(1.5rem, 4vw, 3rem) 0 1.5rem;
  max-width: 46rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 34rem;
}

.page-head .lede {
  font-size: 1.15rem;
  max-width: none;
  margin: 0;
}

.prose-page {
  max-width: 46rem;
}

.prose-page p {
  font-size: 1.1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.25rem;
}

.cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

/* Single yellow puzzle piece used as a section accent (see <PuzzleMark />). */
.puzzle-mark {
  display: block;
  width: 34px;
  height: 34px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.35rem;
  margin-top: 0;
}

.card h2 a {
  text-decoration: none;
}

.card h2 a:hover {
  text-decoration: underline;
}

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  margin-bottom: 1.25rem;
}

.cards .card {
  margin-bottom: 0;
}

.badge {
  display: inline-block;
  background: var(--cream);
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

/* Pill-shaped choices — consultation slots, filters, tags. */

.chip {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.chip:hover {
  background: var(--yellow-soft);
  color: var(--ink);
}

.chip.selected {
  background: var(--yellow);
  border-color: var(--yellow);
}

.chip-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}

/* ---------- Forms ---------- */

/* Text-ish fields only. A bare `input` selector would also paint checkboxes,
   radios, range sliders and colour pickers as white padded boxes. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="submit"]):not([type="button"]),
textarea,
select {
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  border: 1.5px solid #d8cfb8;
  border-radius: var(--radius-sm);
  font-family: inherit;
  background: var(--white);
  color: var(--ink);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  /* Ink, not yellow: the ring has to stay visible on the yellow band too. */
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

label {
  font-weight: 700;
}

/* A label that owns a full-width control, stacked caption over field. */
label.field {
  display: grid;
  gap: 0.3rem;
  max-width: 34rem;
  margin-bottom: 0.75rem;
}

label.field input,
label.field textarea,
label.field select {
  width: 100%;
}

/* A column of stacked fields ending in one submit. */
form.stack {
  display: grid;
  gap: 0.9rem;
  max-width: 26rem;
}

form.stack label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
  font-weight: 700;
}

form.stack .hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* Checkbox and its caption on one line, box first. */
label.checkbox,
label:has(> input[type="checkbox"]) {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Notices ---------- */

.notice {
  color: #14532d;
  background: #e6f4e6;
  border: 1px solid #bfe3bf;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
}

.error {
  color: #9c1c1c;
  background: #fdecec;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
}

/* ---------- Tables ---------- */

table.list {
  border-collapse: collapse;
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table.list th,
table.list td {
  text-align: left;
  padding: 0.6rem 0.85rem;
}

table.list thead th {
  background: var(--cream);
  font-size: 0.9rem;
  white-space: nowrap;
}

table.list tbody tr {
  border-top: 1px solid #f0ead9;
}

/* ---------- Footer ---------- */

footer.site {
  background: var(--cream);
  border-top: 1px solid var(--line);
  color: var(--muted);
  flex-shrink: 0;
}

/* Optional upper deck: brand blurb on the left, link columns on the right. */
footer.site .inner {
  max-width: 74rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
  display: flex;
  gap: 2.5rem 4rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

footer.site .foot-brand svg {
  width: auto;
}

footer.site .foot-brand p {
  max-width: 18rem;
  margin: 0.9rem 0 0;
}

footer.site nav {
  display: flex;
  gap: 2.5rem 4rem;
  flex-wrap: wrap;
}

footer.site nav h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

footer.site nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

footer.site nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}

footer.site nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

footer.site .foot-bottom {
  max-width: 74rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.9rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

/* The rule only earns its keep under an upper deck; on the apps that ship the
   bottom strip alone it would draw a line right below the footer's own edge. */
footer.site .inner + .foot-bottom {
  border-top: 1px solid var(--line);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  header.site .header-actions {
    margin-left: 0;
  }
}


@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-ext.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* One narrow card in the middle of the page, not a full-width site layout. */
main.site-main {
  max-width: 30rem;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1.25rem 5rem;
}

main.site-main .card {
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 0;
}

/* The heading names the form; it is not a hero, so it stays off the h1 clamp. */
main.site-main h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

main.site-main p {
  margin: 0 0 1rem;
}

/* Every form here is a stack of labelled fields, so the pages can keep writing
   bare <form> and <label> instead of tagging each one. */
main.site-main form {
  display: grid;
  gap: 0.9rem;
  margin: 0 0 1rem;
}

main.site-main form:last-child,
main.site-main p:last-child {
  margin-bottom: 0;
}

main.site-main label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

/* Consent checkboxes carry a sentence, not a caption: top-align the box with
   the first line and drop the bold. */
main.site-main label:has(> input[type="checkbox"]) {
  align-items: start;
  font-weight: 400;
}

main.site-main a {
  font-weight: 700;
}

/* The admin's app chooser: one full-width button per app. */
main.site-main .app-links {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
}

main.site-main .app-links .btn {
  justify-self: stretch;
  text-align: center;
}
