/* =====================================================================
   BioLab Academy — shared design tokens & components
   Colours are sampled from the original Tilda design.
   ===================================================================== */

@font-face {
  font-family: "BL Jost";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2");
  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: "BL Jost";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/jost-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}
@font-face {
  font-family: "BL Georgian";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/noto-sans-georgian-georgian-wght-normal.woff2") format("woff2");
  unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31;
}

:root {
  /* brand (sampled from the Tilda page) */
  --sage: #79a081;          /* bands, programs card, mobile tab bar */
  --sage-600: #62916d;      /* feature cards */
  --sage-700: #57775f;      /* primary buttons */
  --sage-800: #465f4c;      /* hover */
  --sage-900: #2f4334;
  --sage-200: #c7d9cb;
  --sage-100: #dfe9e1;      /* progress track */
  --sage-50: #f2f7f3;
  --olive: #7b916b;         /* check marks */
  --ring: #98a697;          /* radio rings */
  --ink: #111111;           /* headings */
  --text: #1d1f1e;
  --muted: #646a66;
  --faint: #8d938f;
  --line: #cdcdcd;
  --line-soft: #e6e8e6;
  --soft: #f5f5f5;          /* quiz options */
  --gray-bg: #efefef;       /* "free lesson" section */
  --white: #ffffff;

  --danger: #b3261e;  --danger-50: #fdecea;
  --warn: #9a6212;    --warn-50: #fff4e0;
  --info: #22678a;    --info-50: #e6f2f8;
  --ok: #2e7d4f;      --ok-50: #e7f4ec;

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(17, 17, 17, 0.06), 0 2px 10px rgba(17, 17, 17, 0.05);
  --shadow-2: 0 18px 50px rgba(17, 17, 17, 0.18);
  --font: "BL Jost", "BL Georgian", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Georgian", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --tabbar-h: 58px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0; font-weight: 800; }
p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--sage-200); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--sage-700) 55%, transparent); outline-offset: 2px; }

.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;
}
.container { width: min(100% - 40px, 1120px); margin-inline: auto; }

/* ---------- icons ---------- */
.icon {
  display: inline-block; vertical-align: -0.2em;
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.6em; height: 1.6em; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo__mark { width: 34px; height: 34px; }
.logo__text { font-weight: 700; font-size: 19px; letter-spacing: 0.16em; }
.logo__text small { display: block; font-size: 10.5px; letter-spacing: 0.04em; font-weight: 500; color: var(--muted); margin-top: 2px; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--sage-700); --btn-fg: #fff; --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1.5px solid var(--btn-bd); border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease), color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { --btn-bg: var(--sage-800); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--secondary { --btn-bg: #fff; --btn-fg: var(--sage-800); --btn-bd: var(--sage-700); }
.btn--secondary:hover { --btn-bg: var(--sage-50); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text); }
.btn--ghost:hover { --btn-bg: var(--soft); }
.btn--danger { --btn-bg: var(--danger); }
.btn--danger:hover { --btn-bg: #8f1d17; }
.btn--danger-ghost { --btn-bg: transparent; --btn-fg: var(--danger); }
.btn--danger-ghost:hover { --btn-bg: var(--danger-50); }
.btn--white { --btn-bg: #fff; --btn-fg: var(--sage-800); }
.btn--white:hover { --btn-bg: var(--sage-50); }
.btn--pill { border-radius: var(--radius-pill); }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; font-size: 16px; padding: 14px 22px; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn--icon { padding: 0; width: 40px; min-height: 40px; }
.btn--icon.btn--sm { width: 34px; min-height: 34px; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--btn-fg); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field__label { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid #b9bfbb; border-radius: var(--radius-sm); background: #fff;
  font-size: 16px; line-height: 1.35; transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: #9a9f9c; }
.input:hover, .select:hover, .textarea:hover { border-color: #8d948f; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--sage-700); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage-700) 22%, transparent);
}
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 96px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23465f4c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.row { display: flex; gap: 12px; align-items: flex-start; }
.row > * { flex: 1; min-width: 0; }
.row .field + .field { margin-top: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--sage-700); margin: 0; flex: none; }
.input-group { display: flex; gap: 8px; }
.input-group > .input { flex: 1; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 48px; }
.password-wrap button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; background: none; color: var(--muted); border-radius: 8px;
  display: grid; place-items: center;
}

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 600; line-height: 1.4; background: var(--soft); color: var(--text); white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; }
a.chip { text-decoration: none; }
a.chip:hover { filter: brightness(0.96); }
.chip--sage { background: var(--sage-100); color: var(--sage-900); }
.chip--ok { background: var(--ok-50); color: var(--ok); }
.chip--warn { background: var(--warn-50); color: var(--warn); }
.chip--danger { background: var(--danger-50); color: var(--danger); }
.chip--info { background: var(--info-50); color: var(--info); }
.chip--dark { background: var(--ink); color: #fff; }
.chip--zoom { background: #e8f1ff; color: #1b5fc1; }
.chip--meet { background: #e6f4ea; color: #137333; }
.chip--teams { background: #eceefb; color: #464eb8; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14.5px; line-height: 1.45; }
.alert .icon { margin-top: 1px; }
.alert--info { background: var(--info-50); color: var(--info); }
.alert--warn { background: var(--warn-50); color: var(--warn); }
.alert--danger { background: var(--danger-50); color: var(--danger); }
.alert--ok { background: var(--ok-50); color: var(--ok); }

/* ---------- modal (native <dialog>) ---------- */
.modal {
  width: min(100% - 24px, 560px); max-height: min(92vh, 900px); padding: 0; border: 0;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-2); background: #fff; color: var(--text);
}
.modal--wide { width: min(100% - 24px, 720px); }
.modal::backdrop { background: rgba(20, 30, 23, 0.45); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in 0.22s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal__inner { display: flex; flex-direction: column; max-height: inherit; }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.modal__title { font-size: 19px; font-weight: 800; flex: 1; }
.modal__close { border: 0; background: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.modal__close:hover { background: var(--soft); color: var(--ink); }
.modal__body { padding: 4px 20px 18px; overflow-y: auto; }
.modal__foot {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--line-soft); background: #fbfcfb;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
@media (max-width: 560px) {
  .modal { width: 100%; max-width: 100%; max-height: 94vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .modal[open] { animation: sheet-in 0.25s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  .modal__foot { border-radius: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .modal__foot .btn { flex: 1; }
}

/* ---------- toast ---------- */
.toasts {
  position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(100% - 24px, 440px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14.5px; box-shadow: var(--shadow-2);
  animation: toast-in 0.25s var(--ease);
}
.toast--ok .icon { color: #8fd3a5; }
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--sage-100); border-top-color: var(--sage-700); animation: spin 0.8s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, #eef1ef 25%, #f6f8f6 50%, #eef1ef 75%); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite; border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.demo-ribbon {
  position: fixed; z-index: 900; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 24px);
  background: #1d1f1e; color: #fff; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  box-shadow: var(--shadow-1); display: flex; gap: 8px; align-items: center;
}
.demo-ribbon button { border: 0; background: rgba(255,255,255,.16); color: #fff; border-radius: 999px; font-size: 12px; padding: 2px 8px; }
