/* Storg's design tokens (design.md): the two fonts and the colours, sizes and radii of the design
   system, as custom properties under the token's name. Dark is the main theme (:root, .darkmode),
   Light mirrors it role for role (.lightmode); StorgTheme::bootScript() puts the class on <html>
   before the first paint. Every Storg stylesheet reads these and declares no colour of its own. */

@font-face {
    font-family: 'FoXE';
    src: url(/assets/fonts/FoXE-Regular.woff2) format("woff2"),
         url(/assets/fonts/FoXE-Regular.woff) format("woff");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'FoXE';
    src: url(/assets/fonts/FoXE-Bold.woff2) format("woff2"),
         url(/assets/fonts/FoXE-Bold.woff) format("woff");
    font-weight: 700;
    font-display: swap;
}

:root, .darkmode {
    color-scheme: dark;
    --font-foxe: 'FoXE';
    --font-icons: 'bootstrap-icons';

    --bg-page: #02192a;
    --bg-body: #010b12;
    --bg-well: #010b12;
    --bg-sidebar: #0f364f;
    --bg-nav-active: #010b12;
    --surface-card: #062135;
    --surface-input: #0f364f;
    --surface-tab: #2d4052;
    --surface-modal: #1c2333;
    --button-quiet: #0f364f;
    --overlay: rgba(0, 0, 0, 0.7);
    --tint-primary: rgba(5, 155, 198, 0.18);

    --border-default: #3e4850;
    --border-grid: #3e4850;
    --border-control: #059bc6;
    --border-outline: #46748a;

    --text-primary: #dcddde;
    --text-strong: #ffffff;
    --text-body: #cbd4db;
    --text-muted: #c5d6e0;
    --text-soft: #cde5ff;
    --text-faint: #cbd4de;
    --text-placeholder: #dcddde;
    --nav-label: #dcddde;
    --nav-icon: #41d2fb;
    --highlight: #fff9c4;
    --user-name: #fff9c4;
    --focus-ring: #dcddde;
    --shadow-focus: 0 0 8px #dcddde;

    --primary: #03607a;
    --primary-hover: #024c60;
    --on-primary: #ffffff;
    --on-accent-save: #ffffff;
    --accent: #65e6e6;
    --accent-save: #036359;
    --accent-save-hover: #024a43;
    --button-secondary: #03607a;
    --link: #b1d7ff;
    --link-hover: #fff9c4;
    --danger-text: #fcc6c6;
    --success-text: #06edd5;

    --tab-fg: #cbd4db;
    --tab-active-bg: #273747;
    --tab-active-fg: #83cfff;

    --toast-success-bg: #024a43;
    --toast-success-border: #06edd5;
    --toast-success-text: #ffffff;
    --toast-error-bg: #3d1418;
    --toast-error-border: #ff5560;
    --toast-error-text: #ffc9ce;

    --event-confirmed: #036359;
    --on-event-confirmed: #ffffff;
    --event-confirmed-border: #06edd5;
    --event-pending: #5c4516;
    --on-event-pending: #fff2c7;
    --event-pending-border: #5c4516;
    --event-cancelled: #3d1418;
    --on-event-cancelled: #ffc9ce;
    --event-cancelled-border: #9e2d37;
    --event-blocked: #3e4850;
    --on-event-blocked: #d9e5ed;
    --event-blocked-border: #6b7b8d;
    --agenda-closed: rgba(0, 0, 0, 0.28);
    --appointment-type-1: #6aa8ff;
    --appointment-type-2: #f5c542;
    --appointment-type-3: #ff7a7a;
    --appointment-type-4: #4cd4a0;
    --appointment-type-5: #c79bff;
    --appointment-type-6: #ffa15c;
    --appointment-type-7: #3fd0e0;
    --appointment-type-8: #ff85c8;
    --modality-center: var(--appointment-type-1);
    --modality-video: var(--appointment-type-5);
    --modality-home: var(--appointment-type-4);

    /* Finance (finance.md): a receipt's or payment's state and standing chips, its alerts. */
    --finance-pending: #5c4516;
    --on-finance-pending: #fff2c7;
    --finance-settled: #036359;
    --on-finance-settled: #ffffff;
    --finance-alert: #3d1418;
    --on-finance-alert: #ffc9ce;
    --finance-alert-border: #9e2d37;

    /* The ring of a person on line, drawn on the rail only, dark in both themes. */
    --online: #25d366;

    /* A map's tiles: OpenStreetMap's light raster turned dark, its hues kept (places.md). */
    --map-tiles-filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9);

    --shadow-raised: 0 2px 4px rgba(0, 0, 0, 0.25);
    --shadow-dialog: 0 16px 32px rgba(0, 0, 0, 0.45);

    --space-4: 4px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-32: 32px;
    --radius-sm: 4px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-pill: 9999px;
    --field-height: 46px;
    --button-height: 43px;
    /* The one height every button of a screen that lines its buttons up shares (Historias médicas):
       the 44px target of an icon action, an icon alone a square of it. */
    --control-height: 44px;
    /* An action drawn as an icon alone: a 44px target, a 22px glyph; the icon beside a button's label, 20px. */
    --icon-button: 44px;
    --icon-action: 22px;
    --icon-label: 20px;
    --avatar: 100px;

    /* Layers (design.md, "Layering"): a view's lists and popups over its content, its sticky
       header over both, the shell over the view, the toasts over everything on the page. */
    --layer-popup: 20;
    --layer-sticky: 25;
    --layer-shell: 40;
    --layer-toast: 1000;
}

.lightmode {
    color-scheme: light;

    --bg-page: #eeeeee;
    --bg-body: #98c6cd;
    --bg-well: #f3f4f6;
    --bg-sidebar: #105660;
    --bg-nav-active: #0c3f46;
    --surface-card: #ffffff;
    --surface-input: #ffffff;
    --surface-tab: #eef2f6;
    --surface-modal: #ffffff;
    --button-quiet: #e2e8f0;
    --overlay: rgba(0, 0, 0, 0.5);
    --tint-primary: #e0f2f7;

    --border-default: #d1d5db;
    --border-grid: #e8ecef;
    --border-control: #1b8e9f;
    --border-outline: #d1d5db;

    --text-primary: #03506c;
    --text-strong: #111827;
    --text-body: #464b54;
    --text-muted: #464b54;
    --text-soft: #03506c;
    --text-faint: #3b4c5d;
    --text-placeholder: #454b50;
    --nav-label: #eeeeee;
    --nav-icon: #ffffff;
    --user-name: #2f4e5e;
    --focus-ring: #167684;
    --shadow-focus: 0 0 8px #167684;

    --primary: #385d6e;
    --primary-hover: #2f4e5c;
    --on-accent-save: #05332e;
    --accent: #0e5353;
    --accent-save: #16d1ba;
    --accent-save-hover: #4be0cd;
    --button-secondary: #385d6e;
    --link: #004997;
    --link-hover: #004997;
    --danger-text: #941818;
    --success-text: #09544b;

    --tab-fg: #03506c;
    --tab-active-bg: #045f80;
    --tab-active-fg: #ffffff;

    --toast-success-bg: #d8f8f3;
    --toast-success-border: #09544b;
    --toast-success-text: #05332e;
    --toast-error-bg: #fce9ec;
    --toast-error-border: #e1383b;
    --toast-error-text: #7d0b20;

    --event-confirmed: #16d1ba;
    --on-event-confirmed: #05332e;
    --event-confirmed-border: #09544b;
    --event-pending: #e8b931;
    --on-event-pending: #382804;
    --event-pending-border: #eab308;
    --event-cancelled: #a03024;
    --on-event-cancelled: #ffffff;
    --event-cancelled-border: #f44336;
    --event-blocked: #e2e8f0;
    --on-event-blocked: #03506c;
    --event-blocked-border: #94a3b8;
    --agenda-closed: #e5e7eb;
    --appointment-type-1: #1a66d9;
    --appointment-type-2: #9a6d00;
    --appointment-type-3: #c62828;
    --appointment-type-4: #12865c;
    --appointment-type-5: #7b3fcf;
    --appointment-type-6: #b8530a;
    --appointment-type-7: #0b7f8f;
    --appointment-type-8: #b8306f;
    --modality-center: var(--appointment-type-1);
    --modality-video: var(--appointment-type-5);
    --modality-home: var(--appointment-type-4);

    --finance-pending: #e8b931;
    --on-finance-pending: #382804;
    --finance-settled: #16d1ba;
    --on-finance-settled: #05332e;
    --finance-alert: #a03024;
    --on-finance-alert: #ffffff;
    --finance-alert-border: #f44336;

    --map-tiles-filter: none;

    --shadow-dialog: 0 12px 28px rgba(17, 24, 39, 0.18);
}
