:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121d;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.9);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(14, 165, 233, 0.22), transparent 70%),
    radial-gradient(circle 500px at 90% 35%, rgba(99, 102, 241, 0.14), transparent),
    radial-gradient(circle 500px at 10% 65%, rgba(6, 182, 212, 0.12), transparent);
  min-height: 100vh;
}

body.drawer-open {
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(7, 9, 14, 0.88);
  border-bottom: 1px solid var(--border-card);
  z-index: 100;
  padding: 0.9rem 0;
  transition: var(--transition);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.logo span {
  background: linear-gradient(135deg, #fff 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
  transform: translateY(-2px);
}

.btn-admin {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.btn-admin:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: #818cf8;
  color: #fff;
  transform: translateY(-2px);
}

.btn-hero {
  padding: 0.85rem 1.85rem;
  font-size: 1.02rem;
}

.btn-block {
  width: 100%;
  padding: 0.85rem 1.25rem;
}

/* Hamburger Toggle Button */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-toggle .bar {
  width: 20px;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-toggle.open .bar-1 {
  transform: translateY(7px) rotate(45deg);
}

.mobile-toggle.open .bar-2 {
  opacity: 0;
}

.mobile-toggle.open .bar-3 {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer Menu */
.mobile-drawer {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(8, 12, 20, 0.97);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-drawer-inner {
  padding: 1.75rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav-link {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
  position: relative;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.88rem;
  font-weight: 500;
  color: #34d399;
  margin-bottom: 1.75rem;
  animation: pulse-glow 3s infinite;
  max-width: 100%;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  flex-shrink: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.1rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -1.5px;
  margin-bottom: 1.4rem;
  max-width: 940px;
  margin-left: auto;
  margin-right: auto;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 25%, #38bdf8 65%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.25rem;
  font-weight: 400;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

/* Metrics Ribbon */
.metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 4rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.4rem 1.25rem;
  backdrop-filter: blur(12px);
  text-align: left;
  transition: var(--transition);
}

.metric-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.metric-val {
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.metric-val span {
  font-size: 0.95rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.metric-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-title {
  text-align: center;
  margin-bottom: 3.25rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  margin-bottom: 0.6rem;
}

.section-title h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 0.75rem;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   Client Access Portals Section
   ========================================================================== */
.portals-section {
  padding: 2.5rem 0 4.5rem;
}

.portals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 22px;
  padding: 2.25rem;
  backdrop-filter: blur(16px);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0;
  transition: var(--transition);
}

.portal-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.portal-card:hover::before {
  opacity: 1;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.portal-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: var(--accent-cyan);
}

.icon-purple {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.portal-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.portal-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #fff;
}

.portal-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.portal-features {
  list-style: none;
  margin-bottom: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1.25rem;
}

.portal-features li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.portal-features li svg {
  color: var(--accent-cyan);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-portal {
  width: 100%;
  padding: 0.85rem 1.4rem;
  font-size: 0.98rem;
}

/* ==========================================================================
   Features Section
   ========================================================================== */
.features {
  padding: 3.5rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 1.15rem;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: #fff;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ==========================================================================
   Protocols & Server Connection Guide
   ========================================================================== */
.protocol-section {
  padding: 3.5rem 0 4.5rem;
}

.terminal-card {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: monospace;
}

.terminal-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.terminal-body {
  padding: 1.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.endpoint-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

.endpoint-box:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.endpoint-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.endpoint-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.copy-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  transition: var(--transition);
}

.endpoint-box:hover .copy-hint {
  color: var(--accent-cyan);
}

.endpoint-host {
  font-family: monospace;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.endpoint-meta {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.endpoint-auth {
  color: #38bdf8;
  font-size: 0.78rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--border-card);
  padding: 3rem 0;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.logo-icon-sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon-sm svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.6; }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Tablet & Mobile)
   ========================================================================== */

/* Tablet Landscape & Small Laptops (992px - 1199px) */
@media (max-width: 1199px) {
  .portals-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .portal-card {
    padding: 1.75rem;
  }

  .terminal-body {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Portrait (769px - 991px) */
@media (max-width: 991px) {
  .desktop-nav {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-drawer {
    display: block;
  }

  .portals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 3rd portal card spans full width on 2-col layout */
  .portals-grid .portal-card:last-child {
    grid-column: span 2;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }

  .terminal-body {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    padding: 3.5rem 0 2.5rem;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }

  .nav-webmail-btn span {
    display: inline;
  }

  .nav-webmail-btn {
    padding: 0.5rem 0.95rem;
    font-size: 0.85rem;
  }

  .portals-grid {
    grid-template-columns: 1fr;
  }

  .portals-grid .portal-card:last-child {
    grid-column: span 1;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .terminal-body {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
  }

  .metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .metric-card {
    padding: 1.1rem;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .logo span {
    font-size: 1.18rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .logo-icon svg {
    width: 18px;
    height: 18px;
  }

  .nav-webmail-btn span {
    display: none;
  }

  .nav-webmail-btn {
    padding: 0.5rem;
    border-radius: 10px;
  }

  .status-pill {
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
  }

  .portal-card {
    padding: 1.5rem;
    border-radius: 18px;
  }

  .metrics-ribbon {
    grid-template-columns: 1fr;
  }

  .metric-card {
    text-align: center;
  }

  .metric-val {
    justify-content: center;
  }
}
