/* =========================================================================
   components.css : proposal bar, header, portal launcher, buttons, cards,
   portal tiles, notices, forms, footer.
   ========================================================================= */

/* --- Proposal chrome, De Bouana ------------------------------------- */
.proposal-bar {
  background: linear-gradient(90deg, var(--db-blue) 0%, #2438d6 55%, var(--db-green) 100%);
  color: #fff;
  font-size: var(--fs-sm);
  line-height: 1.45;
}
.proposal-bar[hidden] { display: none; }
.proposal-bar .wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-block: var(--sp-2);
}
.proposal-bar p { margin: 0; }
.proposal-bar strong { letter-spacing: 0.02em; }
.proposal-bar a { color: #fff; font-weight: 600; }
.proposal-bar a:hover { color: var(--sage-100); }
.proposal-bar__close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.proposal-bar__close:hover { background: rgba(255, 255, 255, 0.3); }

/* --- Header ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line-200);
}

.utility-bar {
  background: var(--navy-900);
  color: #C9D6E4;
  font-size: var(--fs-xs);
}
.utility-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  min-height: 38px;
  padding-block: var(--sp-1);
}
.utility-bar a { color: #C9D6E4; text-decoration: none; }
.utility-bar a:hover { color: #fff; text-decoration: underline; }
.utility-links, .utility-right, .social-list {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: 0; padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.utility-links li, .utility-right > *, .social-list li { margin: 0; }
.utility-links a[aria-current="true"] { color: #fff; font-weight: 600; }

.social-list { gap: var(--sp-3); }
.social-list a {
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.social-list a:hover { background: var(--sage-500); }
.social-list svg { width: 12px; height: 12px; fill: currentColor; }

.lang-switch { display: flex; gap: 2px; align-items: center; }
.lang-switch a {
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lang-switch a[aria-current="true"] { background: var(--sage-500); color: var(--navy-900); }
.lang-switch a[aria-current="true"]:hover { color: var(--navy-900); text-decoration: none; }

/* Native disclosure dropdown, works with JavaScript disabled */
.dropdown { position: relative; }
.dropdown > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after {
  content: "";
  width: 0; height: 0;
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-top: 3px;
  transition: transform 0.15s ease;
}
.dropdown[open] > summary::after { transform: rotate(180deg); margin-top: -3px; }
.dropdown > summary:hover { background: rgba(255, 255, 255, 0.12); }

.dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 120;
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0; padding: var(--sp-2);
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.dropdown__menu li { margin: 0; }
.dropdown__menu a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--ink-800);
  font-size: var(--fs-sm);
}
.dropdown__menu a:hover { background: var(--surface-alt); color: var(--navy-700); text-decoration: none; }
.dropdown__menu a[aria-current="true"] { background: var(--sage-050); color: var(--navy-700); font-weight: 600; }

/* --- Logo lockup ----------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}
.logo img { width: 40px; height: 37px; }
.logo-word {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}
.logo-bgfi { color: var(--navy-500); }
.logo-bank { color: var(--sage-500); }
.logo-country {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 3px;
}
.logo--light .logo-bgfi { color: #fff; }
.logo--light .logo-bank { color: var(--sage-300); }
.logo--light .logo-country { color: var(--navy-300); }

/* --- Main navigation -------------------------------------------------- */
.header-main .wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  min-height: var(--header-h);
  padding-block: var(--sp-3);
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0; padding: 0;
  list-style: none;
}
.main-nav li { margin: 0; }
.main-nav a {
  display: block;
  padding: var(--sp-3) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-700);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.main-nav a:hover { color: var(--navy-500); background: var(--surface-alt); }
.main-nav a[aria-current="page"] {
  color: var(--navy-700);
  box-shadow: inset 0 -3px 0 var(--sage-500);
  border-radius: 0;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; fill: currentColor; }

/* --- Portal launcher, the unified access control --------------------- */
.portal-launcher { position: relative; }
.portal-launcher > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: var(--navy-700);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: var(--radius);
  white-space: nowrap;
}
.portal-launcher > summary::-webkit-details-marker { display: none; }
.portal-launcher > summary:hover { background: var(--navy-500); }
.portal-launcher > summary svg { width: 15px; height: 15px; fill: currentColor; }
.portal-launcher[open] > summary { background: var(--navy-900); }

.portal-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 130;
  width: min(94vw, 460px);
  max-height: min(72vh, 620px);
  overflow-y: auto;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.portal-panel__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-600);
  margin: 0 0 var(--sp-3);
}
.portal-panel ul { margin: 0 0 var(--sp-4); padding: 0; list-style: none; }
.portal-panel li { margin: 0 0 2px; }
.portal-panel li a {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink-800);
}
.portal-panel li a:hover { background: var(--surface-alt); }
.portal-panel .pl-ico {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--sage-050);
  color: var(--navy-700);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.portal-panel .pl-name { display: block; font-weight: 700; font-size: var(--fs-sm); color: var(--navy-900); }
.portal-panel .pl-meta { display: block; font-size: var(--fs-xs); color: var(--ink-500); }
.portal-panel__foot {
  border-top: 1px solid var(--line-200);
  padding-top: var(--sp-3);
  font-size: var(--fs-sm);
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn svg { width: 15px; height: 15px; fill: currentColor; flex-shrink: 0; }
.btn--primary { background: var(--navy-700); color: #fff; }
.btn--primary:hover { background: var(--navy-500); color: #fff; }
.btn--sage { background: var(--sage-500); color: var(--navy-900); }
.btn--sage:hover { background: var(--sage-600); color: #fff; }
.btn--ghost { border-color: var(--navy-700); color: var(--navy-700); background: transparent; }
.btn--ghost:hover { background: var(--navy-700); color: #fff; }
.btn--light { background: #fff; color: var(--navy-700); }
.btn--light:hover { background: var(--sage-100); color: var(--navy-900); }
.btn--outline-light { border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.btn--outline-light:hover { background: #fff; color: var(--navy-700); }
.btn--lg { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-base); }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: var(--fs-sm);
  text-decoration: none;
}
.link-arrow::after { content: "\203A"; font-size: 1.2em; line-height: 1; }
.link-arrow:hover { text-decoration: underline; }

/* --- External links ----------------------------------------------------
   Every link that leaves the site opens in a new tab. Opening a new tab
   without warning is a WCAG failure, so each such link carries a hidden
   announcement in the markup; this glyph is its visual counterpart, so
   sighted users get the same information before they click.

   Two exceptions, both of which announce themselves another way:
   the social icons carry the warning in their aria-label, and the store
   badges already read as a jump to an application store. */
a[target="_blank"]:not(.store-badge)::after {
  content: "";
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.4em;
  vertical-align: -0.01em;
  flex-shrink: 0;
  background-color: currentColor;
  opacity: 0.7;
  -webkit-mask: var(--ext-glyph) no-repeat center / contain;
  mask: var(--ext-glyph) no-repeat center / contain;
}

.social-list a[target="_blank"]::after,
.logo[target="_blank"]::after { content: none; }

/* In the portal launcher the link is a flex row aligned to the top, so the
   glyph is pushed to the trailing edge and centred against the two text lines
   rather than floating beside the first one. */
.portal-panel li a[target="_blank"]::after {
  margin-left: auto;
  align-self: center;
}

a[target="_blank"]:hover::after { opacity: 1; }

/* --- Cards ------------------------------------------------------------ */
.card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.card p { color: var(--ink-500); font-size: var(--fs-sm); }
.card > :last-child { margin-top: auto; padding-top: var(--sp-4); }
.card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius);
  background: var(--sage-050);
  color: var(--navy-700);
}
.card__icon svg { width: 22px; height: 22px; fill: currentColor; }
.card--link { text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card--link:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* --- Portal tiles, the hub centrepiece -------------------------------- */
.portal-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.portal-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line-200);
  border-top: 4px solid var(--navy-700);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.portal-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.portal-tile--sage { border-top-color: var(--sage-500); }
.portal-tile__head { display: flex; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.portal-tile__icon {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: var(--navy-700);
  color: #fff;
}
.portal-tile--sage .portal-tile__icon { background: var(--sage-500); color: var(--navy-900); }
.portal-tile__icon svg { width: 25px; height: 25px; fill: currentColor; }
.portal-tile h3 { margin: 0 0 2px; font-size: var(--fs-lg); }
.portal-tile__for { font-size: var(--fs-xs); font-weight: 600; color: var(--sage-600); text-transform: uppercase; letter-spacing: 0.07em; }
.portal-tile p { font-size: var(--fs-sm); color: var(--ink-500); }
.portal-tile ul { font-size: var(--fs-sm); color: var(--ink-500); padding-left: 1.1rem; }
.portal-tile ul li { margin-bottom: var(--sp-1); }
.portal-tile__foot { margin-top: auto; padding-top: var(--sp-4); }
.portal-tile__domain {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-alt);
  border: 1px solid var(--line-200);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--ink-500);
}
.portal-tile__domain svg { width: 13px; height: 13px; fill: var(--ok-600); flex-shrink: 0; }
.portal-tile__domain code {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: 0.95em;
  color: var(--navy-700);
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* --- Notices ---------------------------------------------------------- */
.notice {
  padding: var(--sp-5);
  border-radius: var(--radius);
  border-left: 4px solid var(--navy-500);
  background: var(--surface-alt);
  font-size: var(--fs-sm);
}
.notice h3, .notice h4 { margin-bottom: var(--sp-2); font-size: var(--fs-base); }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice--ok { border-left-color: var(--ok-600); background: var(--ok-050); }
.notice--warn { border-left-color: var(--warn-600); background: var(--warn-050); }
.notice--alert { border-left-color: var(--alert-600); background: var(--alert-050); }
.notice--sage { border-left-color: var(--sage-500); background: var(--surface-sage); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge--ok { background: var(--ok-050); color: var(--ok-600); }
.badge--warn { background: var(--warn-050); color: var(--warn-600); }
.badge--navy { background: var(--navy-100); color: var(--navy-700); }
.badge--sage { background: var(--sage-050); color: var(--sage-600); }

/* --- Forms ------------------------------------------------------------ */
.field { margin-bottom: var(--sp-5); }
.field label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--sp-2); color: var(--navy-900); }
.field .hint { display: block; font-size: var(--fs-xs); color: var(--ink-500); margin-bottom: var(--sp-2); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--ink-800);
  background: var(--surface);
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-500);
  outline: 3px solid rgba(0, 86, 156, 0.2);
  outline-offset: 0;
}
.field textarea { min-height: 130px; resize: vertical; }
.req { color: var(--alert-600); }

/* --- Breadcrumb ------------------------------------------------------- */
.breadcrumb { background: var(--surface-alt); border-bottom: 1px solid var(--line-200); }
.breadcrumb ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  margin: 0; padding-block: var(--sp-3); padding-left: 0;
  list-style: none;
  font-size: var(--fs-xs);
  color: var(--ink-500);
}
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: var(--sp-2); }
.breadcrumb li + li::before { content: "\203A"; color: var(--ink-300); }
.breadcrumb a { color: var(--ink-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy-500); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--navy-700); font-weight: 600; }

/* --- Footer ----------------------------------------------------------- */
.site-footer { background: var(--navy-900); color: #B9C6D6; font-size: var(--fs-sm); }
.site-footer h2, .site-footer h3 { color: #fff; font-size: var(--fs-sm); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: var(--sp-4); }
.site-footer a { color: #B9C6D6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-main { padding-block: var(--sp-7); }
.footer-cols { display: grid; gap: var(--sp-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: var(--sp-2); }
.footer-brand { margin-bottom: var(--sp-5); }
.footer-brand .logo img { width: 44px; height: 41px; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-block: var(--sp-5);
}
.footer-legal .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); align-items: center; justify-content: space-between; }
.footer-legal ul { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); list-style: none; margin: 0; padding: 0; }
.footer-legal li { margin: 0; }
.footer-copy { font-size: var(--fs-xs); color: #8E9DB0; margin: 0; }
.footer-supervisor {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-block: var(--sp-4);
  font-size: var(--fs-xs);
  color: #8E9DB0;
}
.footer-supervisor p { margin: 0; }

/* --- Responsive ------------------------------------------------------- */
@media (max-width: 1080px) {
  .main-nav a { padding-inline: var(--sp-2); }
}

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; order: 3; }
  .header-actions { order: 2; margin-left: auto; }
  .main-nav {
    order: 4;
    flex-basis: 100%;
    display: none;
    border-top: 1px solid var(--line-200);
    padding-top: var(--sp-3);
    margin-top: var(--sp-1);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a { padding: var(--sp-3) var(--sp-2); border-radius: var(--radius-sm); }
  .main-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--sage-500); background: var(--surface-alt); }
  .header-main .wrap { flex-wrap: wrap; }
  .utility-links { display: none; }
}

@media (max-width: 620px) {
  :root { --header-h: 64px; }
  .portal-launcher > summary { padding-inline: var(--sp-4); }
  .portal-panel { position: fixed; left: var(--sp-3); right: var(--sp-3); width: auto; top: auto; }
  .logo img { width: 34px; height: 31px; }
  .logo-word { font-size: 1.25rem; }
  .utility-bar .wrap { justify-content: center; }
  .footer-legal .wrap { flex-direction: column; align-items: flex-start; }
}
