/* ════════════════════════════════════════════════════════════════
   Stoei Core — stoei.css
   Components for Stoei apps: badges, cards, pills, sign-in box and
   small helpers. Buttons, fields, form messages and the light/dark
   switch are in controls.css (shared with websites).

   Master copy lives in the stoei-core repo (see VERSION). Each app
   vendors its own copy and loads, in this order:
     css/fonts.css      default fonts (an app with its own fonts skips it)
     css/tokens.css     every look setting, with defaults
     css/base.css       page basics, focus ring
     css/controls.css   buttons, fields, form messages, light/dark switch
     css/stoei.css      this file
     css/app-shell.css  only apps with a sidebar
     the app's theme file (e.g. public/css/theme.css): the app's look
     js/stoei.js        in <head>, so the saved theme applies before paint

   This file only reads settings (var(--st-...)); it never sets a color,
   font, size, corner, shadow or space of its own. To change the look,
   set the names in the app's theme file. List: docs/THEME-SETTINGS.md.
   Check: php tools/check-css.php
════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════
   BASE (on top of base.css)
════════════════════════════════════════════════════════════════ */
* { margin: 0; padding: 0; }

body {
    color: var(--st-color-text-soft);
    -webkit-font-smoothing: antialiased;
    transition: background var(--st-motion), color var(--st-motion);
}

h1, h2, h3 {
    font-family: var(--st-font-display);
    font-weight: var(--st-weight-heading);
    color: var(--st-color-text);
    letter-spacing: var(--st-tracking-heading);
    line-height: var(--st-leading-heading);
    text-wrap: balance;
}
h4, h5, h6 {
    font-family: var(--st-font-body);
    font-weight: var(--st-weight-strong);
    color: var(--st-color-text);
}

button { font-family: inherit; cursor: pointer; }

a {
    text-decoration: none;
    transition: color var(--st-motion);
}
a:hover { color: var(--st-color-accent-hover); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════
   TYPE HELPERS
════════════════════════════════════════════════════════════════ */
.st-display {
    font-family: var(--st-font-display);
    font-weight: var(--st-weight-heading);
    letter-spacing: var(--st-tracking-title);
    line-height: var(--st-leading-title);
    color: var(--st-color-text);
}
.st-eyebrow {
    font-family: var(--st-font-body);
    font-size: var(--st-text-1);
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--st-color-eyebrow);
}
.st-label {
    font-size: var(--st-text-1);
    font-weight: var(--st-weight-strong);
    letter-spacing: var(--st-tracking-label);
    text-transform: uppercase;
    color: var(--st-color-text-muted);
}
.st-muted { color: var(--st-color-text-muted); }
.st-accent { color: var(--st-color-accent); }

/* ════════════════════════════════════════════════════════════════
   SCROLLBAR
════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--st-color-line-strong); border-radius: var(--st-radius-3); }
::-webkit-scrollbar-thumb:hover { background: var(--st-color-text-faint); }

/* ════════════════════════════════════════════════════════════════
   BADGES
════════════════════════════════════════════════════════════════ */
.st-badge {
    display: inline-flex;
    align-items: center;
    font-size: var(--st-text-1);
    font-weight: var(--st-weight-strong);
    letter-spacing: 0.03em;
    padding: var(--st-space-1) var(--st-space-3);
    border-radius: var(--st-radius-pill);
    white-space: nowrap;
    background: var(--st-color-sunk);
    color: var(--st-color-text-muted);
}
.st-badge--ok { background: var(--st-color-ok-tint); color: var(--st-color-ok); }
.st-badge--warn { background: var(--st-color-warn-tint); color: var(--st-color-warn); }
.st-badge--info { background: var(--st-color-info-tint); color: var(--st-color-info); }
.st-badge--bad { background: var(--st-color-bad-tint); color: var(--st-color-bad); }
.st-badge--accent { background: var(--st-color-accent-tint); color: var(--st-color-accent); }

/* ════════════════════════════════════════════════════════════════
   CARDS / PANELS
════════════════════════════════════════════════════════════════ */
.st-card {
    background: var(--st-color-surface);
    border: var(--st-line-width) solid var(--st-color-line);
    border-radius: var(--st-radius-card);
    padding: var(--st-space-5);
    transition: border-color var(--st-motion);
}
.st-card--interactive { cursor: pointer; }
.st-card--interactive:hover { border-color: var(--st-color-accent); }

/* ════════════════════════════════════════════════════════════════
   SIGN-IN BOX
════════════════════════════════════════════════════════════════ */
.st-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--st-color-bg);
    padding: var(--st-space-4);
}
.st-auth-card {
    background: var(--st-color-surface);
    border: var(--st-line-width) solid var(--st-color-line);
    border-radius: var(--st-radius-big);
    padding: var(--st-space-8) var(--st-space-7);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--st-shadow-raised);
}

/* ════════════════════════════════════════════════════════════════
   HELPERS
════════════════════════════════════════════════════════════════ */
.st-divider {
    border: none;
    border-top: var(--st-line-width) solid var(--st-color-line);
    margin: var(--st-space-4) 0;
}
.st-fade-in { animation: st-fade-in 0.18s ease; }
@keyframes st-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .st-fade-in { animation: none; }
}

/* ════════════════════════════════════════════════════════════════
   PILLS (tags, filters)
════════════════════════════════════════════════════════════════ */
.st-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--st-space-1);
    padding: var(--st-space-1) var(--st-space-3);
    border-radius: var(--st-radius-pill);
    font-size: var(--st-text-1);
    font-weight: 500;
    white-space: nowrap;
    background: var(--st-color-accent-tint);
    color: var(--st-color-accent);
    border: var(--st-line-width) solid transparent;
}
.st-pill--filter {
    background: none;
    color: var(--st-color-text-muted);
    border: var(--st-line-width) solid var(--st-color-line-strong);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--st-motion), color var(--st-motion), border-color var(--st-motion);
}
.st-pill--filter:hover,
.st-pill--active {
    background: var(--st-color-accent-tint);
    color: var(--st-color-accent);
    border-color: var(--st-color-accent);
}
