/* Espresso Glass: the two glass levels in one place (Macky, 24 Nov 2026: "all pop ups: frosted glass. all main cards
   on the pages: real glass webgl"). LOOK ONLY: no words, markup or behaviour change.

   PART 1  LEVEL 2, FROSTED GLASS, on every pop-up: blur + saturate behind a translucent warm-dark fill, thin cream rim,
           inner top highlight, soft shadow. One recipe (the --gp-* values below) used by every pop-up panel.
   PART 2  companions for LEVEL 1, REAL GLASS (static/eg/real-glass.js), on the one main card of a page.

   Rules kept:
   - never glass on glass: a pop-up over the page gets a dim layer strong enough to separate it; small lists and
     tooltips that open INSIDE a card stay solid (.egs-list, .mtp-tip);
   - a frosted panel cannot sit inside a blurred parent (it would have nothing to blur), so the dim layer's own soft
     blur moves to its ::before and the header's blur moves to .hd::before. Same look, and the panel in front can frost;
   - form fields inside pop-ups are solid enough to read and keep a visible focus ring;
   - fallbacks, set ONCE at the bottom of part 1: "reduce transparency" on the device, or a browser without
     backdrop-filter -> solid leather #251811.
   The site message box (rpgNotify / rpgConfirm) carries the same recipe in its own file, components/branded_notify.html,
   because it is also used on pages that do not load this file. */

/* ---------- the frosted recipe ---------- */
:root{
  --gp-fill:linear-gradient(180deg,rgba(52,33,23,.60) 0%,rgba(30,20,15,.62) 44%,rgba(21,14,11,.68) 100%);
  --gp-fill-deep:linear-gradient(180deg,rgba(50,32,22,.66) 0%,rgba(28,19,14,.70) 44%,rgba(20,13,10,.74) 100%); /* long text, or a cream page behind */
  --gp-blur:blur(28px) saturate(1.6) brightness(1.32);
  --gp-blur-flat:blur(28px) saturate(1.4);   /* same frost, nothing behind is brightened (cookie bar: no dim layer under it) */
  --gp-rim:rgba(241,221,191,.22);
  --gp-shadow:0 30px 80px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,240,220,.16);
  --gp-dim:rgba(9,7,6,.6);
  --gp-dim-blur:blur(5px);
  --gp-field:rgba(12,8,6,.58);
  --gp-solid:#251811;
}
/* cream article pages: the page behind is light, so the dark panel is deeper and the backdrop is dimmed, not lifted */
body.eg-cream{
  --gp-fill:linear-gradient(180deg,rgba(48,31,22,.8) 0%,rgba(28,19,14,.84) 44%,rgba(20,13,10,.88) 100%);
  --gp-fill-deep:linear-gradient(180deg,rgba(48,31,22,.8) 0%,rgba(28,19,14,.84) 44%,rgba(20,13,10,.88) 100%);
  --gp-blur:blur(28px) saturate(1.3) brightness(.6);
}
/* customer app pages have a light and a dark theme (html[data-theme]): frost the theme's own panel colour so the
   words keep their contrast in both */
@supports (background:color-mix(in srgb,red 50%,transparent)){
  html[data-theme]{
    --gp-fill:color-mix(in srgb,var(--rg-panel,#3A2418) 74%,transparent);
    --gp-fill-deep:color-mix(in srgb,var(--rg-panel,#3A2418) 82%,transparent);
    --gp-blur:blur(28px) saturate(1.4);
    --gp-rim:var(--rg-glass-border,rgba(241,221,191,.22));
    --gp-shadow:var(--rg-shadow-dialog,0 30px 80px rgba(0,0,0,.55));
  }
}
@supports not (background:color-mix(in srgb,red 50%,transparent)){
  html[data-theme]{--gp-fill:var(--rg-panel,#3A2418);--gp-fill-deep:var(--rg-panel,#3A2418);--gp-blur:none;--gp-rim:var(--rg-glass-border,rgba(241,221,191,.22))}
}

/* =====================================================================
   PART 1. POP-UPS
   ===================================================================== */

/* ---------- 1a. the panels ---------- */
:is(#rpg-lead-popup-card,
    #rpg-news-toast,
    #rpg-cookie-banner,
    #rpg-consent-modal > div,
    #paddle-activating-banner,
    #dp-overlay #dp-panel-container,
    dialog.mt-pop:not(#gp),
    dialog.mtp-dlg:not(#gp),
    #rpgDrawer.rpg-drawer,
    .rpg-nav .rpg-nav-dropdown-menu:not(#gp)){
  background:var(--gp-fill)!important;
  -webkit-backdrop-filter:var(--gp-blur)!important;
  backdrop-filter:var(--gp-blur)!important;
  border:1px solid var(--gp-rim)!important;
  box-shadow:var(--gp-shadow)!important;
}
/* long reading text, forms, or a pop-up that can sit on the cream article page: the darker fill */
:is(#rpg-lead-popup-card,
    #rpg-news-toast,
    #rpg-consent-modal > div,
    #dp-overlay #dp-panel-container,
    dialog.mt-pop:not(#gp),
    dialog.mtp-dlg:not(#gp),
    #rpgDrawer.rpg-drawer){
  background:var(--gp-fill-deep)!important;
}
/* edge-docked panels keep their own edges */
/* (the panel list above is as strong as two ids, so these two are written stronger still) */
html body #rpg-cookie-banner:not(#gp):not(#gq){border-width:1px 0 0!important;box-shadow:0 -18px 50px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,240,220,.14)!important}
html body #rpgDrawer.rpg-drawer:not(#gp):not(#gq){border-width:0 0 0 1px!important}
/* cookie bar and Cookie Preferences on pages without the app's light / dark theme: the bar has no dim layer under it,
   so it takes the deeper fill and does not brighten what is behind; the small grey words are lifted so they pass
   contrast on glass. Colour only. */
html:not([data-theme]) body #rpg-cookie-banner:not(#gp):not(#gq){background:var(--gp-fill-deep)!important;-webkit-backdrop-filter:var(--gp-blur-flat)!important;backdrop-filter:var(--gp-blur-flat)!important}
html:not([data-theme]) :is(#rpg-cookie-banner p,#rpg-cookie-banner button[onclick*="Decline"]){color:#CDBDAE!important}
html:not([data-theme]) #rpg-cookie-banner button[onclick*="Decline"]:hover{color:#D9AE7E!important}
html:not([data-theme]) :is(#rpg-consent-modal p,.rpg-cm-info small,#rpg-consent-modal button[onclick*="rpgCloseModal"]){color:#BBA99A!important}

/* ---------- 1b. dim layers: strong enough that the pop-up never reads as glass on glass; their soft blur lives on
   ::before so the panel in front can frost ---------- */
#rpg-lead-popup-overlay{opacity:1!important;background:rgba(9,7,6,0)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;transition:background-color .45s cubic-bezier(.22,1,.36,1)!important}
#rpg-lead-popup-overlay.rpg-on{background:var(--gp-dim)!important}
#rpg-lead-popup-overlay::before,
#dp-overlay::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;-webkit-backdrop-filter:var(--gp-dim-blur);backdrop-filter:var(--gp-dim-blur)}
#rpg-lead-popup-overlay::before{opacity:0;transition:opacity .45s cubic-bezier(.22,1,.36,1)}
#rpg-lead-popup-overlay.rpg-on::before{opacity:1}
/* the card's entry keeps its rise and fade; the blur-in is dropped (a filter on the card would switch its frost off) */
#rpg-lead-popup-card{filter:none!important}
html:not([data-theme]) #rpg-consent-modal{background:var(--gp-dim)!important}
html body #dp-overlay.dp-overlay{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html:not([data-theme]) body #dp-overlay.dp-overlay{background:var(--gp-dim)!important}
dialog.mt-pop:not(#gp)::backdrop,dialog.mtp-dlg:not(#gp)::backdrop{background:rgba(7,5,4,.62);-webkit-backdrop-filter:var(--gp-dim-blur);backdrop-filter:var(--gp-dim-blur)}
.rpg-drawer-overlay{background:rgba(9,7,6,.6)!important}

/* ---------- 1c. lead pop-up + newsletter box: fields stay readable, focus stays visible ---------- */
#rpg-lead-popup-card .rpg-grid input,#rpg-news-toast #rpg-news-email{background:var(--gp-field)!important;border-color:rgba(217,174,126,.36)!important;color:#F4ECE2!important}
#rpg-lead-popup-card .rpg-grid input::placeholder,#rpg-news-toast #rpg-news-email::placeholder{color:#BBA99A!important}
#rpg-lead-popup-card .rpg-grid input:focus,#rpg-news-toast #rpg-news-email:focus{border-color:#E2BE92!important;box-shadow:0 0 0 3px rgba(226,190,146,.3)!important}
#rpg-lead-popup-card :is(button,a,summary,input[type=checkbox]):focus-visible,#rpg-news-toast :is(button,a):focus-visible{outline:2px solid #E2BE92;outline-offset:2px}
/* headings keep the light ink on every page (the cream article theme was turning them dark on the dark panel) */
#rpg-lead-popup-card :is(h2,h3),#rpg-news-toast h3{color:#F4ECE2!important}
#rpg-lead-popup-card h2 em{color:#E2BE92!important}
#rpg-lead-popup-card .rpg-sub,#rpg-news-toast p{color:#CDBDAE!important}
#rpg-lead-popup-card .rpg-privacy,#rpg-lead-popup-card .rpg-skip,#rpg-news-toast #rpg-news-msg{color:#BBA99A!important}

/* ---------- 1d. NOT restyled here, on purpose: the chat panel (components/chat_widget.html). It is headed "Maki" and
   sits with the Maki voice launcher, and Maki is not to be touched without Macky's word. It keeps its own look. ---------- */

/* ---------- 1e. header menus. The header's own glass moves to .hd::before (same blur), so its menu can frost.
   The WHOLE glass layer moves: the header keeps its fill value but paints it at zero size, and ::before paints that
   same fill (inherit) with the top highlight, so the blur only ever touches the page behind, never the header's own
   colour (which would shift its tint). Solid fallback colours still paint on the header itself. ---------- */
.hd:not(#gp){-webkit-backdrop-filter:none!important;backdrop-filter:none!important;background-size:0 0!important;background-repeat:no-repeat!important}
.hd:not(#gp)::before{content:""!important;display:block!important;position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:inherit!important;background-size:auto!important;background-repeat:repeat!important;box-shadow:inset 0 1px 0 rgba(255,245,224,.15);-webkit-backdrop-filter:blur(30px) saturate(1.75);backdrop-filter:blur(30px) saturate(1.75)}
body.eg-cream .hd:not(#gp)::before{box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.hd:not(#gp) .dd-menu{background:var(--gp-fill-deep)!important;-webkit-backdrop-filter:var(--gp-blur)!important;backdrop-filter:var(--gp-blur)!important;border:1px solid var(--gp-rim)!important;box-shadow:0 30px 70px -20px rgba(0,0,0,.85),inset 0 1px 0 rgba(255,240,220,.16)!important}
/* cream (article) header: the menu is the same dark frosted panel (its links were already the light menu ink, which
   could not be read on the old cream panel); the current page is gold */
body.eg-cream .hd:not(#gp) .dd-menu a{color:#E9DFD3!important}
body.eg-cream .hd:not(#gp) .dd-menu a[aria-current]{color:#E2BE92!important}
body.eg-cream .hd:not(#gp) .dd-menu a:is(:hover,:focus-visible){background:rgba(255,236,210,.1)!important;color:#FFF6EA!important}
body.eg-cream .hd:not(#gp) .dd-menu .dd-sep{background:rgba(241,221,191,.14)}
/* phone menu sheet = part of the header glass (no second layer): the header fill deepens while it is open so about
   sixteen links stay readable over a busy hero film */
body.eg:not(.eg-cream) .hd:not(#gp):has(#mnav:not([hidden])){background-image:linear-gradient(180deg,rgba(40,27,20,.8),rgba(22,15,11,.86))!important}
body.eg:not(.eg-cream) .hd:not(#gp) #mnav{background:transparent!important}
body.eg-cream .hd:not(#gp):has(#mnav:not([hidden])){background-image:linear-gradient(180deg,rgba(255,253,249,.9),rgba(246,239,229,.9))!important}
body.eg-cream .hd:not(#gp) #mnav{background:transparent!important}
/* old-frame menu bar is 97% solid already; its blur comes off so the old Services menu can frost */
.rpg-nav:not(#gp){-webkit-backdrop-filter:none!important;backdrop-filter:none!important}

/* ---------- 1f. website sample viewer: the full-screen sheet IS the frosted layer; its toolbar is a plain bar on it
   (was a second glass card on glass); the sample itself stays a solid page ---------- */
html body .pfv:not(#gp){background:rgba(16,10,8,.66)!important;-webkit-backdrop-filter:blur(26px) saturate(1.4)!important;backdrop-filter:blur(26px) saturate(1.4)!important}
html body .pfv:not(#gp) .pfv-top{background:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;border:0!important;border-bottom:1px solid rgba(241,221,191,.14)!important;border-radius:0!important;box-shadow:none!important;margin-bottom:14px}

/* ---------- 1g. dialogs with reading text: solid close button, visible focus ---------- */
dialog.mt-pop:not(#gp) .mt-pop-x,dialog.mtp-dlg:not(#gp) .mtp-x{background:#1B120E!important}
dialog.mt-pop:not(#gp) p,dialog.mtp-dlg:not(#gp) .mtp-dlg-body p{color:#E6D9CB}
#paddle-activating-banner{color:#F4ECE2!important}

/* ---------- 1h. FALLBACKS for every pop-up above (one place) ---------- */
@media (prefers-reduced-transparency:reduce){
  :root,body.eg-cream{--gp-fill:#251811;--gp-fill-deep:#251811;--gp-blur:none;--gp-blur-flat:none;--gp-dim:rgba(9,7,6,.88);--gp-dim-blur:none;--gp-field:#16110D}
  html[data-theme]{--gp-fill:var(--rg-panel,#3A2418);--gp-fill-deep:var(--rg-panel,#3A2418);--gp-blur:none}
  html body .pfv:not(#gp){background:rgba(16,10,8,.96)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
  .hd:not(#gp)::before{-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}
  body.eg:not(.eg-cream) .hd:not(#gp){background:#251811!important}
  body.eg-cream .hd:not(#gp){background:#FFFDF9!important}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  :root,body.eg-cream{--gp-fill:#251811;--gp-fill-deep:#251811;--gp-dim:rgba(9,7,6,.84);--gp-field:#16110D}
  html[data-theme]{--gp-fill:var(--rg-panel,#3A2418);--gp-fill-deep:var(--rg-panel,#3A2418)}
  html body .pfv:not(#gp){background:rgba(16,10,8,.96)!important}
  body.eg:not(.eg-cream) .hd:not(#gp){background:rgba(37,24,17,.97)!important}
  body.eg-cream .hd:not(#gp){background:rgba(255,253,249,.97)!important}
}

/* =====================================================================
   PART 2. REAL GLASS companions (real-glass.js adds .rg-on to the one main card it turns into WebGL glass)
   ===================================================================== */
/* a form on real glass: fields get a solid dark fill and a clear focus ring (as on the Website Audit start card) */
.rg-on :is(input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),select,textarea,.egs-btn){background:rgba(9,7,6,.6)!important;border-color:rgba(241,221,191,.3)!important}
.rg-on :is(input,select,textarea,.egs-btn):focus-visible{outline:2px solid #E2BE92!important;outline-offset:2px}
.rg-on > .rg-glc{display:block}
/* small tiles inside a real-glass card must not be a second sheet of glass */
.rg-on.stats .stat{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
/* "reduce transparency": real-glass.js stays off and the main card is solid leather */
@media (prefers-reduced-transparency:reduce){
  html body.eg:not(.eg-cream) :is(.hv1-ws,.pdf-hero-card,.mtf,.h4-qa,.ap-spcard,[data-real-glass],#contactForm.glass,.m2-qa,.s2-qa):not(#gp){background:#251811!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
}
