/* ECNChat Theme U2 — Premium Dark Sitewide Redesign */
:root {
  --ecn-u2-bg: #020b1d;
  --ecn-u2-bg-2: #071a38;
  --ecn-u2-panel: rgba(8, 29, 62, .92);
  --ecn-u2-panel-2: rgba(12, 42, 84, .92);
  --ecn-u2-border: rgba(109, 179, 255, .28);
  --ecn-u2-border-strong: rgba(72, 157, 255, .62);
  --ecn-u2-text: #f7fbff;
  --ecn-u2-muted: #b8c9df;
  --ecn-u2-blue: #1688ff;
  --ecn-u2-blue-2: #0b5fc7;
  --ecn-u2-cyan: #56c8ff;
  --ecn-u2-green: #19c773;
  --ecn-u2-danger: #e65555;
  --ecn-u2-shadow: 0 18px 55px rgba(0, 0, 0, .34);
  --ecn-u2-radius: 16px;
}

html.ecnU2Theme {
  min-height: 100%;
  color-scheme: dark;
  background: var(--ecn-u2-bg);
}

body.ecnU2ThemeBody {
  min-height: 100vh;
  margin: 0 !important;
  color: var(--ecn-u2-text) !important;
  background:
    radial-gradient(circle at 83% 8%, rgba(0, 132, 255, .20), transparent 31rem),
    radial-gradient(circle at 8% 40%, rgba(15, 83, 185, .14), transparent 28rem),
    linear-gradient(145deg, #02091a 0%, #03132c 48%, #061d3e 100%) fixed !important;
  font-family: Inter, "Segoe UI", Arial, sans-serif !important;
}

body.ecnU2ThemeBody::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .45;
  background:
    radial-gradient(circle at 82% 34%, rgba(73, 188, 255, .9) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 44%, rgba(73, 188, 255, .8) 0 1px, transparent 2px),
    radial-gradient(circle at 91% 50%, rgba(73, 188, 255, .8) 0 1px, transparent 2px),
    linear-gradient(115deg, transparent 0 64%, rgba(28, 122, 255, .11) 64% 64.4%, transparent 64.4% 100%);
  background-size: 290px 230px, 360px 310px, 420px 360px, 100% 100%;
}

#ecnUnifiedSiteShell {
  position: relative;
  z-index: 9990;
  width: 100%;
  color: var(--ecn-u2-text);
  background: linear-gradient(180deg, rgba(2, 10, 28, .98), rgba(3, 18, 44, .98));
  border-top: 3px solid #030712;
  box-shadow: 0 14px 36px rgba(0,0,0,.34);
}

.ecnUnifiedBrandBar {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  max-width: 1600px;
  min-height: 128px;
  margin: 0 auto;
  padding: 18px 38px;
  box-sizing: border-box;
}

.ecnUnifiedBrand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 22px;
  color: inherit !important;
  text-decoration: none !important;
}

.ecnU2LogoWrap {
  display: grid;
  width: 185px;
  min-width: 185px;
  place-items: center;
}

.ecnU2LogoWrap img {
  display: block;
  width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.ecnU2BrandDivider {
  width: 1px;
  height: 74px;
  background: linear-gradient(transparent, rgba(255,255,255,.35), transparent);
}

.ecnU2BrandText {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ecnU2BrandText strong {
  color: #fff;
  font-size: clamp(28px, 2.55vw, 48px);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-shadow: 0 3px 14px rgba(0,0,0,.45);
}

.ecnU2BrandText small {
  color: #c7d7eb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 1.35vw, 24px);
  font-style: italic;
  line-height: 1.2;
}

.ecnU2Welcome {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ecn-u2-muted);
  white-space: nowrap;
}

.ecnU2Welcome > span:last-child {
  display: grid;
  gap: 2px;
}

.ecnU2Welcome b {
  color: var(--ecn-u2-cyan);
  font-size: 15px;
}

.ecnU2Welcome small {
  color: var(--ecn-u2-muted);
  font-size: 12px;
}

.ecnU2WelcomeIcon,
.ecnU2ButtonIcon,
.ecnU2NavIcon {
  display: inline-grid;
  place-items: center;
}

.ecnU2WelcomeIcon {
  width: 36px;
  height: 36px;
  color: var(--ecn-u2-cyan);
  border: 1px solid rgba(86, 200, 255, .35);
  border-radius: 50%;
}

.ecnU2WelcomeIcon svg,
.ecnU2ButtonIcon svg,
.ecnU2NavIcon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ecnUnifiedAuth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.ecnUnifiedAccountLink {
  max-width: 180px;
  overflow: hidden;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none !important;
  text-overflow: ellipsis;
}

.ecnUnifiedButton {
  display: inline-flex !important;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px !important;
  color: #fff !important;
  font: inherit !important;
  font-weight: 750 !important;
  text-decoration: none !important;
  background: rgba(7, 28, 61, .9) !important;
  border: 1px solid rgba(160, 199, 255, .55) !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  cursor: pointer;
}

.ecnUnifiedRegister,
.ecnUnifiedPrimary {
  background: linear-gradient(180deg, #278cf4, #0866cc) !important;
  border-color: #49a6ff !important;
}

.ecnUnifiedButton:hover,
.ecnUnifiedButton:focus-visible {
  transform: translateY(-1px);
  border-color: #70c4ff !important;
  box-shadow: 0 0 0 3px rgba(40, 143, 255, .18), 0 12px 28px rgba(0,0,0,.25);
}

.ecnU2MenuRail {
  padding: 12px 26px 14px;
  background: linear-gradient(180deg, rgba(11, 43, 83, .92), rgba(5, 27, 60, .96));
  border-top: 1px solid rgba(127, 185, 255, .25);
  border-bottom: 1px solid rgba(127, 185, 255, .25);
}

.ecnUnifiedMenu {
  display: grid !important;
  grid-template-columns: repeat(13, minmax(0, 1fr)) !important;
  gap: 8px !important;
  max-width: 1600px;
  margin: 0 auto !important;
  padding: 8px !important;
  overflow: visible !important;
  background: rgba(2, 15, 38, .52) !important;
  border: 1px solid rgba(107, 172, 255, .25) !important;
  border-radius: 28px !important;
  box-shadow: inset 0 1px rgba(255,255,255,.03);
}

.ecnUnifiedMenu > a {
  display: flex !important;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px !important;
  color: #eef7ff !important;
  font-size: clamp(10px, .72vw, 13px) !important;
  font-weight: 720 !important;
  line-height: 1.1 !important;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;
  background: rgba(7, 28, 62, .66) !important;
  border: 1px solid rgba(127, 185, 255, .22) !important;
  border-radius: 20px !important;
  box-sizing: border-box;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ecnUnifiedMenu > a:hover,
.ecnUnifiedMenu > a:focus-visible,
.ecnUnifiedMenu > a.active {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(24, 132, 255, .95), rgba(5, 82, 183, .95)) !important;
  border-color: rgba(84, 184, 255, .92) !important;
  box-shadow: 0 0 0 2px rgba(39, 143, 255, .14), 0 0 24px rgba(23, 126, 255, .32);
  transform: translateY(-1px);
}

.ecnU2NavIcon {
  flex: 0 0 auto;
  color: #fff;
}

.ecnU2NavIcon svg {
  width: 19px;
  height: 19px;
}

.ecnU2NavLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Remove old shared shells and legacy page chrome. */
.ecnLegacySiteHeaderHidden,
.ecnLegacyMainMenuHidden,
.ecnLegacyAuthControlHidden {
  display: none !important;
}

/* Sitewide visual foundation. */
body.ecnU2ThemeBody main,
body.ecnU2ThemeBody #wrap,
body.ecnU2ThemeBody .wrap,
body.ecnU2ThemeBody .ecnWrap,
body.ecnU2ThemeBody .page,
body.ecnU2ThemeBody .contentWrap,
body.ecnU2ThemeBody #portal,
body.ecnU2ThemeBody #main {
  color: var(--ecn-u2-text);
}

body.ecnU2ThemeBody a {
  color: #6dc3ff;
}

body.ecnU2ThemeBody h1,
body.ecnU2ThemeBody h2,
body.ecnU2ThemeBody h3,
body.ecnU2ThemeBody h4,
body.ecnU2ThemeBody h5,
body.ecnU2ThemeBody h6,
body.ecnU2ThemeBody strong,
body.ecnU2ThemeBody b {
  color: #fff;
}

body.ecnU2ThemeBody p,
body.ecnU2ThemeBody li,
body.ecnU2ThemeBody label,
body.ecnU2ThemeBody small,
body.ecnU2ThemeBody .muted,
body.ecnU2ThemeBody .sub,
body.ecnU2ThemeBody .description {
  color: var(--ecn-u2-muted);
}

body.ecnU2ThemeBody :is(
  .panel, .card, .box, .tile, .widget, .section, .contentCard, .sideCard,
  .toolCard, .adminCard, .settingsCard, .profileCard, .roomCard, .groupCard,
  .newsCard, .reportCard, .faqCard, .hero, .panelBody, .cardBody,
  [class*="Panel"], [class*="Card"], [class*="panel"], [class*="card"]
) {
  color: var(--ecn-u2-text);
  background-color: var(--ecn-u2-panel) !important;
  border-color: var(--ecn-u2-border) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

body.ecnU2ThemeBody :is(
  .panelHead, .panelTitle, .cardHead, .sectionTitle, .titleBar,
  [class*="Head"], [class*="Title"]
) {
  color: #fff !important;
  border-color: var(--ecn-u2-border) !important;
}

body.ecnU2ThemeBody input:not([type="checkbox"]):not([type="radio"]),
body.ecnU2ThemeBody select,
body.ecnU2ThemeBody textarea {
  color: #fff !important;
  background: rgba(2, 14, 35, .92) !important;
  border: 1px solid rgba(119, 180, 255, .42) !important;
  border-radius: 9px !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}

body.ecnU2ThemeBody input::placeholder,
body.ecnU2ThemeBody textarea::placeholder {
  color: #8198b4 !important;
}

body.ecnU2ThemeBody button,
body.ecnU2ThemeBody .btn,
body.ecnU2ThemeBody input[type="submit"],
body.ecnU2ThemeBody input[type="button"] {
  color: #fff !important;
  background: linear-gradient(180deg, #2089f2, #0863c4) !important;
  border: 1px solid #4aa8ff !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
}

body.ecnU2ThemeBody button:hover,
body.ecnU2ThemeBody .btn:hover {
  filter: brightness(1.08);
}

body.ecnU2ThemeBody table {
  color: var(--ecn-u2-text) !important;
  background: rgba(4, 20, 45, .88) !important;
  border-color: var(--ecn-u2-border) !important;
}

body.ecnU2ThemeBody th {
  color: #fff !important;
  background: linear-gradient(180deg, rgba(21, 95, 179, .95), rgba(8, 59, 122, .96)) !important;
  border-color: var(--ecn-u2-border) !important;
}

body.ecnU2ThemeBody td {
  color: #dfeaff !important;
  background: rgba(6, 28, 58, .74) !important;
  border-color: rgba(112, 165, 226, .22) !important;
}

body.ecnU2ThemeBody tr:nth-child(even) td {
  background: rgba(8, 36, 74, .78) !important;
}

body.ecnU2ThemeBody hr {
  border-color: var(--ecn-u2-border) !important;
}

body.ecnU2ThemeBody :is(.notice, .alert, .status, .message, .infoBox) {
  color: #dff2ff !important;
  background: rgba(8, 52, 101, .78) !important;
  border-color: rgba(90, 174, 255, .42) !important;
}

/* Hero-like sections receive the selected concept's network glow. */
body.ecnU2ThemeBody :is(.hero, .pageHero, .helpHero, .groupsHero, .portalHero) {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 44%, rgba(32, 153, 255, .33), transparent 24rem),
    linear-gradient(120deg, rgba(1, 13, 35, .98), rgba(5, 48, 102, .96)) !important;
  border: 1px solid rgba(82, 167, 255, .36) !important;
  border-radius: var(--ecn-u2-radius) !important;
}

body.ecnU2ThemeBody :is(.hero, .pageHero, .helpHero, .groupsHero, .portalHero)::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -150px;
  width: 540px;
  height: 540px;
  pointer-events: none;
  opacity: .45;
  border: 1px solid rgba(56, 173, 255, .48);
  border-radius: 50%;
  box-shadow:
    inset 0 0 80px rgba(0, 132, 255, .26),
    0 0 80px rgba(0, 132, 255, .15);
}

/* Keep specialized app canvases usable while matching the new shell. */
body.ecnU2ThemeBody iframe,
body.ecnU2ThemeBody canvas,
body.ecnU2ThemeBody video {
  max-width: 100%;
}

#ecnUnifiedSignInDialog[hidden] {
  display: none !important;
}

#ecnUnifiedSignInDialog {
  position: fixed;
  inset: 0;
  z-index: 10050;
}

.ecnUnifiedDialogBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 5, 16, .78);
  backdrop-filter: blur(6px);
}

.ecnUnifiedDialog {
  position: relative;
  width: min(430px, calc(100% - 32px));
  margin: 10vh auto 0;
  padding: 0;
  color: #fff;
  background: linear-gradient(180deg, #081d3e, #04132e);
  border: 1px solid rgba(99, 177, 255, .55);
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
}

.ecnUnifiedDialogHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ecn-u2-border);
}

.ecnUnifiedDialogHead h2 {
  margin: 0;
  font-size: 22px;
}

.ecnUnifiedDialogClose {
  width: 36px;
  height: 36px;
  padding: 0 !important;
}

#ecnUnifiedSignInForm {
  display: grid;
  gap: 16px;
  padding: 20px;
}

#ecnUnifiedSignInForm label {
  display: grid;
  gap: 7px;
}

#ecnUnifiedSignInForm input {
  min-height: 44px;
  padding: 8px 10px;
}

.ecnUnifiedDialogRegister {
  text-align: center;
}

@media (max-width: 1380px) {
  .ecnUnifiedBrandBar {
    grid-template-columns: 1fr auto;
  }

  .ecnU2Welcome {
    display: none;
  }

  .ecnUnifiedMenu {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .ecnUnifiedBrandBar {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 16px;
    padding: 16px 20px;
  }

  .ecnUnifiedAuth {
    justify-content: flex-start;
  }

  .ecnU2LogoWrap {
    width: 130px;
    min-width: 130px;
  }

  .ecnU2BrandDivider {
    height: 54px;
  }

  .ecnU2MenuRail {
    padding: 10px;
  }

  .ecnUnifiedMenu {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    border-radius: 18px !important;
  }

  .ecnUnifiedMenu > a {
    min-height: 44px;
    white-space: normal;
  }
}

@media (max-width: 540px) {
  .ecnUnifiedBrand {
    align-items: flex-start;
    gap: 12px;
  }

  .ecnU2LogoWrap {
    width: 90px;
    min-width: 90px;
  }

  .ecnU2BrandDivider {
    display: none;
  }

  .ecnU2BrandText strong {
    font-size: 23px;
  }

  .ecnU2BrandText small {
    font-size: 14px;
  }

  .ecnUnifiedMenu {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
