/* Fonts */

@font-face {
    font-family: 'Gilroy';
    src: local('Gilroy-Regular'), url('/fonts/Gilroy-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: local('Gilroy-Medium'), url('/fonts/Gilroy-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: local('Gilroy-Bold'), url('/fonts/Gilroy-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Keyboard focus: the brand's navy, over 3:1 against the white and grey it is drawn on (_base.css draws it, white on navy surfaces).
   No shorthand token: one would take its colour where it is declared, so a surface's own colour would not reach it. */

:root {
    --focus-ring-color: var(--secondary);
    --focus-ring-width: 2px;
    --focus-ring-offset: 2px;
}

/* Design Tokens */

:root {
    --primary: #FF0A3C;
    --primary-dark: #d9002a;
    --secondary: #1E3D59;
    --surface: #ffffff;
    --surface-light: #ffffff;
    --surface-lighter: #D9D9D9;
    --bg-main: #E2E2E2;
    --bg-gradient: linear-gradient(180deg, rgba(222, 238, 254, 0.40) 10%, rgba(226, 226, 226, 0.00) 90%);
    --text-primary: #010B26;
    --text-secondary: #5a6478;
    --accent-green: #22c55e;
    --accent-red: #FF0A3C;
    --accent-blue: #3b82f6;
    --accent-amber: #f59e0b;
    --border-color: #dce3ef;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --disabled-bg: #4F4F4F;
    --disabled-text: #FFF;
    --completed-bg: rgba(34, 197, 94, 0.08);
    --completed-border: rgba(34, 197, 94, 0.3);

    /* Lists and progress: the greens and ambers are darker shades that keep 3:1 against white, which --accent-green/--accent-amber do not. */
    --surface-muted: #F6F8FC;
    --surface-chip: #EEF2F8;
    /* The checkerboard behind a picture's transparent parts: mid-grey, so white words and dark words both show. */
    --checker-light: #C3C8D1;
    --checker-dark: #A9B0BC;
    --surface-selected: #F0F5FE;
    --surface-hover: #E6ECF6;
    --bar-track: #D3DAE7;
    --bar-fill: #2F6FE4;
    --status-done: #16874D;
    --status-done-text: #0B5F33;
    --status-missing-text: #8F0D2B;
    --status-todo: #F2B544;
    --stage-new-bg: #E9EDF4;
    --stage-new-text: #2F3B52;
    --stage-progress-bg: #FFE9B8;
    --stage-progress-text: #6E4200;
    --stage-ready-bg: #D6F0E0;
    --stage-ready-text: var(--status-done-text);
    --stage-done-bg: #D9E6FB;
    --stage-done-text: #1A459B;
    /* The older type names, kept as steps of the type scale below. */
    --font-heading: var(--text-6xl);
    --font-card-title: var(--text-2xl);
    --font-large: var(--text-lg);
    --font-regular: var(--text-base);
    --font-small: var(--text-xs);

    /* DREAMI overview and Generate screens: tints and text pairs */
    --tint-red: #FBE3E8;
    --tint-primary-pale: #FFF4F6;
    --primary-text: #B80F36;
    --line-future: #C3CCDD;
    --outline-future: #AEB9CE;
    --link-blue: #1D4FA8;
    --tint-purple-bg: #EADFF7;
    --tint-purple-text: #4B2A8A;
    --tint-teal-bg: #D4F0EE;
    --tint-teal-text: #0B5A55;
    --tint-pink-bg: #F9DFF0;
    --tint-pink-text: #7A1B5A;
    --tint-slate-bg: #E1E7F0;
    --tint-slate-text: #2F3B52;
    --tint-orange-bg: #FFE0CC;
    --tint-orange-text: #8A3B00;
    --tint-amber-pale: #FFF1D1;
    --status-amber-edge: #C77700;
    --surface-ok: #F3FBF6;
    --status-ok-edge: #0B7A4B;
    --hero-kicker: #BFE9D0;
    --hero-tick-text: #06361B;
    --hero-text: #DCE5F4;

    /* A topic's content types, as the client's catalogue colours them: a swatch, a tint for the tag and tile, and text that keeps
       4.5:1 on the tint. */
    --type-course: #FDAB3D;
    --type-course-bg: #FFEBCC;
    --type-course-text: #9A5B00;
    --type-skill-builder: #00C875;
    --type-skill-builder-bg: #D6F5E6;
    --type-skill-builder-text: #00754A;
    --type-memory-jogger: #66CCFF;
    --type-memory-jogger-bg: #DDF1FC;
    --type-memory-jogger-text: #1B6A9E;
    --type-assessment: #037F4C;
    --type-assessment-bg: #D3EBDD;
    --type-assessment-text: #03683F;
    --type-ai-asset: #7F5347;
    --type-ai-asset-bg: #EEE4E0;
    --type-ai-asset-text: #7F5347;

    /* Colours the area files used more than once before they had a name. */
    --text-inverse: #FFFFFF;
    --text-faint: #8A97AD;
    --text-slate: #4A5368;
    --danger-text: #B42318;
    --accent-indigo: #4C6FFF;
    --black: #000000;
    --status-ok-text: #16803D;
    --status-good-text: #1C6B49;
    --status-waiting-text: #B45309;
    --status-waiting-bg: #FEF3E2;
    --status-working-text: #1D4ED8;
    --accent-blue-strong: #2563EB;
    --accent-blue-soft: #3973D0;
    --border-blue: #CFDCF3;
    --danger-border: #F1A0AA;
    --danger-border-pale: #F1C2CA;
    --amber-text: #B7791F;
    --amber-text-dark: #6B4A07;
    --amber-text-deep: #785600;
    --orange-text: #8A4B08;
    --amber-tint: #FFF8EB;
    --amber-stripe: #F4E6C0;
    --green-tint: #E5F6ED;
    --violet-tint: #F4E9FF;
    --violet-text: #62328A;
    --ai-violet: #7C3AED;
    --ai-gradient-from: #4F8BFF;
    --ai-gradient-to: #9B5CFF;
    --brand-navy: #112B6C;
    --navy-deep: #253572;
    --cover-blue: #3B74BA;
    --cover-teal: #02A484;
    --show-navy: #1E2A5A;
    --show-slate: #34406E;
    --show-yellow: #FFD25A;

    /* Form controls and the shared scrollbar. */
    --form-control-height: 34px;
    --form-control-padding: 0.35rem 0.5rem;
    --form-control-font-size: 0.84rem;
    --app-scrollbar-thumb: #b9c8dc;
    --app-scrollbar-thumb-hover: #8fa7c5;
    --app-scrollbar-track: #f4f7fc;

    /* Type scale. The studio's root size is 14px (html takes --font-regular), so 1rem is --text-base; login.css runs at the browser's 16px. */
    --text-3xs: 10px;
    --text-2xs: 11px;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 15px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 24px;
    --text-4xl: 28px;
    --text-5xl: 32px;
    --text-6xl: 40px;

    --leading-none: 1;
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.5;

    /* Spacing: 2px steps up to 16, then 4px to 32, then 8px. Named by size, for padding, margin and gap. */
    --space-2: 2px;
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-14: 14px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-28: 28px;
    --space-32: 32px;
    --space-40: 40px;
    --space-48: 48px;
    --space-56: 56px;
    --space-64: 64px;

    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --radius-2xl: 12px;
    --radius-3xl: 16px;
    --radius-4xl: 24px;
    --radius-pill: 999px;
    --radius-round: 50%;

    /* Elevation: a resting card, a raised control, a floating panel, a menu or popover, a dialog; a drawer from the side; and a
       stronger shadow for what floats over a picture or video, where a soft one does not show. */
    --shadow-xs: 0 1px 3px rgba(1, 11, 38, 0.08);
    --shadow-sm: 0 2px 8px rgba(1, 11, 38, 0.1);
    --shadow-md: 0 2px 12px rgba(1, 11, 38, 0.08);
    --shadow-lg: 0 12px 34px rgba(1, 11, 38, 0.16);
    --shadow-xl: 0 20px 60px rgba(1, 11, 38, 0.3);
    --shadow-drawer: -12px 0 40px rgba(1, 11, 38, 0.18);
    --shadow-on-media: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow: var(--shadow-md);

    /* Stacking layers, lowest first. A component's own small numbers (1-9) order its parts inside it and stay in its file. */
    --z-base: 1;
    --z-sticky: 20;
    --z-popover: 40;
    --z-header: 50;
    --z-dropdown: 60;
    --z-menu: 71;
    --z-modal: 1000;
    --z-drawer: 1050;
    --z-drawer-nested: 1070;
    --z-dialog: 1100;
    --z-busy: 1200;
    --z-overlay: 2000;
    --z-toast: 9999;

    /* Motion. Hover and press take --motion-fast, a panel or dialog coming in --motion-base, a drawer --motion-slow, a progress bar
       --motion-slower. */
    --motion-fast: 150ms;
    --motion-base: 200ms;
    --motion-slow: 320ms;
    --motion-slower: 600ms;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* One switch for reduced motion: every transition and entrance made from the tokens above becomes instant. 0.01ms rather than 0 so
   transitionend and animationend still fire for scripts that wait on them. */
@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-fast: 0.01ms;
        --motion-base: 0.01ms;
        --motion-slow: 0.01ms;
        --motion-slower: 0.01ms;
    }
}

/* Entrances shared by panels, dialogs, menus and drawers. Only transform and opacity move, never layout, and the end state is the
   element's own (fill backwards), so nothing stays transformed after the entrance and a fixed child is not trapped. */
@keyframes enter-fade {
    from { opacity: 0; }
}

@keyframes enter-rise {
    from { opacity: 0; transform: translateY(6px); }
}

@keyframes enter-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
}

@keyframes enter-from-right {
    from { transform: translateX(32px); opacity: 0; }
}
