/* Órga glass look (D151): frosted panels over soft colour patches. The palette, the panel and tile
   classes and the fonts. Linked from base.html on every page since D159; the page frame, the
   sidebar panel, the header card and the paper surface of the other pages are in orga-shell.css.
   The `.og-page main ...` rules below are for the pages built for the glass (body class og-page:
   the dashboard, My sales, the help), which keep their content straight on the colour patches.

   Rules that keep it safe:
   - text on the panels is dark ink on a mostly opaque panel (tests/test_glass_contrast.py proves
     the 4.5:1 contrast against the lightest and darkest colour-patch stop);
   - blur is only on the few large panels (.og-glass), never on lists, tables or tiles;
   - no backdrop-filter, or reduced transparency asked for, or print: solid paper panels;
   - gold is for buttons, rings and lines, never for text (the dark golds #7A5C00 and #9A7530 are
     for the little text and lines that must be seen);
   - fonts are self-hosted (app/static/vendor/fonts), no external font service. */

@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('../vendor/fonts/outfit-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('../vendor/fonts/outfit-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('../vendor/fonts/outfit-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('../vendor/fonts/outfit-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../vendor/fonts/outfit-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../vendor/fonts/outfit-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('../vendor/fonts/lato-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('../vendor/fonts/lato-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../vendor/fonts/lato-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../vendor/fonts/lato-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Lato'; font-style: italic; font-weight: 400; font-display: swap;
    src: url('../vendor/fonts/lato-latin-ext-400-italic.woff2') format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Lato'; font-style: italic; font-weight: 400; font-display: swap;
    src: url('../vendor/fonts/lato-latin-400-italic.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
    /* Orga Warm Palette */
    --og-fern-900: #173B26;
    --og-fern-800: #1A4D2E;
    --og-fern-700: #2F6B45;
    --og-fern-500: #56966A;
    --og-fern-300: #8FB99A;
    --og-fern-100: #D5E6D9;
    --og-fern-50:  #E6F0E2;
    --og-honey-500: #C9A24A;
    --og-honey-300: #E3C77F;
    --og-honey-200: #F1DCA0;
    --og-honey-100: #F7EDD2;
    --og-gold-strong: #7A5C00;   /* gold that must be read */
    --og-gold-line:   #9A7530;   /* gold lines and chart strokes */
    --og-cream: #F6F1E4;
    --og-cream-2: #EDE6D3;
    --og-paper: #FFFCF6;
    --og-ink: #101812;
    --og-ink-2: #3E4A41;
    --og-grey-line: #8C968F;

    /* Shape */
    --og-radius-panel: 22px;
    --og-radius-tile: 16px;
    --og-radius-control: 14px;
    --og-shadow: 0 8px 24px rgba(23, 59, 38, 0.08);

    /* Glass */
    --og-glass-bg: rgba(255, 252, 246, 0.62);
    --og-glass-border: rgba(255, 255, 255, 0.7);
    --og-glass-filter: blur(18px) saturate(140%);
    --og-tile-bg: rgba(255, 255, 255, 0.5);
    --og-tile-border: rgba(255, 255, 255, 0.8);
    --og-note-bg: rgba(247, 237, 210, 0.8);      /* honey note (last month, final figures) */
    --og-note-border: rgba(227, 199, 127, 0.8);
    --og-total-bg: rgba(230, 240, 226, 0.85);    /* fern total tile */
    --og-total-border: rgba(143, 185, 154, 0.7);
    /* The shell (D159, orga-shell.css): the studio's og-glass-strong for the phone menu, the studio's
       muted green-grey (#44544E) for the Help pill, its error red, and the fern-600/20 and /40 lines. */
    --og-glass-strong-bg: rgba(255, 252, 246, 0.92);
    /* The Bootstrap cards of the pages not built for the glass (D159 addendum): the studio's strong
       paper glass, so content-dense cards keep Bootstrap's greys readable over every patch. */
    --og-card-bg: rgba(255, 252, 246, 0.92);
    --og-muted: #44544E;
    --og-error: #A8402A;
    --og-error-dark: #8C3423;
    --og-error-50: #F8E8E3;
    --og-line: rgba(47, 107, 69, 0.2);
    --og-pill-border: rgba(47, 107, 69, 0.4);
    --og-pill-bg: rgba(255, 255, 255, 0.5);
    --og-hover-bg: rgba(255, 255, 255, 0.6);

    /* The colour patches behind the glass: the studio's five patches (globals.css .og-page), in
       percentages, so they follow the page height. */
    --og-patches:
        radial-gradient(40% 50% at 0% 0%, #8FB99A 0%, rgba(143, 185, 154, 0) 70%),
        radial-gradient(35% 45% at 100% 8%, #E3C77F 0%, rgba(227, 199, 127, 0) 72%),
        radial-gradient(45% 50% at 45% 62%, #D5E6D9 0%, rgba(213, 230, 217, 0) 70%),
        radial-gradient(40% 45% at 100% 100%, #F1DCA0 0%, rgba(241, 220, 160, 0) 70%),
        radial-gradient(35% 40% at 0% 100%, #8FB99A 0%, rgba(143, 185, 154, 0) 70%);

    --og-font-heading: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --og-font-body: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---- The page: colour patches on cream (applied to <body> only on the glass pages) ---------- */
body.og-page {
    min-height: 100vh;
    background-color: var(--og-cream) !important;   /* beats Bootstrap's .bg-light */
    background-image: var(--og-patches);
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
.og-page main {
    font-family: var(--og-font-body);
    color: var(--og-ink);
}
.og-page main h1, .og-page main h2, .og-page main h3,
.og-page main h4, .og-page main h5, .og-page main h6,
.og-heading, .og-number {
    font-family: var(--og-font-heading);
}
.og-page main h1 { font-weight: 700; color: var(--og-fern-800); }
.og-page main h2, .og-page main h5.card-title { font-weight: 600; color: var(--og-fern-900); }
.og-page main h3, .og-page main h6 { font-weight: 600; color: var(--og-fern-900); }
.og-page main h6.text-muted { font-family: var(--og-font-body); font-weight: 700; }

/* Text that sits straight on the colour patches (not on a panel) is full ink. */
.og-lede, .og-page main .og-lede { color: var(--og-ink) !important; }
.og-page main .text-muted, .og-page main .text-secondary { color: var(--og-ink-2) !important; }
.og-page main .small, .og-page main small { font-weight: 400; }

/* Links on the panels: fern, not Bootstrap blue. */
.og-page main a:not(.btn):not(.og-btn-primary):not(.og-btn-outline) { color: var(--og-fern-800); }
.og-page main a:not(.btn):not(.og-btn-primary):not(.og-btn-outline):hover { color: var(--og-fern-900); }

/* Icons keep their meaning but take the palette. */
.og-page main .text-primary { color: var(--og-fern-800) !important; }
.og-page main .text-success, .og-page main .text-info { color: var(--og-fern-700) !important; }
.og-page main .text-warning { color: var(--og-gold-strong) !important; }
.og-page main .text-dark { color: var(--og-ink) !important; }

/* ---- Frosted panel ----------------------------------------------------------------------- */
.og-glass {
    background: var(--og-glass-bg);
    -webkit-backdrop-filter: var(--og-glass-filter);
    backdrop-filter: var(--og-glass-filter);
    border: 1px solid var(--og-glass-border);
    border-radius: var(--og-radius-panel);
    box-shadow: var(--og-shadow);
    color: var(--og-ink);
}
.og-glass > .card-body { padding: 1.1rem; }
.og-glass .card-header,
.og-glass .og-head {
    background: transparent;
    border-bottom: 1px solid rgba(23, 59, 38, 0.12);
    padding: 1rem 1.1rem .75rem;
}
.og-glass .card-header.og-head { border-top-left-radius: var(--og-radius-panel); border-top-right-radius: var(--og-radius-panel); }

/* Inner tiles: lighter, no blur. */
.og-tile {
    background: var(--og-tile-bg);
    border: 1px solid var(--og-tile-border);
    border-radius: var(--og-radius-tile);
    color: var(--og-ink);
}
.og-page main .card.og-tile { background: var(--og-tile-bg); border: 1px solid var(--og-tile-border) !important; box-shadow: none !important; }
a.og-tile:hover { background: rgba(255, 255, 255, 0.72); }

/* Tables inside a panel stay flat and readable. */
.og-glass .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--og-ink);
    --bs-table-border-color: rgba(23, 59, 38, 0.15);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.35);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.45);
}
.og-glass .table th { color: var(--og-fern-900); }
/* A scrolling table holds its own visually-hidden labels: without a positioned box they are placed
   against the card, outside the scroll area, and a phone page grew sideways (birthdays table). */
.og-glass .table-responsive { position: relative; }

/* ---- Controls -------------------------------------------------------------------------- */
.og-btn-primary, .og-btn-outline, .og-btn-fern {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    min-height: 44px; padding: .5rem .85rem;
    border-radius: var(--og-radius-control);
    font-family: var(--og-font-body); font-size: .875rem; font-weight: 700; line-height: 1.25;
    text-align: center; text-decoration: none;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.og-btn-primary { background: var(--og-honey-500); color: var(--og-ink); border: 1px solid var(--og-honey-500); }
.og-btn-primary:hover, .og-btn-primary:focus { background: var(--og-honey-300); border-color: var(--og-honey-300); color: var(--og-ink); }
.og-btn-outline { background: rgba(255, 255, 255, 0.45); color: var(--og-fern-800); border: 1px solid var(--og-fern-700); }
.og-btn-outline:hover, .og-btn-outline:focus { background: rgba(255, 255, 255, 0.78); color: var(--og-fern-900); border-color: var(--og-fern-800); }
.og-btn-fern { background: var(--og-fern-800); color: #fff; border: 1px solid var(--og-fern-800); }
.og-btn-fern:hover, .og-btn-fern:focus { background: var(--og-fern-900); border-color: var(--og-fern-900); color: #fff; }
.og-btn-primary:focus-visible, .og-btn-outline:focus-visible, .og-btn-fern:focus-visible {
    outline: 3px solid var(--og-fern-800); outline-offset: 2px;
}
.og-glass .form-control, .og-page main .og-field {
    min-height: 48px;
    border-radius: var(--og-radius-control);
    border: 1px solid rgba(47, 107, 69, 0.45);
    background: rgba(255, 255, 255, 0.75);
    color: var(--og-ink);
    font-family: var(--og-font-body);
}
.og-glass .input-group > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.og-glass .input-group > .btn { border-top-right-radius: var(--og-radius-control); border-bottom-right-radius: var(--og-radius-control); }
.og-glass .form-control:focus, .og-page main .og-field:focus {
    border-color: var(--og-fern-700); box-shadow: 0 0 0 .2rem rgba(47, 107, 69, 0.25);
}
.og-glass .form-label { font-weight: 700; color: var(--og-ink-2); font-size: .875rem; }
.og-page main .ms-controls .form-label { color: var(--og-ink); font-weight: 700; }

/* The main sidebar is a glass panel on every page since D159: orga-shell.css. */

/* ---- No backdrop-filter: solid paper panels ---------------------------------------------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .og-glass { background: var(--og-paper); }
    :root { --og-glass-bg: var(--og-paper); --og-glass-strong-bg: var(--og-paper); --og-card-bg: var(--og-paper); }
}

/* ---- Reduced transparency asked for: solid panels ---------------------------------------- */
@media (prefers-reduced-transparency: reduce) {
    .og-glass {
        background: var(--og-paper);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-color: rgba(23, 59, 38, 0.18);
    }
    .og-tile { background: #fff; border-color: rgba(23, 59, 38, 0.12); }
    .og-page main .card.og-tile { background: #fff; }
    :root { --og-glass-bg: var(--og-paper); --og-tile-bg: #fff; --og-glass-strong-bg: var(--og-paper); --og-card-bg: var(--og-paper); }
}

/* ---- Print: plain white, no blur (orga-shell.css hides the sidebar, the header and the footer) -- */
@media print {
    body.og-page { background: #fff !important; background-image: none !important; }
    .og-glass, .og-tile, .og-page main .card.og-tile {
        background: #fff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
