/* ==========================================================================
   Artist CRM – Design system
   Tokens derived from DESIGN.md ("Artist Professional B2B").
   Plain CSS only (no Tailwind / no Bootstrap).
   ========================================================================== */

:root {
    /* ---- Color: surfaces ---- */
    --surface: #f9f9fa;
    --background: #f9f9fa;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f4f3f4;
    --surface-container: #eeeeee;
    --surface-container-high: #e8e8e9;
    --surface-container-highest: #e2e2e3;
    --surface-variant: #e2e2e3;

    /* ---- Color: content ---- */
    --on-surface: #1a1c1d;
    --on-surface-variant: #41484a;
    --on-background: #1a1c1d;

    /* ---- Color: primary (Deep Slate) ---- */
    --primary: #002028;
    --on-primary: #ffffff;
    --primary-container: #0c3640;
    --on-primary-container: #7a9fab;
    --primary-fixed: #c2e9f6;
    --on-primary-fixed: #001f27;
    --on-primary-fixed-variant: #264c56;

    /* ---- Color: secondary (Warm Amber) ---- */
    --secondary: #725c00;
    --secondary-container: #fed329;
    --on-secondary-container: #705b00;
    --secondary-fixed: #ffe07d;
    --secondary-fixed-dim: #ecc30f;
    --on-secondary-fixed: #231b00;
    --on-secondary-fixed-variant: #564500;

    /* ---- Color: accents & semantic ---- */
    --teal-accent: #5ca793;
    --brick-red: #c02e1d;
    --slate-blue: #0f5b78;
    --error: #ba1a1a;
    --error-container: #ffdad6;
    --on-error-container: #93000a;

    /* ---- Lines ---- */
    --outline: #71787b;
    --outline-variant: #c1c8ca;
    --border-subtle: #e2e8f0;

    /* ---- Spacing scale ---- */
    --space-base: 4px;
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --gutter: 24px;
    --margin-mobile: 16px;
    --margin-desktop: 40px;

    /* ---- Radius ---- */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* ---- Elevation ---- */
    --shadow-1: 0px 4px 12px rgba(12, 54, 64, 0.05);
    --shadow-2: 0px 12px 24px rgba(12, 54, 64, 0.08);
    --shadow-lg: 0px 20px 40px rgba(12, 54, 64, 0.12);

    /* ---- Layout ---- */
    --content-max: 1280px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--on-surface);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6, p, ul, figure {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--primary-container);
    outline-offset: 2px;
}

/* Headings are focused programmatically by <FocusOnNavigate> for screen readers.
   They aren't interactive, so suppress the visible focus ring on them. */
h1:focus,
h1:focus-visible,
h2:focus,
h2:focus-visible {
    outline: none; 
}

/* ==========================================================================
   Typography helpers
   ========================================================================== */

.t-headline-xl {
    font-size: 48px;
    line-height: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.t-headline-lg {
    font-size: 32px;
    line-height: 40px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.t-headline-md {
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
}

.t-body-lg {
    font-size: 18px;
    line-height: 28px;
    font-weight: 400;
}

.t-body-md {
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;
}

.t-body-sm {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
}

.t-label-md {
    font-size: 14px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.t-label-sm {
    font-size: 12px;
    line-height: 14px;
    font-weight: 500;
}

.t-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.text-primary { color: var(--primary); }
.text-muted { color: var(--on-surface-variant); }
.text-teal { color: var(--teal-accent); }

@media (max-width: 768px) {
    .t-headline-xl { font-size: 34px; line-height: 42px; }
    .t-headline-lg { font-size: 26px; line-height: 34px; }
}

/* ==========================================================================
   Layout primitives
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding-inline: var(--margin-desktop);
}

.section {
    padding-block: var(--space-xl);
}

@media (max-width: 768px) {
    .container { padding-inline: var(--margin-mobile); }
    .section { padding-block: var(--space-lg); }
}

.section-head {
    text-align: center;
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: var(--space-xl);
}

.section-head p {
    margin-top: var(--space-sm);
    color: var(--on-surface-variant);
}

.eyebrow {
    display: inline-block;
    color: var(--teal-accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

/* Generic responsive grid */
.grid {
    display: grid;
    gap: var(--gutter);
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    transition: opacity .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background-color: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-1);
}
.btn-primary:hover { opacity: .9; }

.btn-amber {
    background-color: var(--secondary-container);
    color: var(--on-secondary-fixed);
    box-shadow: var(--shadow-1);
}
.btn-amber:hover { filter: brightness(1.05); }

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background-color: rgba(0, 32, 40, 0.05); }

.btn-outline-light {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--on-primary);
}
.btn-outline-light:hover { background-color: rgba(255, 255, 255, 0.1); }

.btn-lg { padding: 16px 32px; font-size: 16px; }

/* ==========================================================================
   Cards & chips
   ========================================================================== */

.card {
    background-color: var(--surface-container-lowest);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-1);
}

.card-flat {
    background-color: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.hover-lift {
    transition: transform .2s cubic-bezier(0.33, 1, 0.68, 1), box-shadow .2s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    background-color: var(--surface-container-high);
    color: var(--on-surface-variant);
}

.chip-amber {
    background-color: var(--secondary-container);
    color: var(--on-secondary-container);
}

.chip-teal {
    background-color: rgba(92, 167, 147, 0.15);
    color: var(--teal-accent);
}

/* Icon tile */
.icon-tile {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-tile--primary { background-color: var(--primary-container); color: var(--on-primary-container); }
.icon-tile--amber { background-color: var(--secondary-container); color: var(--on-secondary-container); }
.icon-tile--neutral { background-color: var(--surface-container-high); color: var(--primary); }
.icon-tile--teal { background-color: var(--teal-accent); color: #fff; }
.icon-tile--round { border-radius: var(--radius-full); }

/* ==========================================================================
   Material Symbols
   ========================================================================== */

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    user-select: none;
}

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   Blazor error UI (kept from template, restyled)
   ========================================================================== */

#blazor-error-ui {
    color-scheme: light only;
    background: var(--error-container);
    color: var(--on-error-container);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--error);
    padding: 1rem;
    color: white;
    border-radius: var(--radius);
}

.blazor-error-boundary::after {
    content: "Ett fel har inträffat.";
}
