.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--white);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 78% 18%, rgba(57, 123, 156, 0.16), transparent 31%),
    linear-gradient(135deg, var(--navy-950), #101a20 62%, #13242a);
  background-size: 56px 56px, 56px 56px, 100% 100%, 100% 100%;
}

.portal-container {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.portal-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(11, 15, 18, 0.9);
}

.portal-header::after,
.portal-app-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: clamp(110px, 19vw, 280px);
  height: 2px;
  background: var(--accent);
  content: "";
}

.portal-header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.portal-product-label {
  padding: 4px 7px;
  border: 1px solid #56656d;
  color: #aeb9be;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.portal-back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: #bdc7cb;
  font-size: 13px;
  font-weight: 680;
}

.portal-back-link:hover {
  color: var(--white);
}

.portal-auth {
  position: relative;
  flex: 1;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.portal-auth::before {
  position: absolute;
  top: 8%;
  right: -130px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(255, 106, 50, 0.18);
  border-radius: 50%;
  content: "";
}

.portal-auth::after {
  position: absolute;
  right: 8%;
  bottom: 0;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #435159 18%, #435159 82%, transparent);
  content: "";
}

.portal-auth-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.72fr);
  align-items: center;
  gap: clamp(70px, 10vw, 150px);
  padding-block: clamp(65px, 9vw, 110px);
}

.portal-auth-copy {
  max-width: 660px;
}

.portal-auth-copy h2 {
  margin-bottom: 26px;
  font-size: clamp(48px, 6vw, 78px);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.portal-auth-copy h2 span {
  display: block;
  color: #9eabb1;
}

.portal-auth-copy > p:not(.eyebrow) {
  max-width: 580px;
  color: #c2ccd0;
  font-size: 19px;
}

.portal-route {
  position: relative;
  width: min(500px, 90%);
  height: 54px;
  margin: 40px 0 28px;
}

.portal-route::before,
.portal-route::after {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #536169;
  content: "";
  transform-origin: left center;
}

.portal-route::before {
  top: 14px;
}

.portal-route::after {
  bottom: 14px;
  transform: rotate(-4deg);
}

.portal-route span {
  position: absolute;
  z-index: 1;
  top: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  background: var(--navy-900);
  transform: rotate(45deg);
}

.portal-route span:nth-child(1) {
  left: 0;
}

.portal-route span:nth-child(2) {
  left: 48%;
}

.portal-route span:nth-child(3) {
  right: 0;
}

.portal-auth-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 24px;
  margin: 0;
  padding: 0;
  color: #aeb9be;
  font-size: 12px;
  list-style: none;
}

.portal-auth-facts li {
  position: relative;
  padding-left: 14px;
}

.portal-auth-facts li::before {
  position: absolute;
  top: 0.65em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--accent);
  content: "";
  transform: translateY(-50%);
}

.portal-login-panel {
  position: relative;
  padding: clamp(30px, 4vw, 44px);
  border: 1px solid #4c5a62;
  border-top: 3px solid var(--accent);
  color: var(--ink);
  background:
    linear-gradient(rgba(52, 66, 75, 0.035) 1px, transparent 1px),
    var(--surface-raised);
  background-size: 100% 40px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.38);
}

.portal-login-panel::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 7px;
  height: 7px;
  border: 1px solid #8b969b;
  border-radius: 50%;
  content: "";
}

.portal-panel-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 29px;
}

.portal-panel-marker > span {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy-700);
  color: var(--white);
  background: var(--navy-850);
  font-family: Bahnschrift, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.portal-panel-marker i {
  width: 70px;
  height: 2px;
  display: block;
  background: linear-gradient(90deg, var(--accent) 0 38%, #849097 38%);
}

.portal-panel-kicker {
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-login-panel h1 {
  margin-bottom: 9px;
  font-size: clamp(34px, 4vw, 45px);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.portal-login-intro {
  margin-bottom: 29px;
  color: var(--muted);
  font-size: 14px;
}

.portal-form-error {
  margin-bottom: 22px;
  padding: 13px 15px;
  border-left: 3px solid var(--danger);
  color: #741f2b;
  background: #fff0f2;
  font-size: 13px;
}

.portal-form-error strong {
  display: block;
}

.portal-form-error p {
  margin: 2px 0 0;
}

.portal-form-field {
  margin-bottom: 20px;
}

.portal-form-field label {
  display: block;
  margin-bottom: 7px;
  color: #354047;
  font-size: 13px;
  font-weight: 750;
}

.portal-form-field input {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #a8b3b8;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--white);
}

.portal-form-field input:hover {
  border-color: #718087;
}

.portal-form-field input:focus {
  border-color: #18727a;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(24, 114, 122, 0.18);
}

.portal-form-field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.portal-field-errors {
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
}

.portal-field-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-login-button {
  margin-top: 8px;
}

.portal-help {
  margin: 17px 0 0;
  color: #717d83;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.portal-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #87959b;
  background: rgba(11, 15, 18, 0.82);
}

.portal-footer > div {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.portal-footer p {
  margin: 0;
  font-size: 11px;
}

.portal-footer nav {
  display: flex;
  gap: 20px;
  font-size: 11px;
}

.portal-footer a:hover {
  color: var(--white);
}

/* Authenticated app shell */
.portal-app-body {
  display: block;
  color: var(--ink);
  background: var(--surface);
}

.portal-app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  color: var(--white);
  background: rgba(11, 15, 18, 0.97);
  border-bottom: 1px solid #344149;
}

.portal-app-header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-inline: 24px;
}

.portal-user-area {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.portal-user-name {
  max-width: 240px;
  overflow: hidden;
  color: #c3cdd1;
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-user-area form {
  margin: 0;
}

.portal-logout {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #5c6a71;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 730;
}

.portal-logout:hover {
  border-color: var(--accent);
  background: rgba(255, 106, 50, 0.08);
}

.portal-dashboard-layout {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.portal-sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 31px 18px 22px;
  border-right: 1px solid #344149;
  color: #b9c4c8;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--navy-850);
  background-size: 100% 42px;
}

.portal-sidebar-label {
  margin: 0 12px 20px;
  color: #7f8d93;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.portal-sidebar nav a {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-left: 2px solid transparent;
  font-size: 13px;
  font-weight: 720;
}

.portal-sidebar nav a.active {
  border-left-color: var(--accent);
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.portal-sidebar nav a > span {
  width: 12px;
  height: 12px;
  border: 1px solid #8c999f;
  background: linear-gradient(135deg, transparent 47%, var(--accent) 48% 57%, transparent 58%);
}

.portal-sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 12px 0;
  color: #87959b;
  font-size: 10px;
}

.portal-sidebar-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(36, 118, 95, 0.14);
}

.portal-dashboard {
  min-width: 0;
  padding: clamp(30px, 5vw, 64px);
  background:
    linear-gradient(rgba(52, 66, 75, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 66, 75, 0.04) 1px, transparent 1px),
    var(--surface);
  background-size: 48px 48px;
}

.portal-dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 38px;
  padding-bottom: 24px;
  border-bottom: 1px solid #bdc7cb;
}

.portal-dashboard-heading .eyebrow {
  margin-bottom: 12px;
}

.portal-dashboard-heading h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 62px);
  letter-spacing: -0.04em;
  line-height: 1;
}

.portal-dashboard-id {
  padding: 6px 9px;
  border: 1px solid #adb8bc;
  color: #68757b;
  background: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.portal-empty-state {
  min-height: 390px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 45px 28px;
  border: 1px solid #c3ccd0;
  border-top: 3px solid var(--navy-700);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(52, 66, 75, 0.045) 50%, transparent calc(50% + 1px)),
    rgba(255, 255, 255, 0.78);
  text-align: center;
}

.portal-empty-symbol {
  position: relative;
  width: 104px;
  height: 62px;
  margin-bottom: 25px;
}

.portal-empty-symbol::before,
.portal-empty-symbol::after,
.portal-empty-symbol span {
  position: absolute;
  left: 4px;
  width: 96px;
  height: 2px;
  background: #738087;
  content: "";
  transform-origin: left center;
}

.portal-empty-symbol::before {
  top: 15px;
}

.portal-empty-symbol::after {
  bottom: 15px;
}

.portal-empty-symbol span:first-child {
  top: 30px;
  transform: rotate(-12deg);
}

.portal-empty-symbol span:nth-child(2) {
  top: 30px;
  transform: rotate(12deg);
}

.portal-empty-symbol i {
  position: absolute;
  z-index: 1;
  top: 24px;
  left: 46px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent);
  background: var(--surface-raised);
  transform: rotate(45deg);
}

.portal-empty-kicker {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-empty-state h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 43px);
  letter-spacing: -0.03em;
}

.portal-empty-state > p:last-child {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .portal-auth-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .portal-auth-copy {
    max-width: 740px;
  }

  .portal-login-panel {
    width: min(560px, 100%);
  }
}

@media (max-width: 760px) {
  .portal-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid #344149;
  }

  .portal-sidebar-label {
    margin: 0;
  }

  .portal-sidebar nav a {
    min-height: 40px;
    width: fit-content;
  }

  .portal-sidebar-status {
    margin: 0;
  }
}

@media (max-width: 560px) {
  .portal-container {
    width: min(100% - 32px, 1160px);
  }

  .portal-header-inner,
  .portal-app-header-inner {
    min-height: 66px;
  }

  .portal-header .brand,
  .portal-app-header .brand {
    font-size: 17px;
  }

  .portal-header .brand-mark,
  .portal-app-header .brand-mark {
    width: 28px;
    height: 28px;
  }

  .portal-auth-grid {
    gap: 42px;
    padding-block: 48px;
  }

  .portal-auth-copy h2 {
    font-size: clamp(43px, 13vw, 58px);
  }

  .portal-auth-copy > p:not(.eyebrow) {
    font-size: 17px;
  }

  .portal-route {
    margin-block: 30px 22px;
  }

  .portal-login-panel {
    padding: 27px 22px;
  }

  .portal-footer > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-block: 18px;
  }

  .portal-user-name,
  .portal-product-label {
    display: none;
  }

  .portal-dashboard {
    padding: 30px 16px;
  }

  .portal-dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .portal-sidebar {
    grid-template-columns: 1fr auto;
  }

  .portal-sidebar-label {
    display: none;
  }

  .portal-sidebar nav {
    min-width: 0;
  }

  .portal-empty-state {
    min-height: 350px;
    padding-inline: 20px;
  }
}

@media (max-width: 390px) {
  .portal-back-link {
    font-size: 0;
  }

  .portal-back-link span {
    font-size: 16px;
  }

  .portal-app-header-inner {
    padding-inline: 16px;
  }

  .portal-sidebar-status {
    font-size: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
