/* ==========================================================================
   Base CSS — Reset & Typography (DARK-ONLY SAFE)
   --------------------------------------------------------------------------
   Purpose:
   - Global reset
   - Typography defaults
   - Accessibility-safe focus handling
   - Stable layout behavior
   RULES:
   - Design tokens MUST be imported before this file
   - NO colors defined here (only token references)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Font Declarations (Moved to fonts.css)
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Root Defaults (TOKEN CONSUMER ONLY — NO DEFINITIONS)
   -------------------------------------------------------------------------- */
:root {
    /* Typography */
    font-family: var(--font-family);

    /* Accessibility */
    --focus-outline-width: 2px;
    --focus-outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Global Box Model Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Root Document Defaults
   -------------------------------------------------------------------------- */
html {
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   Body — DARK THEME BASELINE
   -------------------------------------------------------------------------- */
body {
    background-color: var(--bg-primary);
    color: var(--text-main);

    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Text Elements
   -------------------------------------------------------------------------- */
p,
li,
dd,
dt {
    line-height: 1.6;
}

/* Headings inherit size elsewhere, but color is enforced */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: inherit;
    line-height: 1.25;
    color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */
a {
    color: inherit;
    text-decoration: none;
}

/* Keyboard-accessible focus (MANDATORY) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: var(--focus-outline-width) solid var(--primary);
    outline-offset: var(--focus-outline-offset);
}

/* --------------------------------------------------------------------------
   Media
   -------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Form Elements — Neutral Reset
   -------------------------------------------------------------------------- */
button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
    background: transparent;
    border: none;
}

button {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
ul,
ol {
    list-style: none;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* --------------------------------------------------------------------------
   Hidden Content
   -------------------------------------------------------------------------- */
[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Motion Safety
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* CSP & Utility Classes */
.u-hidden {
    display: none !important;
}

.u-block {
    display: block !important;
}

.u-invisible {
    visibility: hidden !important;
}

.u-flex {
    display: flex !important;
}

.auth-card-limited {
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
}

.access-request-textarea {
    width: 100%;
    margin-top: 12px;
    resize: none;
}

.w-full {
    width: 100%;
}

.u-mt-12 {
    margin-top: 12px;
}

.u-mt-24 {
    margin-top: 24px;
}

.u-mt-28 {
    margin-top: 28px;
}

.u-mb-24 {
    margin-bottom: 24px;
}

.u-text-center {
    text-align: center;
}

.u-text-error {
    color: #ef4444;
    border-color: #ef4444;
}