/* ============================================================================
   ByDefolt - shared design tokens (G-02)

   One canonical scale for all five surfaces (professional, company, admin,
   login, register). The tokens are namespaced `--bd-*` and use `:where()` for
   the focus-visible baseline, so they never override an app's existing
   `--blue`/`--tx` values. Apps keep their own palette until each selector is
   migrated incrementally, which is the approach the UX audit asked for.
   ========================================================================== */

:root {
    /* Brand */
    --bd-blue: #1a56db;
    --bd-blue-dark: #1443ab;
    --bd-blue-light: #eef4ff;
    --bd-navy: #2457c5;
    --bd-navy-2: #3675e8;

    /* Surfaces */
    --bd-bg: #f1f3f7;
    --bd-surface: #ffffff;
    --bd-surface-2: #f8fafd;
    --bd-surface-3: #f5f7fa;

    /* Text - the third step was raised to meet WCAG AA on white. */
    --bd-text: #101828;
    --bd-text-2: #5c6779;
    --bd-text-3: #667085;
    --bd-text-invert: #ffffff;

    /* Borders */
    --bd-border: #e4e8ef;
    --bd-border-strong: #d0d5dd;

    /* Semantic */
    --bd-success: #077b47;
    --bd-success-bg: #e7f6ee;
    --bd-warn: #b45309;
    --bd-warn-bg: #fff7e6;
    --bd-danger: #b42318;
    --bd-danger-bg: #fef3f2;
    --bd-info: #0e7490;
    --bd-info-bg: #ecfdff;

    /* Focus ring */
    --bd-focus: #1a56db;
    --bd-focus-ring: 0 0 0 3px rgba(26, 86, 219, 0.28);

    /* Typography */
    --bd-font: 'Inter', "Segoe UI", system-ui, -apple-system, sans-serif;
    --bd-font-mono: ui-monospace, Consolas, "Courier New", monospace;

    /* Spatial rhythm: 4px base */
    --bd-space-1: 4px;
    --bd-space-2: 8px;
    --bd-space-3: 12px;
    --bd-space-4: 16px;
    --bd-space-5: 20px;
    --bd-space-6: 24px;
    --bd-space-8: 32px;

    /* Radius */
    --bd-radius-sm: 8px;
    --bd-radius: 10px;
    --bd-radius-lg: 14px;
    --bd-radius-pill: 999px;

    /* Elevation */
    --bd-shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
    --bd-shadow-2: 0 4px 12px rgba(16, 24, 40, 0.08);
    --bd-shadow-3: 0 8px 24px rgba(16, 24, 40, 0.18);

    /* Layering */
    --bd-z-nav: 50;
    --bd-z-scrim: 90;
    --bd-z-modal: 100;
    --bd-z-toast: 99999;

    /* Motion */
    --bd-ease: cubic-bezier(0.2, 0, 0.2, 1);
    --bd-fast: 120ms;
    --bd-base: 200ms;
}

/* Keyboard focus baseline for surfaces that did not have one. Zero
   specificity keeps every app-specific focus rule in charge. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--bd-focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    :where(.skip-link, .toast, .modal) {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
