/* Bermuda Sports Portal — login and programme workspace */
:root {
  color-scheme: dark;
  --portal-bg: #11161b;
  --portal-header: #0e1318;
  --portal-panel: #1b2229;
  --portal-raised: #202931;
  --portal-line: #303b45;
  --portal-text: #f5f7fa;
  --portal-secondary: #bbc6cf;
  --portal-muted: #9cabb6;
  --portal-blue: #119bea;
  --portal-teal: #7de0dc;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body.login-page, body.portal-page {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.login-page :where(a, button, input):focus-visible,
body.portal-page :where(a, button, input):focus-visible {
  outline: 2px solid #54c5ff;
  outline-offset: 3px;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 500;
  padding: 12px 16px;
  background: #fff;
  color: #101820;
  border-radius: 6px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* One consistent header for entry and authenticated views. */
body .header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 19, 24, .97);
  border-bottom: 1px solid #27313a;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .12);
  color: var(--portal-text);
}
body .header-inner {
  width: min(100%, 1600px);
  min-height: 68px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  display: grid;
  place-items: center;
  border: 1px solid #287899;
  border-radius: 9px;
  background: linear-gradient(140deg, #164354, #132a36);
  color: #9ae5fb;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -.06em;
}
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-size: 14px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.brand-dept { color: var(--portal-muted); font-size: 10px; letter-spacing: .035em; line-height: 1.2; }
.header-nav { display: flex; align-self: stretch; align-items: stretch; gap: 5px; margin-left: 22px; }
.header-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: var(--portal-secondary);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.header-nav a:hover, .header-nav a[aria-current="page"] { color: #fff; }
.header-nav a[aria-current="page"]::after {
  position: absolute;
  right: 14px;
  bottom: -10px;
  left: 14px;
  height: 2px;
  background: var(--portal-blue);
  content: "";
}
body .header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.header-context { color: var(--portal-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
body .signout-btn {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid #46535e;
  border-radius: 7px;
  background: #1c252d;
  color: #f5f7fa;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
body .signout-btn:hover { background: #2c3944; border-color: #687783; }

/* Programme workspace */
.portal-layout {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 20px 24px 48px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: start;
}
.portal-sidebar, .portal-content, .portal-aside { min-width: 0; }
.sidebar-label, .eyebrow {
  color: #a5b4bf;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1.4;
  text-transform: uppercase;
}
.sidebar-label { margin: 13px 10px 10px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sidebar-nav a {
  min-height: 44px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 7px;
  color: #c3cdd5;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.sidebar-nav a:hover { color: #fff; background: #242f38; }
.sidebar-nav a[aria-current="page"] { color: #fff; background: #26343e; }
.nav-icon {
  width: 22px;
  flex: 0 0 22px;
  color: #86bdcf;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}
.sidebar-note { margin: 25px 10px 0; padding-top: 17px; border-top: 1px solid #2a343d; color: #9baab5; font-size: 11px; line-height: 1.6; }
.sidebar-hint { display: none; }
body .main { max-width: none; margin: 0; padding: 0; }
body .portal-welcome {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  margin: 0 0 26px;
  padding: 27px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  border: 1px solid #294250;
  border-radius: 12px;
  background: linear-gradient(108deg, #172d39 0%, #193540 43%, #16252e 100%);
}
.portal-welcome::after {
  position: absolute;
  right: -72px;
  bottom: -155px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(126, 215, 224, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(126, 215, 224, .035), 0 0 0 70px rgba(126, 215, 224, .025);
  content: "";
  pointer-events: none;
}
.portal-welcome > * { position: relative; z-index: 1; }
.portal-welcome .eyebrow { color: #94d8df; margin: 0 0 10px; }
body .portal-welcome h1 { max-width: 580px; margin: 0 0 9px; color: #fff; font-size: clamp(24px, 2.4vw, 32px); font-weight: 750; letter-spacing: -.035em; line-height: 1.12; }
body .portal-welcome p { max-width: 540px; margin: 0; color: #c4d3db; font-size: 13px; line-height: 1.6; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading .eyebrow { margin: 0 0 5px; }
.section-heading h2 { margin: 0; color: #f5f7fa; font-size: 18px; letter-spacing: -.025em; }
.section-count { color: #b5c1ca; font-size: 12px; white-space: nowrap; }
body .cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
body .portal-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #303a43;
  border-radius: 10px;
  background: #1b2229;
  color: var(--portal-text);
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
body .portal-card:hover { background: #202a32; border-color: #527384; transform: translateY(-2px); }
body .card-hero { position: relative; overflow: hidden; width: 100%; height: 130px; background: #243039; }
body .card-hero::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 21, 27, .66), rgba(14, 21, 27, .2) 38%, rgba(14, 21, 27, .78)); content: ""; pointer-events: none; }
body .card-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
body .card-cat, body .card-badge { position: absolute; z-index: 1; font-weight: 750; }
body .card-cat { top: 12px; left: 12px; max-width: calc(100% - 24px); padding: 0; border: 0; border-radius: 0; background: none; color: #fff; font-size: 10px; letter-spacing: .07em; line-height: 1.2; text-shadow: 0 1px 5px #000; text-transform: uppercase; }
body .card-badge { right: 12px; bottom: 11px; color: #fff; font-size: 11px; }
body .card-body { display: flex; flex: 1; flex-direction: column; padding: 17px 17px 15px; }
body .card-title { margin: 0 0 5px; color: #f5f7fa; font-size: 16px; font-weight: 750; letter-spacing: -.015em; line-height: 1.3; }
body .card-subtitle { margin-bottom: 10px; color: #81c8d7; font-size: 10px; font-weight: 750; letter-spacing: .055em; line-height: 1.4; text-transform: uppercase; }
body .card-desc { flex: 1; margin: 0 0 14px; color: #b9c5ce; font-size: 12px; line-height: 1.55; }
body .card-meta { display: flex; flex-direction: column; gap: 7px; margin: 0 0 15px; padding: 13px 0 0; border-top: 1px solid #303a43; }
body .card-meta-row { display: flex; align-items: baseline; gap: 8px; color: #c6d0d7; font-size: 11px; line-height: 1.4; }
body .meta-icon { flex: 0 0 17px; width: 17px; font-size: 12px; text-align: center; }
body .granted-stat { color: #8de0bc; font-weight: 650; }
body .granted-loading { color: #a9b9c4; font-style: normal; font-weight: 400; }
body .card-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid #303a43; }
body .cta-btn { color: #7fd2ff; font-size: 12px; font-weight: 750; }
body .cta-circle { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; background: #263640; color: #a6ddf3; font-size: 15px; }
.portal-card:hover .cta-circle { background: #175d7c; color: #fff; }
.portal-aside { padding-top: 1px; }
.aside-panel { padding: 17px; border: 1px solid #303a43; border-radius: 10px; background: #1b2229; }
.aside-panel + .aside-panel { margin-top: 14px; }
.aside-panel .eyebrow { margin: 0 0 8px; }
.aside-panel h2 { margin: 0 0 9px; font-size: 15px; line-height: 1.3; }
.aside-panel p { margin: 0; color: #b7c3cc; font-size: 12px; line-height: 1.6; }
.guide-list { list-style: none; margin: 16px 0 0; padding: 0; }
.guide-list li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid #303a43; color: #d4dce2; font-size: 12px; line-height: 1.45; }
.guide-list span { color: #7fcddc; font-size: 10px; font-weight: 800; }
.aside-link { display: inline-flex; min-height: 44px; align-items: center; margin-top: 10px; color: #7fd2ff; font-size: 12px; font-weight: 700; text-decoration: none; }
.aside-link:hover { text-decoration: underline; }
body .footer { margin: 0; padding: 20px 24px 27px; border-top: 1px solid #29343d; color: #9daab4; font-size: 11px; line-height: 1.5; text-align: center; }

/* Entry screen */
.login-stage { position: relative; overflow: hidden; min-height: calc(100vh - 68px); display: grid; align-items: center; }
.login-video, .login-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-video { object-fit: cover; }
.login-overlay { background: linear-gradient(90deg, rgba(12, 21, 27, .92), rgba(13, 24, 30, .84) 45%, rgba(13, 20, 26, .96)); }
.login-layout { position: relative; z-index: 1; width: min(100%, 1280px); margin: 0 auto; padding: 64px 36px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 410px); align-items: center; gap: clamp(42px, 9vw, 140px); }
.login-intro { max-width: 600px; }
.login-intro .eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 20px; color: #a4dce2; }
.login-intro .eyebrow::before { width: 23px; height: 2px; background: #42bed2; content: ""; }
.login-intro h1 { margin: 0 0 18px; color: #fff; font-size: clamp(35px, 4.4vw, 58px); font-weight: 750; letter-spacing: -.045em; line-height: 1.06; }
.login-intro > p:not(.eyebrow) { max-width: 470px; margin: 0; color: #c4d1d9; font-size: 15px; line-height: 1.7; }
.login-intro-rule { width: 100%; max-width: 400px; height: 1px; margin: 32px 0 17px; background: #546c77; }
.login-intro-note { color: #b2c4ce; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
body .login-box { padding: 30px; border: 1px solid #3b4c58; border-radius: 12px; background: rgba(27, 34, 41, .97); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); text-align: left; }
.login-box .eyebrow { margin: 0 0 12px; color: #85cddd; }
body .login-box h2 { margin: 0 0 8px; color: #fff; font-size: 24px; font-weight: 750; letter-spacing: -.035em; line-height: 1.2; }
body .login-box .subtitle { margin: 0 0 27px; color: #b8c4cd; font-size: 13px; line-height: 1.55; }
body .login-label { display: block; margin-bottom: 8px; color: #dce5eb; font-size: 12px; font-weight: 700; }
body .login-input { width: 100%; min-height: 48px; margin: 0 0 16px; padding: 0 13px; border: 1px solid #53626d; border-radius: 7px; background: #141c23; color: #fff; font: inherit; font-size: 16px; }
body .login-input::placeholder { color: #a0acb5; }
body .login-input:focus { border-color: #54c5ff; }
body .login-btn { width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 7px; background: #119bea; color: #071b27; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
body .login-btn:hover { background: #50bcf6; }
body .login-btn:disabled { opacity: .7; cursor: wait; }
body .login-error { min-height: 20px; margin-top: 10px; color: #ffb4b7; font-size: 12px; line-height: 1.5; }
body .login-footer { margin-top: 14px; padding-top: 17px; border-top: 1px solid #34414b; color: #b3c0c9; font-size: 11px; line-height: 1.55; }

@media (max-width: 1160px) {
  .portal-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .portal-aside { grid-column: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .aside-panel + .aside-panel { margin-top: 0; }
}
@media (max-width: 767px) {
  body .header-inner { min-height: 64px; padding: 9px 14px; gap: 10px; }
  .header-nav, .header-context { display: none; }
  .brand-name { font-size: 13px; }
  .brand-dept { font-size: 9px; }
  .portal-layout { display: flex; flex-direction: column; gap: 16px; padding: 14px 12px 32px; }
  .portal-sidebar, .portal-content, .portal-aside { width: 100%; }
  .sidebar-label, .sidebar-note { display: none; }
  .sidebar-nav { flex-direction: row; gap: 5px; overflow-x: auto; padding: 1px 2px 6px; scrollbar-color: #718391 #19232a; }
  .sidebar-nav a { flex: 0 0 auto; padding: 9px 11px; white-space: nowrap; }
  .sidebar-hint { display: block; margin: 1px 2px 0; color: #a5b3be; font-size: 10px; }
  body .portal-welcome { min-height: 160px; margin-bottom: 22px; padding: 23px 20px; }
  .portal-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-stage { min-height: calc(100vh - 64px); }
  .login-layout { grid-template-columns: 1fr; gap: 28px; padding: 38px 20px 48px; }
  .login-intro h1 { font-size: clamp(32px, 8vw, 44px); }
  .login-intro > p:not(.eyebrow) { font-size: 13px; }
  .login-intro-rule { margin: 20px 0 13px; }
  body .login-box { max-width: 520px; width: 100%; padding: 24px; }
}
@media (max-width: 520px) {
  body .cards-grid, .portal-aside { grid-template-columns: minmax(0, 1fr); }
  body .card-hero { height: 145px; }
  body .login-box { padding: 22px 18px; }
  .login-layout { padding-right: 14px; padding-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .login-video { display: none; }
  .login-stage { background: #162b35; }
}

/* Responsive workspace drawers. Without JavaScript the existing in-page panels remain usable. */
.drawer-trigger, .rail-icon { display: none; }
dialog.portal-drawer:not([open]) { display: none; }
.portal-drawer[open] {
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(340px, calc(100% - 24px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  background: #141b21;
  color: var(--portal-text);
  box-shadow: 0 0 40px rgba(0, 0, 0, .4);
}
.navigation-drawer[open] { right: auto; left: 0; border-right: 1px solid var(--portal-line); }
.guide-drawer[open] { right: 0; left: auto; border-left: 1px solid var(--portal-line); }
.portal-drawer::backdrop { background: rgba(4, 9, 13, .76); }
.drawer-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--portal-line);
  background: #141b21;
}
.drawer-heading .eyebrow { margin: 0 0 4px; color: #86cbd9; }
.drawer-heading h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.drawer-close, .drawer-trigger {
  min-width: 44px;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #46535e;
  border-radius: 7px;
  background: #1c252d;
  color: #f5f7fa;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.drawer-close:hover, .drawer-trigger:hover { background: #2c3944; border-color: #687783; }
.drawer-content { flex: 1 0 auto; min-width: 0; padding: 16px; }
.drawer-account { padding: 0 16px 20px; }
.drawer-account:empty { display: none; }
.drawer-account .signout-btn { width: 100%; }
body.drawers-ready .portal-drawer .portal-sidebar,
body.drawers-ready .portal-drawer .portal-aside { display: block; width: auto; padding: 0; }
body.drawers-ready .portal-drawer .aside-panel + .aside-panel { margin-top: 14px; }
body.drawers-ready .portal-drawer .sidebar-label,
body.drawers-ready .portal-drawer .sidebar-note { display: block; }
body.drawers-ready .portal-drawer .sidebar-hint { display: none; }
body.drawers-ready .portal-drawer .sidebar-nav { display: flex; flex-direction: column; gap: 3px; overflow: visible; padding: 0; }
body.drawers-ready .portal-drawer .sidebar-nav a { flex: initial; padding: 9px 10px; white-space: normal; }

@media (max-width: 1199px) {
  body.drawers-ready .guide-trigger { display: inline-flex; align-items: center; justify-content: center; }
  body.drawers-ready .header-context { display: none; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  body.drawers-ready .portal-layout { grid-template-columns: 64px minmax(0, 1fr); }
  body.drawers-ready .portal-sidebar { position: relative; z-index: 2; }
  body.drawers-ready .sidebar-label, body.drawers-ready .sidebar-note { display: none; }
  body.drawers-ready .sidebar-nav a { position: relative; justify-content: center; padding: 8px; }
  body.drawers-ready .sidebar-nav .nav-icon { display: none; }
  body.drawers-ready .sidebar-nav .rail-icon { display: block; color: #a6d8e5; font-size: 12px; font-weight: 800; }
  body.drawers-ready .sidebar-nav .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  body.drawers-ready .sidebar-nav a:hover::after,
  body.drawers-ready .sidebar-nav a:focus-visible::after {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: calc(100% + 8px);
    width: max-content;
    max-width: 220px;
    padding: 9px 11px;
    border: 1px solid #46535e;
    border-radius: 6px;
    background: #202b34;
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
    transform: translateY(-50%);
    pointer-events: none;
    content: attr(title);
  }
}
@media (max-width: 767px) {
  body.drawers-ready .menu-trigger { display: inline-flex; align-items: center; justify-content: center; }
  body.drawers-ready .header-inner { gap: 8px; padding-right: 12px; padding-left: 12px; }
  body.drawers-ready .portal-brand { flex: 1 1 0; min-height: 44px; gap: 8px; }
  body.drawers-ready .brand-copy { min-width: 0; }
  body.drawers-ready .brand-name { font-size: 12px; }
  body.drawers-ready .brand-dept { display: none; }
  body.drawers-ready .header-right { flex: 0 0 auto; gap: 6px; }
  body.drawers-ready .portal-layout { display: block; }
  body.drawers-ready .cards-grid { grid-template-columns: minmax(0, 1fr); }
}
