/*
 * AI Assurance Design Foundation
 * Production-safe, self-hosted and CSP-compatible.
 */

:root {
    --app-bg: #f4f7fb;
    --app-surface: #ffffff;
    --app-surface-muted: #f8fafc;
    --app-surface-strong: #eef3f9;

    --app-text: #152033;
    --app-text-soft: #526178;
    --app-text-muted: #718096;

    --app-border: #dbe3ee;
    --app-border-strong: #c5d0df;

    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-primary-soft: #eaf1ff;

    --app-success: #07835f;
    --app-success-soft: #e9f8f2;
    --app-warning: #b35c00;
    --app-warning-soft: #fff5e7;
    --app-danger: #c72c41;
    --app-danger-soft: #fff0f2;

    --app-sidebar-bg: #071426;
    --app-sidebar-bg-alt: #0b1b31;
    --app-sidebar-border: rgba(255, 255, 255, .09);
    --app-sidebar-text: #dce6f5;
    --app-sidebar-muted: #8fa2bd;
    --app-sidebar-active: #173a70;

    --app-sidebar-width: 276px;
    --app-sidebar-collapsed-width: 82px;
    --app-topbar-height: 94px;

    --app-radius-sm: 9px;
    --app-radius: 14px;
    --app-radius-lg: 20px;

    --app-shadow-sm: 0 2px 8px rgba(20, 35, 60, .06);
    --app-shadow: 0 12px 32px rgba(20, 35, 60, .09);
    --app-shadow-lg: 0 24px 60px rgba(20, 35, 60, .14);

    --app-content-max: 1680px;
    --app-transition: 180ms ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--app-bg);
    color: var(--app-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 15px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--app-primary);
    text-decoration: none;
}

a:hover {
    color: var(--app-primary-dark);
}

img,
svg {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--app-text);
    font-weight: 750;
    letter-spacing: -.025em;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 5000;
    transform: translateY(-150%);
    padding: .7rem 1rem;
    border-radius: var(--app-radius-sm);
    background: #ffffff;
    color: #071426;
    font-weight: 700;
    box-shadow: var(--app-shadow);
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 2px;
}

.text-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.text-success {
    color: var(--app-success) !important;
}

.text-warning {
    color: var(--app-warning) !important;
}

.text-danger {
    color: var(--app-danger) !important;
}

.app-flash {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    width: 100%;
    margin-bottom: 1rem;
    padding: .9rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-sm);
    font-weight: 600;
}

.app-flash-success {
    border-color: #b7ead8;
    background: var(--app-success-soft);
    color: #046247;
}

.app-flash-warning {
    border-color: #ffd59d;
    background: var(--app-warning-soft);
    color: #864200;
}

.app-flash-danger {
    border-color: #f6bdc6;
    background: var(--app-danger-soft);
    color: #982133;
}

.app-flash-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, .7);
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem 1.5rem;
    color: var(--app-text-muted);
    font-size: .8rem;
}

@media (max-width: 767.98px) {
    .app-footer {
        flex-direction: column;
        padding-inline: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
