/* Approved BAGC6 portal entrance and catalogue uplift */
.portal-entrance {
  margin: 0 -24px;
  padding: 54px 7% 72px;
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(320px,.92fr);
  gap: 64px;
  background:
    radial-gradient(circle at 77% 35%,rgba(74,154,162,.26),transparent 31%),
    linear-gradient(112deg,#01293a 0%,#073e4e 47%,#072d39 74%,#06171e 100%);
  border-bottom: 1px solid rgba(74,154,162,.22);
  position: relative;
}
.portal-entrance::after {
  content: '';
  position: absolute;
  left: 7%; right: 7%; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg,transparent,rgba(105,201,208,.72),transparent);
  box-shadow: 0 0 16px rgba(105,201,208,.36);
}
.portal-entrance-copy h1 {
  margin: 0 0 50px;
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: clamp(52px,6.6vw,79px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: .98;
  color: var(--text-primary);
}
.portal-entrance-copy h1 em {
  position: relative;
  color: var(--mist);
  font-weight: 400;
  text-shadow: 0 0 28px rgba(105,201,208,.24);
}
.portal-entrance-copy h1 em::after {
  content: '';
  position: absolute;
  left: 3%; right: 2%; bottom: -8px;
  height: 2px;
  background: linear-gradient(90deg,transparent,var(--amber),transparent);
  box-shadow: 0 0 12px rgba(212,168,83,.48);
}
.portal-hero-line { margin: 0 0 32px; color: var(--mist); font-size: 16px; }
.portal-benefits { list-style: none; display: grid; gap: 13px; }
.portal-benefits li {
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(238,248,249,.9);
  font-size: 14px;
}
.portal-benefits span {
  padding: 5px 7px;
  border: 1px solid rgba(212,168,83,.5);
  border-radius: 999px;
  color: var(--amber);
  font-size: 9px;
}
.portal-access-button { margin-top: 30px; border: 0; cursor: pointer; }
.portal-spaces-column { align-self: center; }
.portal-spaces-overline {
  margin: 0 4px 16px;
  color: #69c9d0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-align: center;
}
.portal-spaces-panel {
  position: relative;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(105,201,208,.72);
  border-radius: 18px;
  background: linear-gradient(145deg,rgba(7,47,60,.94),rgba(6,28,36,.98));
  box-shadow: inset 0 0 0 1px rgba(201,246,250,.07),0 22px 60px rgba(0,0,0,.3),0 0 38px rgba(61,133,140,.17);
}
.portal-spaces-panel::before,
.labs-section::before {
  content: '';
  position: absolute;
  left: 16px; right: 16px; top: -1px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg,var(--teal),var(--mist),var(--teal));
  box-shadow: 0 0 18px rgba(105,201,208,.68);
}
.portal-panel-eyebrow,
.portal-catalogue-eyebrow {
  color: #69c9d0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
}
.portal-spaces-panel h2 {
  margin: 15px 0 26px;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: 29px;
  font-weight: 500;
  line-height: 1.16;
}
.portal-spaces-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.portal-spaces-grid div {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 10px;
  border: 1px solid rgba(105,201,208,.24);
  border-radius: 8px;
  background: rgba(61,133,140,.08);
  color: var(--mist);
  font-size: 12px;
}
.portal-space-icon { width: 18px; color: #9de6eb; text-align: center; }

.portal-closing-line {
  grid-column: 1 / -1;
  position: relative;
  margin: 8px 0 0;
  padding-top: 28px;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: clamp(24px,3vw,36px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
  text-align: center;
}
.portal-closing-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 1px;
  background: linear-gradient(90deg,transparent,var(--amber),transparent);
  box-shadow: 0 0 14px rgba(212,168,83,.5);
}
.portal-closing-line strong { font-weight: 500; }
.portal-closing-line em { color: var(--mist); font-weight: 400; }
body.portal-open .portal-entrance { display: none; }
body.portal-open .page { max-width: 1180px; }
body.portal-open header {
  background: linear-gradient(90deg,rgba(1,41,58,.96),rgba(7,51,62,.78),rgba(6,15,20,.92));
}
.labs-section {
  position: relative;
  margin: 34px -24px 0;
  padding: 52px 6.5% 0;
  background: radial-gradient(circle at 68% 2%,rgba(61,133,140,.15),transparent 27%);
}
.portal-catalogue-heading {
  display: grid;
  grid-template-columns: 1fr minmax(310px,.7fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(74,154,162,.2);
  position: relative;
}
.portal-catalogue-heading::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 44%; height: 2px;
  background: linear-gradient(90deg,var(--teal-light),rgba(201,246,250,.7),transparent);
  box-shadow: 0 0 14px rgba(105,201,208,.4);
}
.portal-catalogue-heading h1 {
  margin: 9px 0 4px;
  color: var(--text-primary);
  font-family: 'Cormorant Garamond',Georgia,serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1.1;
}
.portal-catalogue-heading p { color: var(--text-muted); font-size: 13px; }
.labs-section .scenario-search-panel { margin: 0; max-width: none; }
.labs-section .scenario-search-panel label {
  color: var(--mist);
  font-size: 11px;
  letter-spacing: .1em;
}
.labs-section .scenario-search-input { background: rgba(61,133,140,.09); }
body.portal-open .labs-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
body.portal-open .lab-card {
  border-color: rgba(105,201,208,.72);
  background: linear-gradient(145deg,rgba(7,47,60,.94),rgba(6,28,36,.98));
  box-shadow: inset 0 0 0 1px rgba(201,246,250,.07),0 22px 60px rgba(0,0,0,.3),0 0 38px rgba(61,133,140,.17);
}
body.portal-open .lab-card::before {
  opacity: 1;
  background: linear-gradient(90deg,var(--teal),var(--mist),var(--teal));
  box-shadow: 0 0 18px rgba(105,201,208,.55);
}
@media (max-width:680px) {
  .portal-entrance {
    grid-template-columns: 1fr;
    gap: 42px;
    margin: 0 -24px;
    padding: 32px 20px 57px;
  }
  .portal-entrance-copy h1 { margin-bottom: 54px; font-size: 51px; }
  .portal-hero-line { margin-bottom: 34px; font-size: 14px; }
  .portal-benefits li { align-items: flex-start; font-size: 13px; }
  .portal-spaces-overline { margin: 0 0 17px; text-align: center; }
  .portal-spaces-panel { padding: 25px 20px; }
  .portal-spaces-panel h2 { font-size: 25px; }
  .portal-spaces-grid div { padding: 9px 7px; font-size: 11px; }
  .portal-closing-line { margin-top: 2px; padding-top: 24px; font-size: 28px; }
  .portal-closing-line::before { left: 18%; right: 18%; }
  .labs-section { margin-top: 24px; padding: 38px 20px 0; }
  .portal-catalogue-heading { grid-template-columns: 1fr; gap: 20px; margin-bottom: 28px; }
  .portal-catalogue-heading h1 { font-size: 35px; }
  body.portal-open .labs-grid { grid-template-columns: 1fr; }
}

/* Full-screen entrance refinement */
body:not(.portal-open) .page {
  max-width: 1440px;
  padding-left: 32px;
  padding-right: 32px;
}
body:not(.portal-open) .portal-entrance {
  min-height: calc(100vh - 185px);
  align-items: center;
}
.portal-header-access {
  display: inline-flex;
  padding: 14px 24px;
  border: 0;
  font-size: 12px;
  white-space: nowrap;
}
body.portal-open .portal-header-access { display: none; }

@media (max-width:680px) {
  body:not(.portal-open) .page {
    padding-left: 20px;
    padding-right: 20px;
  }
  body:not(.portal-open) header {
    gap: 18px;
  }
  body:not(.portal-open) .header-right {
    margin-top: 0;
  }
  .portal-header-access {
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 15px 20px;
    font-size: 11px;
  }
  body:not(.portal-open) .portal-entrance {
    min-height: auto;
    margin-left: -20px;
    margin-right: -20px;
  }
}

/* Edge-to-edge flow refinement */
.portal-entrance {
  background:
    linear-gradient(180deg,#060f14 0%,rgba(6,15,20,.78) 5%,rgba(6,15,20,.2) 16%,transparent 25%),
    radial-gradient(circle at 77% 35%,rgba(74,154,162,.26),transparent 31%),
    linear-gradient(112deg,#01293a 0%,#073e4e 47%,#072d39 74%,#06171e 100%);
}
.portal-spaces-link {
  display: block;
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
}
.portal-spaces-link .portal-spaces-panel {
  transition: border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}
.portal-spaces-link:hover .portal-spaces-panel,
.portal-spaces-link:focus-visible .portal-spaces-panel {
  border-color: var(--mist);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(201,246,250,.12),0 24px 64px rgba(0,0,0,.34),0 0 46px rgba(61,133,140,.28);
}
.portal-spaces-link:focus-visible {
  outline: 2px solid var(--mist);
  outline-offset: 5px;
}
body.portal-open .page {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
body.portal-open header {
  width: 100%;
  padding-left: max(24px,6.5vw);
  padding-right: max(24px,6.5vw);
}
body.portal-open .labs-section {
  margin: 0;
  min-height: calc(100vh - 137px);
  padding-left: max(24px,6.5vw);
  padding-right: max(24px,6.5vw);
  background:
    radial-gradient(circle at 68% 2%,rgba(61,133,140,.2),transparent 29%),
    linear-gradient(180deg,rgba(7,51,62,.9) 0%,rgba(7,34,43,.94) 18%,#060f14 58%);
}
@media (max-width:680px) {
  body.portal-open header {
    padding: 28px 20px 34px;
  }
  body.portal-open .labs-section {
    min-height: calc(100vh - 205px);
    padding: 46px 20px 0;
  }
}

/* Continuous catalogue background and strengthened brand mark */
body.portal-open .labs-section {
  padding-bottom: 88px;
  background:
    linear-gradient(180deg,#060f14 0%,rgba(6,15,20,.78) 5%,rgba(6,15,20,.2) 16%,transparent 25%),
    radial-gradient(circle at 77% 35%,rgba(74,154,162,.26),transparent 31%),
    linear-gradient(112deg,#01293a 0%,#073e4e 47%,#072d39 74%,#06171e 100%);
}

/* Signed-in catalogue only: remove the divider so the approved colours flow continuously. */
body.portal-open header {
  border-bottom: 0;
  background: #060f14;
}
body.portal-open .labs-section::before {
  display: none;
}
body.portal-open .portal-catalogue-heading,
body.portal-open .labs-grid,
body.portal-open #email-reminder {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}
body.portal-open footer {
  width: 100%;
  margin: 0;
  padding: 46px max(24px,6.5vw) 36px;
  background: #060f14;
}
.header-logo {
  width: 62px;
  height: 62px;
  flex-basis: 62px;
}
@media (max-width:680px) {
  body.portal-open .labs-section {
    padding-bottom: 64px;
  }
  body.portal-open footer {
    padding: 34px 20px 28px;
  }
  .header-logo {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }
}

/* Full-bleed entrance correction */
body:not(.portal-open) .page {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}
body:not(.portal-open) header {
  padding-left: max(24px,4.5vw);
  padding-right: max(24px,4.5vw);
}
body:not(.portal-open) .portal-entrance {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  min-height: calc(100vh - 137px);
  padding-left: max(24px,7%);
  padding-right: max(24px,7%);
}
@media (max-width:680px) {
  body:not(.portal-open) .page {
    padding-left: 0;
    padding-right: 0;
  }
  body:not(.portal-open) header {
    padding: 20px;
  }
  body:not(.portal-open) .portal-entrance {
    margin-left: 0;
    margin-right: 0;
    min-height: auto;
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Entrance footer integration */
body:not(.portal-open) footer {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 34px max(24px,7%) 32px;
  border-top: 1px solid rgba(105,201,208,.14);
  background:
    linear-gradient(180deg,#06171e 0%,#060f14 100%);
}
@media (max-width:680px) {
  body:not(.portal-open) footer {
    display: grid;
    gap: 18px;
    padding: 30px 20px 28px;
  }
}

/* Compact mobile portal access */
@media (max-width:680px) {
  body:not(.portal-open) .portal-header-access {
    width: auto;
    min-width: 208px;
    min-height: 44px;
    margin-left: auto;
    padding: 11px 18px;
    font-size: 10px;
  }
}


/* Restore the signed-in mobile catalogue exactly as it was before the desktop catalogue changes. */
@media (max-width:680px) {
  body.portal-open header {
    position: relative;
    z-index: 1;
    border-bottom: 0;
    background:
      radial-gradient(circle at 68% 100%,rgba(61,133,140,.2),transparent 29%),
      linear-gradient(180deg,#01293a 0%,#07333e 100%);
  }
  body.portal-open header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -32px;
    height: 32px;
    pointer-events: none;
    background: linear-gradient(180deg,#07333e 0%,rgba(7,51,62,.66) 45%,transparent 100%);
  }
  body.portal-open .labs-section {
    background:
      radial-gradient(circle at 68% 2%,rgba(61,133,140,.2),transparent 29%),
      linear-gradient(180deg,rgba(7,51,62,.92) 0%,rgba(7,34,43,.96) 18%,#061820 72%,#060f14 100%);
  }
}
