/*
  portal-ui.css
  Lightweight CSS for config-driven portal header/footer.
  Inspired by MVP_TEMPLATE_CLEARGEO public/assets/site.css (simplified).
*/

:root {
  --bg: #0b1220;
  --panel: #0f1a2f;
  --card: #101f3d;
  --text: #e9eefc;
  --muted: #aeb9da;
  --border: rgba(233, 238, 252, 0.14);
  --accent: #5cc8ff;
  --accent2: #8b5cff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --cvg-global-nav-height: 0px;
}

/* Only apply the theme when explicitly opted-in (body.portal-ui). */
body.portal-ui {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% 0%, rgba(92, 200, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(139, 92, 255, 0.12), transparent 55%),
    #0b1220;
  color: var(--text);
  line-height: 1.45;
}

body.portal-ui a {
  color: var(--accent);
}

body.portal-ui .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 14px;
}

/* -------------------------------------------------------------------------
   CVG Network banner (global nav)
   ------------------------------------------------------------------------- */

body.portal-ui #cvg-global-nav {
  background: rgba(11, 18, 32, 0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 9999;
}

body.portal-ui .cvg-global-nav__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

body.portal-ui .cvg-global-nav__brand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
  letter-spacing: 0.2px;
}

body.portal-ui .cvg-global-nav__brand-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--shadow);
}

body.portal-ui .cvg-global-nav__links {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

body.portal-ui .cvg-global-nav__link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: rgba(16, 31, 61, 0.45);
}

body.portal-ui .cvg-global-nav__more {
  position: relative;
}

body.portal-ui .cvg-global-nav__more-btn {
  width: auto;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(16, 31, 61, 0.45);
  color: var(--text);
  cursor: pointer;
}

body.portal-ui .cvg-global-nav__dropdown {
  position: absolute;
  right: 0;
  margin-top: 10px;
  min-width: 320px;
  max-width: 420px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 26, 47, 0.98);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
}

body.portal-ui .cvg-global-nav__dropdown.is-open {
  display: block;
}

body.portal-ui .cvg-global-nav__dropdown-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
}

body.portal-ui .cvg-global-nav__dropdown-item:hover {
  background: rgba(16, 31, 61, 0.55);
}

body.portal-ui .cvg-global-nav__dropdown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(16, 31, 61, 0.55);
  border: 1px solid var(--border);
}

body.portal-ui .cvg-global-nav__dropdown-text {
  display: grid;
  gap: 2px;
}

body.portal-ui .cvg-global-nav__dropdown-text span {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 520px) {
  body.portal-ui .cvg-global-nav__dropdown {
    left: 0;
    right: 0;
    min-width: auto;
    width: calc(100vw - 28px);
  }
}

/* -------------------------------------------------------------------------
   Topbar
   ------------------------------------------------------------------------- */

body.portal-ui .topbar {
  position: sticky;
  top: var(--cvg-global-nav-height, 0px);
  z-index: 9998;
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

body.portal-ui .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

body.portal-ui .brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: var(--shadow);
}

body.portal-ui .brand-tagline {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

body.portal-ui .nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

body.portal-ui .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: rgba(16, 31, 61, 0.55);
}

body.portal-ui .nav-link.is-active {
  border-color: rgba(92, 200, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(92, 200, 255, 0.12);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

body.portal-ui .site-footer {
  margin-top: 34px;
  border-top: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.55);
}

body.portal-ui .footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 22px 0 12px;
}

@media (min-width: 900px) {
  body.portal-ui .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.portal-ui .footer-title {
  font-weight: 800;
  margin-bottom: 6px;
}

body.portal-ui .footer-links {
  display: grid;
  gap: 6px;
}

body.portal-ui .footer-bottom {
  padding: 10px 0 24px;
  border-top: 1px solid var(--border);
}

body.portal-ui .muted {
  color: var(--muted);
}

/* -------------------------------------------------------------------------
   Layout components (hero/card/button/pill) inspired by MVP_TEMPLATE_CLEARGEO
   public/assets/site.css, scoped to body.portal-ui
   ------------------------------------------------------------------------- */

body.portal-ui .hero {
  margin-top: 18px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 31, 61, 0.85), rgba(16, 31, 61, 0.65));
  box-shadow: var(--shadow);
}

body.portal-ui .hero h1 {
  margin: 0 0 8px 0;
  font-size: 1.55rem;
  line-height: 1.15;
}

body.portal-ui .hero p {
  margin: 0;
  color: var(--muted);
}

body.portal-ui .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (min-width: 860px) {
  body.portal-ui .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.portal-ui .card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(16, 31, 61, 0.7);
  box-shadow: var(--shadow);
  padding: 14px;
}

body.portal-ui .card h2 {
  margin: 0 0 8px 0;
  font-size: 1.15rem;
}

body.portal-ui .button,
body.portal-ui button {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(233, 238, 252, 0.18);
  background: linear-gradient(135deg, rgba(92, 200, 255, 0.95), rgba(139, 92, 255, 0.95));
  color: #07101d;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

body.portal-ui .button.secondary,
body.portal-ui button.secondary {
  background: rgba(16, 31, 61, 0.55);
  color: var(--text);
  border: 1px solid var(--border);
}

body.portal-ui .button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  body.portal-ui .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.portal-ui .cta-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

@media (min-width: 560px) {
  body.portal-ui .cta-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body.portal-ui .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

body.portal-ui .pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 26, 47, 0.55);
  color: var(--muted);
  font-size: 0.9rem;
}
