/*
 * access.css - look of the access kit pages, on Web Awesome 3 with the design system of the BAIOS Console
 * (wireframes console-regole-v06 and catalogo-pacchetti-v03): default theme, wa-page, the operator's
 * traffic light on the state roles, Wong colours with an icon and a word, dotted terms, readable motion.
 * requested_by: Giangiacomo
 * created_by: Vera
 * machine: Nerone
 * created: 2026-10-24
 * purpose: shared styles of login, account, admin and the pages of a site built on the kit.
 * modified_by: Vera, 2026-10-26 (1.5.0: top bar with a centred zone, header_center)
 * modified_by: Vera, 2026-10-26 (1.6.0: the bell with the notification log and the toasts top right)
 * modified_by: Vera, 2026-10-26 (1.10.0: the edge of the aside column is a splitter that widens or narrows it)
 * modified_by: Vera, 2026-11-12 (1.13.0: the edge of the menu is a splitter too)
 * modified_by: Vera, 2026-10-26 (1.10.1: the buttons of the notification panel keep their width, inside the panel)
 * modified_by: Vera, 2026-11-16 (1.16.0: the section switcher of the top bar, .section-trigger and .sec-ico)
 * modified_by: Vera, 2026-11-19 (1.17.0: .link-level, the level line of the page «Entra» of an access link)
 * HARDCODED: #3CB371 #FFFF00 #FF0000 : the operator's traffic light for states, as in the Console.
 * HARDCODED: #0072B2 #009E73 #E69F00 #56B4E9 #CC79A7 #D55E00 : Wong palette, readable with colour vision deficiency.
 */
:root {
  --wa-color-success-fill-loud: #3CB371;
  --wa-color-warning-fill-loud: #FFFF00;
  --wa-color-danger-fill-loud: #FF0000;
  --wa-color-success-on-loud: black;
  --wa-color-warning-on-loud: black;
  --wa-color-danger-on-loud: black;
  --wa-form-control-activated-color: var(--wa-color-neutral-fill-loud);
  --w-blue: #0072B2; --w-green: #009E73; --w-orange: #E69F00; --w-sky: #56B4E9; --w-purple: #CC79A7; --w-vermilion: #D55E00;
}
html, body { min-height: 100%; padding: 0; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--wa-color-surface-default); }
wa-page { --menu-width: 16rem; --aside-width: 0rem; }
wa-page[view='mobile'] { --menu-width: auto; }
wa-page.nonav[view='desktop'] { --menu-width: 0rem; }
wa-page.nonav[view='desktop'] [slot='navigation'], wa-page.nonav[view='desktop'] [slot='navigation-footer'] { display: none; }
/* The right column (1.9.0): in view on a wide screen, closed by its toggle, hidden on narrow screens and phones. */
wa-page.has-aside { --aside-width: var(--aside-user, 22rem); }
wa-page.noaside, wa-page.has-aside[view='mobile'] { --aside-width: 0rem; }
wa-page.noaside [slot='aside'], wa-page[view='mobile'] [slot='aside'] { display: none; }
@media (max-width: 1199px) { wa-page.has-aside { --aside-width: 0rem; } wa-page.has-aside [slot='aside'], [data-action='aside-toggle'] { display: none; } }
.app-aside { position: relative; border-inline-start: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
.aside-body { padding: var(--wa-space-m); max-block-size: calc(100dvh - 4rem); overflow: auto; box-sizing: border-box; }
/* The splitter on the left edge of the column (1.10.0): a wide invisible grip, a line that lights up on hover and focus. */
.aside-grip { position: absolute; inset-block: 0; inset-inline-start: -5px; inline-size: 10px; z-index: 2; cursor: col-resize; touch-action: none; }
.aside-grip::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 4px; inline-size: 2px; background: transparent; transition: background .15s; }
.aside-grip:hover::after, .aside-grip:focus-visible::after, .aside-grip.dragging::after { background: var(--wa-color-brand-fill-loud); }
.aside-grip:focus-visible { outline: none; }
wa-page.resizing, wa-page.resizing * { cursor: col-resize !important; user-select: none; }
/* The splitter of the menu (1.13.0): the menu takes the width chosen by the user on desktop; the grip is fixed on its edge. */
wa-page[view='desktop']:not(.nonav) { --menu-width: var(--nav-user, 16rem); }
.nav-grip { position: fixed; inline-size: 10px; z-index: 20; cursor: col-resize; touch-action: none; }
.nav-grip::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 4px; inline-size: 2px; background: transparent; transition: background .15s; }
.nav-grip:hover::after, .nav-grip:focus-visible::after, .nav-grip.dragging::after { background: var(--wa-color-brand-fill-loud); }
.nav-grip:focus-visible { outline: none; }
.nav-grip[hidden] { display: none; }
.panel-btn[aria-pressed='false']::part(base) { opacity: .55; }

.nowrap { flex-wrap: nowrap; }
.mono, code { font-family: var(--wa-font-family-code); }
code { font-size: 0.9em; background: var(--wa-color-neutral-fill-quiet); padding: 0 0.3em; border-radius: var(--wa-border-radius-s); overflow-wrap: anywhere; }
.quiet { color: var(--wa-color-text-quiet); }
.app-header { padding-block: var(--wa-space-s); padding-inline: var(--wa-space-l); border-block-end: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
/* A top bar with a centred zone (header_center): three columns, the middle one centred on the page. */
.app-header:has(.app-header-center) { display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, 36rem) minmax(max-content, 1fr); align-items: center; gap: var(--wa-space-m); }
.app-header-center { display: flex; align-items: center; gap: var(--wa-space-s); min-inline-size: 0; }
.app-header-center .search { flex: 1 1 auto; inline-size: auto; max-inline-size: none; min-inline-size: 0; }
.app-header-end { justify-self: end; }
/* Icon buttons of the bar as one group, 2px apart, all the same square size (1.8.0). */
.header-icons { display: flex; align-items: center; gap: var(--wa-space-3xs); }
.header-icons wa-button::part(base) { inline-size: 2.25rem; padding-inline: 0; justify-content: center; }
.header-icons wa-button[aria-pressed='true']::part(base) { color: var(--wa-color-brand-on-quiet); background: var(--wa-color-brand-fill-quiet); }
.notif-count[hidden] { display: none; }
.brand { font-weight: var(--wa-font-weight-bold); font-size: var(--wa-font-size-l); color: inherit; text-decoration: none; }
.brand wa-icon { color: var(--wa-color-brand-fill-loud); }
/* 1.16.0: the section switcher of the top bar, as the brand (variant B of the unified portal). */
.section-trigger::part(base) { font-weight: var(--wa-font-weight-bold); font-size: var(--wa-font-size-l); padding-inline: var(--wa-space-xs); }
.sec-ico { inline-size: 1.6em; block-size: 1.6em; border-radius: var(--wa-border-radius-s); display: inline-flex; align-items: center; justify-content: center;
  background: var(--sec, var(--wa-color-brand-fill-loud)); color: var(--sec-on, white); font-size: 0.8em; }
.sec-ico wa-icon { color: inherit; }
#sectionMenu wa-dropdown-item[aria-current='page'] { font-weight: var(--wa-font-weight-bold); }
wa-page[view='mobile'] .app-header:has(.app-header-center) .section-trigger .brand-name { display: none; }
.brand small { font-weight: var(--wa-font-weight-normal); font-size: var(--wa-font-size-s); color: var(--wa-color-text-quiet); }
.search { inline-size: 24rem; max-inline-size: 36vw; }

/* A term that needs explaining is underlined with dots (console.explain); its title says what it means. */
.term { text-decoration: underline dotted; text-decoration-color: var(--wa-color-text-quiet); text-underline-offset: 0.2em; cursor: help; }

/* Navigation, as in the Console */
.side-nav { padding: var(--wa-space-m); }
.side-nav a { color: var(--wa-color-text-normal); text-decoration: none; padding-block: var(--wa-space-2xs); padding-inline: var(--wa-space-s); border-radius: var(--wa-border-radius-m); flex: 1 1 auto; min-inline-size: 0; }
.side-nav > a { flex: 0 0 auto; } /* a column of links: no stretching to the menu height */
.side-nav a:hover { background-color: var(--wa-color-neutral-fill-quiet); }
.side-nav a[aria-current='page'] { background-color: var(--wa-color-brand-fill-quiet); color: var(--wa-color-brand-on-quiet); font-weight: var(--wa-font-weight-semibold); }
.side-nav .count { margin-inline-start: auto; font-family: var(--wa-font-family-code); font-size: var(--wa-font-size-xs); color: var(--wa-color-text-quiet); }
.group-h { display: flex; align-items: center; gap: var(--wa-space-xs); font-size: var(--wa-font-size-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--wa-color-text-quiet); margin: var(--wa-space-m) 0 var(--wa-space-xs); }
.group-h::after { content: ""; flex: 1; border-block-start: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
.nav-foot { padding: var(--wa-space-m); border-block-start: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
.foot-facts { font-family: var(--wa-font-family-code); font-size: var(--wa-font-size-xs); color: var(--wa-color-text-quiet); }
/* 1.12.0: a newer Varco in the catalog, shown to the admins with an icon and words, never the colour alone */
.foot-facts .kit-behind { color: var(--wa-color-warning-on-quiet); font-weight: var(--wa-font-weight-semibold); white-space: nowrap; }

#main { padding: var(--wa-space-xl); min-inline-size: 0; }
#main p { margin: 0; }
.lede { color: var(--wa-color-text-quiet); }
h1.page-title { margin: 0; }
h2.sec { margin: 0; font-size: var(--wa-font-size-l); display: flex; align-items: center; gap: var(--wa-space-xs); }
.panel { background: var(--wa-color-surface-raised); border: var(--wa-border-width-s) solid var(--wa-color-surface-border); border-radius: var(--wa-border-radius-m); padding: var(--wa-space-l); }
.scroll-x { overflow-x: auto; }

/* States: traffic light plus a distinct glyph and word */
.st { display: inline-flex; align-items: center; gap: var(--wa-space-2xs); font-size: var(--wa-font-size-xs); font-weight: var(--wa-font-weight-semibold); white-space: nowrap; }
.st .dot { display: inline-flex; align-items: center; justify-content: center; inline-size: 1.25rem; block-size: 1.25rem; border-radius: var(--wa-border-radius-circle); font-size: var(--wa-font-size-2xs); flex: none; }
.st.ok .dot { background: var(--wa-color-success-fill-loud); color: var(--wa-color-success-on-loud); }
.st.wait .dot { background: var(--wa-color-warning-fill-loud); color: var(--wa-color-warning-on-loud); border-radius: var(--wa-border-radius-s); }
.st.off .dot { background: var(--wa-color-danger-fill-loud); color: var(--wa-color-danger-on-loud); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.st.off .word { text-decoration: line-through; }
.st.none .dot { background: transparent; border: 2px dashed var(--wa-color-neutral-border-loud); color: var(--wa-color-text-normal); }
.role { display: inline-flex; align-items: center; gap: var(--wa-space-2xs); font-size: var(--wa-font-size-xs); font-weight: var(--wa-font-weight-semibold); border: var(--wa-border-width-s) solid var(--wa-color-neutral-border-loud); border-radius: var(--wa-border-radius-s); padding: 0 var(--wa-space-2xs); white-space: nowrap; }
.way { display: inline-flex; align-items: center; gap: var(--wa-space-2xs); font-size: var(--wa-font-size-xs); white-space: nowrap; }

/* Tables and lists of the account and admin pages */
table.grid { inline-size: 100%; border-collapse: collapse; font-size: var(--wa-font-size-s); }
table.grid th, table.grid td { text-align: start; padding: var(--wa-space-xs); border-block-end: var(--wa-border-width-s) solid var(--wa-color-surface-border); vertical-align: middle; }
table.grid th { font-size: var(--wa-font-size-xs); color: var(--wa-color-text-quiet); font-weight: var(--wa-font-weight-normal); }
table.grid td.nowrap { white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--wa-space-m); align-items: end; }
.form-grid wa-input, .form-grid wa-select { inline-size: 100%; }
.locked { display: grid; justify-items: start; gap: var(--wa-space-m); }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; font-size: var(--wa-font-size-s); }
.log-list li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--wa-space-xs); align-items: baseline; padding: var(--wa-space-xs) 0; border-block-end: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
.log-list .t { font-family: var(--wa-font-family-code); font-size: var(--wa-font-size-xs); color: var(--wa-color-text-quiet); }

/* The way in: a page of its own, centred */
body.login-page { min-height: 100vh; display: grid; place-items: start center; padding: var(--wa-space-2xl) var(--wa-space-m); box-sizing: border-box; background: var(--wa-color-surface-lowered, var(--wa-color-neutral-fill-quiet)); }
.login-box { display: grid; gap: var(--wa-space-m); padding: var(--wa-space-xl); inline-size: min(28rem, 100%); box-sizing: border-box; background: var(--wa-color-surface-raised); border: var(--wa-border-width-s) solid var(--wa-color-surface-border); border-radius: var(--wa-border-radius-l); box-shadow: var(--wa-shadow-m); }
.login-box h1 { margin: 0; font-size: var(--wa-font-size-xl); }
.login-box p { margin: 0; }
.login-box form { display: grid; gap: var(--wa-space-m); }
/* 1.10.2: one column that never grows past the box. A grid track sized `auto` takes the min-content width of its
   widest child; Safari counts the inner width of a wa-input (the code field, large letters spaced out) and the whole
   column spilled out of the box, while Chromium does not (session 0143N, point 32). */
.login-box, .login-box form { grid-template-columns: minmax(0, 1fr); }
.login-box > *, .login-box form > * { min-inline-size: 0; }
.login-box wa-input { inline-size: 100%; }
.gate-steps { display: flex; gap: var(--wa-space-2xs); list-style: none; margin: 0; padding: 0; font-size: var(--wa-font-size-2xs); color: var(--wa-color-text-quiet); }
.gate-steps li { flex: 1; padding-block-start: var(--wa-space-2xs); border-block-start: 3px solid var(--wa-color-surface-border); }
.gate-steps li.done { border-color: var(--wa-color-brand-fill-loud); }
.gate-steps li.now { border-color: var(--wa-color-brand-fill-loud); border-block-start-style: double; border-block-start-width: 4px; color: var(--wa-color-text-normal); font-weight: var(--wa-font-weight-semibold); }
.code-in::part(input) { font-family: var(--wa-font-family-code); font-size: var(--wa-font-size-xl); letter-spacing: 0.3em; text-align: center; }
.rules { margin: 0; padding-inline-start: 1.1rem; font-size: var(--wa-font-size-s); color: var(--wa-color-text-quiet); display: grid; gap: var(--wa-space-3xs); }

/* A touch of readable motion; nothing moves for who asked for less motion. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.anim { animation: rise 0.32s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(min(var(--i, 0), 14) * 28ms); }
@media (prefers-reduced-motion: reduce) { .anim { animation: none; } }

/* Phone width: 16px gutter, no sideways scroll */
wa-page[view='mobile'] #main { padding: var(--wa-space-m); }
wa-page[view='mobile'] .app-header { flex-wrap: wrap; padding-inline: var(--wa-space-m); }
wa-page[view='mobile'] .app-header:has(.app-header-center) { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--wa-space-s) var(--wa-space-2xs); }
wa-page[view='mobile'] .app-header-center { order: 3; flex: 1 1 100%; }
wa-page[view='mobile'] .app-header:has(.app-header-center) #accountMenu wa-button > span { display: none; } /* the icon is enough: brand and menus stay on one row */
wa-page[view='mobile'] .app-header:has(#notif):has(.app-header-center) .brand-name { display: none; } /* with the bell too, the brand keeps only its icon */
wa-page[view='mobile'] .search { flex: 1 1 auto; inline-size: auto; max-inline-size: none; min-inline-size: 0; }
wa-page[view='mobile'] .brand small { display: none; }
wa-page[view='mobile'] .panel { padding: var(--wa-space-m); }
code.token { word-break: break-all; font-size: var(--wa-font-size-s); }
/* 1.17.0: the level of an access link on the page «Entra»: the icon stays beside the text, also on a phone. */
.login-box .link-level { display: flex; flex-wrap: nowrap; align-items: baseline; gap: var(--wa-space-xs); }
.login-box .link-level > span { min-inline-size: 0; }

/* Notifications (1.6.0): the bell before the theme menu and its panel; unread means orange, solid bell and the number. */
.notif-wrap { position: relative; }
#notif-btn.unread, #notif-btn.unread::part(base) { color: var(--wa-color-warning-on-quiet); }
#notif-btn.unread wa-icon { animation: ring 1.2s ease-in-out 1; transform-origin: 50% 10%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.notif-count { margin-inline-start: 1px; font-size: 11px; font-weight: var(--wa-font-weight-bold); text-decoration: none; color: var(--wa-color-warning-on-quiet); }
.notif-panel { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + var(--wa-space-xs)); z-index: 50; inline-size: min(24rem, calc(100vw - 2rem));
  max-block-size: min(32rem, 75vh); display: flex; flex-direction: column; background: var(--wa-color-surface-raised);
  border: var(--wa-border-width-s) solid var(--wa-color-surface-border); border-radius: var(--wa-border-radius-l); box-shadow: var(--wa-shadow-l); }
.notif-panel[hidden] { display: none; }
/* The panel sits inside the icon group of the bar: its buttons with words must not take the square size of the icons. */
.header-icons .notif-panel wa-button::part(base) { inline-size: auto; padding-inline: var(--wa-space-s); }
wa-page[view='mobile'] .notif-panel { position: fixed; inset-inline: var(--wa-space-m); inset-block-start: 3.5rem; inline-size: auto; } /* a phone: the full width, under the bar */
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: var(--wa-space-s); padding: var(--wa-space-s) var(--wa-space-m); border-block-end: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
.notif-intro { margin: 0; padding: var(--wa-space-xs) var(--wa-space-m); font-size: var(--wa-font-size-xs); color: var(--wa-color-text-quiet); }
.notif-list { list-style: none; margin: 0; padding: 0 var(--wa-space-s) var(--wa-space-s); overflow-y: auto; display: grid; gap: var(--wa-space-2xs); }
.notif-list li { margin: 0; }
.notif-item { inline-size: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px var(--wa-space-s); align-items: start; padding: var(--wa-space-xs) var(--wa-space-s);
  text-align: start; font: inherit; font-size: var(--wa-font-size-s); color: var(--wa-color-text-normal); background: transparent; cursor: pointer;
  border: var(--wa-border-width-s) solid var(--wa-color-neutral-border-quiet); border-radius: var(--wa-border-radius-m);
  block-size: auto; min-block-size: 0; white-space: normal; line-height: var(--wa-line-height-normal); justify-content: stretch; }
.notif-item:hover { border-color: var(--wa-color-neutral-border-loud); }
.notif-item:focus-visible { outline: var(--wa-focus-ring); outline-offset: 2px; }
.notif-item.unread { border-color: var(--wa-color-warning-border-loud); border-inline-start-width: 4px; font-weight: var(--wa-font-weight-semibold); }
.notif-item .st { grid-row: span 2; }
.notif-when { grid-column: 2; font-family: var(--wa-font-family-code); font-size: var(--wa-font-size-2xs); font-weight: var(--wa-font-weight-normal); color: var(--wa-color-text-quiet); }
.notif-empty { margin: 0; padding: var(--wa-space-m); text-align: center; font-size: var(--wa-font-size-s); color: var(--wa-color-text-quiet); }
.notif-empty[hidden] { display: none; }
.notif-foot { display: flex; justify-content: flex-end; padding: var(--wa-space-xs) var(--wa-space-s); border-block-start: var(--wa-border-width-s) solid var(--wa-color-surface-border); }
.st.info .dot { background: var(--wa-color-brand-fill-loud); color: var(--wa-color-brand-on-loud); border-radius: var(--wa-border-radius-s); transform: rotate(45deg); }
.st.info .dot wa-icon { transform: rotate(-45deg); }
/* Toasts top right: in from the right, out with a fade; nothing slides for who asked for less motion. */
.toast-stack { position: fixed; inset-block-start: calc(var(--wa-space-m) + 3rem); /* under the top bar: bell and account stay in sight */ inset-inline-end: var(--wa-space-m); z-index: 1000; display: grid; gap: var(--wa-space-xs);
  inline-size: min(22rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { pointer-events: auto; position: relative; display: grid; grid-template-columns: auto 1fr; gap: var(--wa-space-s); align-items: center;
  padding: var(--wa-space-s) 2.25rem var(--wa-space-s) var(--wa-space-m); font-size: var(--wa-font-size-s); color: var(--wa-color-text-normal);
  background: var(--wa-color-surface-raised); border: var(--wa-border-width-s) solid var(--wa-color-surface-border); border-radius: var(--wa-border-radius-l);
  box-shadow: var(--wa-shadow-l); opacity: 0; transform: translateX(calc(100% + var(--wa-space-m))); transition: transform .35s cubic-bezier(.2, .7, .2, 1), opacity .35s; }
.toast.in { opacity: 1; transform: none; }
.toast.out { opacity: 0; transform: none; transition: opacity .4s ease; }
.toast-x { position: absolute; inset-block-start: var(--wa-space-2xs); inset-inline-end: var(--wa-space-2xs); display: grid; place-items: center;
  inline-size: 1.6rem; block-size: 1.6rem; min-block-size: 0; padding: 0; border: 0; border-radius: var(--wa-border-radius-s); background: transparent; color: var(--wa-color-text-quiet); cursor: pointer; font-size: var(--wa-font-size-xs); }
.toast-x:hover { background: var(--wa-color-neutral-fill-quiet); color: var(--wa-color-text-normal); }
.toast-x:focus-visible { outline: var(--wa-focus-ring); }
@media (prefers-reduced-motion: reduce) { .toast { transform: none; transition: opacity .2s; } #notif-btn.unread wa-icon { animation: none; } }

/* accFacets (1.14.0): the number of results beside a filter value, quiet, and readable on a chosen chip. */
.fcount { font-size: var(--wa-font-size-2xs, .7rem); font-variant-numeric: tabular-nums; opacity: .65; margin-inline-start: .15em; }
[aria-pressed="true"] > .fcount { opacity: .9; }

/* «Coming soon» mode (1.18.0): the logo of the site above the sign-in form, nothing else on the page. */
body.soon-page { place-items: center; }
.soon-page .login-box { text-align: center; justify-items: stretch; }
.soon-logo { display: grid; place-items: center; padding-block: var(--wa-space-s); }
.soon-logo img { inline-size: min(17rem, 80%); block-size: auto; }
.soon-logo .soon-dark { display: none; }
.wa-dark .soon-logo .soon-light { display: none; }
.wa-dark .soon-logo .soon-dark { display: block; }
.soon-page .login-box form { text-align: start; }
