/* =========================================================================
   Layout shells: public (PostNL), auth (co-brand), PostNL admin, Capgemini admin
   ========================================================================= */

.site-main { flex: 1 0 auto; width: 100%; }
.site-main:focus { outline: none; }

/* ---------- Public / PostNL header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line-soft); position: relative; z-index: 50; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: var(--header-h); }
.site-brand { display: inline-flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--heading); min-width: 0; }
.site-brand:hover { text-decoration: none; color: var(--heading); }
.site-brand .logo-postnl { --logo-size: 52px; }
.site-brand__divider { width: 1px; align-self: stretch; margin: 14px 2px; background: var(--line); }
.site-brand__text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.site-brand__name { font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.01em; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-brand__sub { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header__actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
@media (max-width: 419.98px) { .site-brand__sub { display: none; } .site-brand .logo-postnl { --logo-size: 44px; } }
.site-header__extra { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-muted); }
@media (max-width: 599.98px) {
  .site-header__extra { display: none; }
  .lang-toggle__label { display: none; }
  .lang-toggle__code.visually-hidden { position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: nowrap; }
}

/* ---------- Footer ---------- */
.site-footer { flex: none; margin-top: var(--sp-9); background: var(--surface); border-top: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--ink-muted); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); padding-block: var(--sp-5); }
.site-footer__meta { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.site-footer a { color: var(--ink-muted); }

/* ---------- Brand arc (PostNL-style curved line graphic; decorative only) ---------- */
.brand-arc { position: absolute; pointer-events: none; border-radius: 50%; border: 18px solid var(--brand); opacity: 1; }
.brand-arc--soft { border-color: var(--brand-tint); }

/* ---------- Hero (landing) ---------- */
.hero { position: relative; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.hero__inner { position: relative; z-index: 1; display: grid; gap: var(--sp-7); padding-block: var(--sp-8) var(--sp-9); align-items: center; }
@media (min-width: 960px) { .hero__inner { grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); padding-block: var(--sp-9) var(--sp-10); } }
.hero__title { font-size: clamp(2rem, 1.4rem + 3vw, var(--fs-4xl)); line-height: 1; letter-spacing: -0.03em; margin-bottom: var(--sp-4); }
.hero__title em { font-style: normal; color: var(--brand-mid); }
.hero__lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 56ch; margin-bottom: var(--sp-5); }
.hero__facts { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); list-style: none; padding: 0; margin: 0; color: var(--ink-2); font-weight: 600; font-size: var(--fs-sm); }
.hero__facts li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.hero__facts .icon { color: var(--brand-mid); width: 20px; height: 20px; }
.hero .brand-arc { width: 920px; height: 920px; right: -520px; top: -380px; }
.hero .brand-arc--soft { width: 560px; height: 560px; left: -380px; bottom: -420px; top: auto; right: auto; border-width: 56px; }
@media (max-width: 959.98px) { .hero .brand-arc { width: 340px; height: 340px; right: -240px; top: -250px; border-width: 10px; } .hero .brand-arc--soft { display: none; } }
.access-card { position: relative; z-index: 1; }
.access-card .card__title { font-size: var(--fs-xl); }

/* ---------- Auth layout ---------- */
.auth-body { background: var(--page-bg); }
.auth-wrap { flex: 1 0 auto; position: relative; overflow: hidden; display: grid; place-items: center; padding: var(--sp-7) var(--gutter) var(--sp-8); }
.auth-wrap .brand-arc { width: 760px; height: 760px; right: -420px; top: -420px; }
.auth-wrap .brand-arc--soft { width: 600px; height: 600px; left: -420px; bottom: -420px; top: auto; right: auto; border-width: 60px; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 460px; }
.auth-card > .card { padding: var(--sp-6); }
@media (min-width: 600px) { .auth-card > .card { padding: var(--sp-7); } }
.auth-brands { display: flex; align-items: center; justify-content: center; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.auth-brands .logo-postnl { --logo-size: 64px; }
.auth-brands .logo-capgemini { --logo-h: 26px; }
.auth-brands__x { color: var(--ink-muted); font-size: var(--fs-lg); font-weight: 300; }
.auth-title { text-align: center; font-size: var(--fs-xl); margin-bottom: var(--sp-2); }
.auth-sub { text-align: center; color: var(--ink-muted); margin-bottom: var(--sp-5); }
.auth-lang { position: absolute; top: var(--sp-4); right: var(--gutter); z-index: 2; }
.auth-foot { margin-top: var(--sp-5); text-align: center; font-size: var(--fs-sm); color: var(--ink-muted); }

/* ---------- PostNL admin ---------- */
.pn-header { position: sticky; top: 0; z-index: 60; }
.pn-header .site-header { border-bottom: 0; }
.pn-nav-row { background: var(--surface); border-bottom: 1px solid var(--line-soft); box-shadow: 0 1px 0 rgba(31,30,47,.02); }
.pn-nav { display: flex; gap: var(--sp-1); list-style: none; margin: 0; padding: 0; overflow-x: auto; }
.pn-nav__link {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: 12px 14px; font-weight: 700; color: var(--ink-2);
  text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap;
}
.pn-nav__link .icon { width: 18px; height: 18px; color: var(--ink-muted); }
.pn-nav__link:hover { color: var(--action); text-decoration: none; background: var(--surface-2); }
.pn-nav__link[aria-current="page"] { color: var(--heading); border-bottom-color: var(--brand); }
.pn-nav__link[aria-current="page"] .icon { color: var(--brand-mid); }
.user-menu { display: flex; align-items: center; gap: var(--sp-3); }
.user-menu__who { display: flex; flex-direction: column; line-height: 1.2; text-align: right; min-width: 0; }
.user-menu__name { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); white-space: nowrap; }
.user-menu__role { font-size: var(--fs-xs); color: var(--ink-muted); white-space: nowrap; }
.user-menu form { margin: 0; }
@media (max-width: 759.98px) { .user-menu__who { display: none; } .pn-header .lang-toggle__label { display: none; } }
.admin-content { padding-bottom: var(--sp-8); }

/* ---------- Capgemini admin shell ---------- */
.cg-shell { flex: 1 0 auto; display: grid; grid-template-columns: 1fr; min-height: 100vh; }
@media (min-width: 1024px) { .cg-shell { grid-template-columns: 264px minmax(0, 1fr); } }
.cg-sidebar {
  background: var(--navy); color: rgba(255,255,255,.86); display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; width: 280px; max-width: 86vw; z-index: 80; transform: translateX(-100%);
  transition: transform .25s var(--ease); overflow-y: auto;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(0,112,173,.35) 0%, rgba(0,112,173,0) 60%);
}
.cg-sidebar.is-open { transform: none; box-shadow: var(--shadow-3); }
@media (min-width: 1024px) {
  .cg-sidebar { position: sticky; top: 0; height: 100vh; width: auto; max-width: none; transform: none; }
  .cg-sidebar__close { display: none !important; }
}
.cg-scrim { position: fixed; inset: 0; background: rgba(15, 17, 23, .5); z-index: 70; }
.cg-sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-4); }
.cg-sidebar__brand a { display: inline-flex; flex-direction: column; gap: 6px; text-decoration: none; color: #fff; }
.cg-sidebar__brand .logo-capgemini { --logo-h: 26px; }
.cg-sidebar__product { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); font-weight: 500; }
.cg-sidebar__close { color: #fff; --btn-fg: #fff; }
.cg-engagement {
  margin: 0 var(--sp-4) var(--sp-4); padding: 10px 12px; border-radius: var(--r-m); background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: var(--sp-3);
}
.cg-engagement .logo-postnl { --logo-size: 34px; background: #fff; border-radius: 8px; padding: 3px; }
.cg-engagement__label { display: block; font-size: var(--fs-xs); color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .06em; }
.cg-engagement__name { display: block; font-weight: 500; color: #fff; font-size: var(--fs-sm); line-height: 1.25; }
.cg-nav { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-3); display: grid; gap: 2px; }
.cg-nav__section { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.5); padding: var(--sp-4) 12px var(--sp-1); }
.cg-nav__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-m);
  color: rgba(255,255,255,.82); text-decoration: none; font-weight: 400; position: relative;
}
.cg-nav__link .icon { width: 20px; height: 20px; opacity: .85; }
.cg-nav__link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.cg-nav__link[aria-current="page"] { background: rgba(18,171,219,.18); color: #fff; font-weight: 500; }
.cg-nav__link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--turquoise); }
.cg-nav__link[aria-current="page"] .icon { opacity: 1; color: var(--turquoise); }
.cg-nav__link:focus-visible { outline-color: var(--turquoise); }
.cg-sidebar__footer { margin-top: auto; padding: var(--sp-4) var(--sp-5); font-size: var(--fs-xs); color: rgba(255,255,255,.5); border-top: 1px solid rgba(255,255,255,.08); }
.cg-main { min-width: 0; display: flex; flex-direction: column; }
.cg-topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line-soft); min-height: 64px; display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--gutter);
}
.cg-topbar__menu { --btn-fg: var(--ink); }
@media (min-width: 1024px) { .cg-topbar__menu { display: none !important; } }
.cg-topbar__context { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.cg-topbar__context strong { color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-topbar__spacer { flex: 1; }
.cg-topbar .user-menu__name { font-weight: 500; }
.cg-content { flex: 1 0 auto; padding: 0 var(--gutter) var(--sp-8); width: 100%; max-width: 1480px; }
.cg-content .page-header { padding-top: var(--sp-6); }
@media (max-width: 599.98px) { .cg-topbar__context .cg-topbar__label { display: none; } }
.cg-footer { padding: var(--sp-4) var(--gutter); font-size: var(--fs-xs); color: var(--ink-muted); border-top: 1px solid var(--line-soft); background: var(--surface); display: flex; gap: var(--sp-4); justify-content: space-between; flex-wrap: wrap; }

/* body lock when off-canvas nav is open */
body.nav-open { overflow: hidden; }
@media (min-width: 1024px) { body.nav-open { overflow: auto; } .cg-scrim { display: none; } }
.auth-card .flash-list { margin-top: 0; }
