/* Customer portal and support. Scoped so the staff console stays as it is. */

body.portal,
body.support {
  background-image:
    radial-gradient(980px 480px at 12% -10%, rgba(76, 125, 255, 0.32), transparent 58%),
    radial-gradient(640px 320px at 100% 0%, rgba(142, 231, 255, 0.1), transparent 52%),
    linear-gradient(rgba(120, 160, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.055) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
}

.portal-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 22px 32px;
}
body.portal:not(.console) main.portal-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 22px 56px;
}

.portal-kicker {
  margin: 0;
  color: #9eb6ff;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 750;
}

.portal-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.85fr);
  gap: 28px 36px;
  align-items: center;
  flex: 0 1 auto;
}
.portal-hero h1 {
  font-size: clamp(36px, 4vw, 52px);
  letter-spacing: -0.05em;
  max-width: 14ch;
}
.portal-hero .logo {
  display: block;
  width: min(340px, 92%);
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 28px rgba(80, 150, 255, 0.45));
}
.portal-lead {
  max-width: 46ch;
  color: var(--muted);
  font-size: 17px;
}
.portal-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.portal-points li {
  border: 1px solid rgba(150, 186, 255, 0.35);
  background: rgba(12, 22, 48, 0.65);
  border-radius: 999px;
  padding: 6px 12px;
  color: #d5e4ff;
  font-size: 13px;
  font-weight: 650;
}

.portal-auth {
  background: rgba(8, 14, 28, 0.82);
  border: 1px solid rgba(140, 176, 255, 0.38);
  border-radius: 22px;
  box-shadow: var(--shadow), 0 0 48px rgba(47, 91, 255, 0.18);
  padding: 18px 18px 8px;
}
.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 8px;
  background: rgba(4, 8, 18, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.auth-switch button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  box-shadow: none;
}
.auth-switch button.on {
  background: linear-gradient(180deg, #6d94ff 0%, #3d66f2 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 91, 255, 0.28);
}
.portal-auth .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 4px 4px 8px;
  margin: 0;
}
.portal-auth button[type="submit"] { width: 100%; margin-top: 16px; }
.portal-staff { text-align: center; margin: 8px 0 12px; font-size: 14px; }

/* Signed-in portal uses the technician shell. The document does not scroll. */
html:has(body.portal.console) {
  height: 100%;
  overflow: hidden;
}
body.portal.console {
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 420px at 100% -12%, rgba(61, 107, 255, 0.28), transparent 58%),
    radial-gradient(640px 280px at 0% 0%, rgba(142, 231, 255, 0.08), transparent 50%),
    linear-gradient(rgba(120, 160, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
}
body.portal.console .shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.portal.console .workspace {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
@media (min-width: 901px) {
  body.portal.console .workspace {
    height: 100dvh;
  }
  body.portal.console nav.side {
    height: calc(100dvh - var(--account-slot, 76px));
    max-height: calc(100dvh - var(--account-slot, 76px));
    align-self: start;
  }
}
@media (max-width: 900px) {
  body.portal.console .shell {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--account-slot, 76px));
    max-height: calc(100dvh - var(--account-slot, 76px));
  }
  body.portal.console .workspace {
    flex: 1 1 auto;
    height: auto;
  }
}

.org-lockup { display: flex; gap: 14px; align-items: center; min-width: 0; }
.org-mark {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0b1428;
  border: 1px solid rgba(142, 190, 255, 0.45);
  color: #d5e6ff;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.org-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

body.support .site-main { max-width: 1120px; }
body.support .auth-narrow,
body.support .desk .card {
  background: rgba(10, 16, 32, 0.9);
  border-color: rgba(140, 176, 255, 0.32);
  box-shadow: var(--shadow), 0 0 36px rgba(47, 91, 255, 0.12);
}

@media (max-width: 980px) {
  .portal-landing { gap: 22px; }
}
.portal-auth {
  background:
    linear-gradient(180deg, rgba(22, 36, 72, 0.55), rgba(8, 14, 28, 0.88));
}
body.portal.console main { padding-top: 8px; }
body.portal .ticket-compose { align-self: start; }

@media (max-width: 720px) {
  .portal-shell,
  body.portal:not(.console) main.portal-shell {
    justify-content: flex-start;
    padding: 20px 14px 28px;
  }
  .portal-landing { grid-template-columns: 1fr; align-items: start; gap: 16px; }
  .portal-hero .logo { width: min(148px, 52%); margin-bottom: 8px; }
  .portal-hero h1 { font-size: 30px; max-width: 16ch; }
  .portal-lead { font-size: 15.5px; }
  .portal-points { margin-top: 12px; }
  .portal-auth { padding: 14px 14px 6px; }
  .auth-switch button { min-height: 48px; }
}
