:root {
  --primary: #0a1630;
  --accent: #1a73e8;
  --accent-light: #e8f0fe;
  --success: #10b981;
  --white: #ffffff;
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --r-lg: 1.5rem;

  /* Global Auth Tokens */
  --auth-bg: rgba(255, 255, 255, 0.98);
  --auth-text: #0a1630;
  --auth-subtitle: #6e7a91;
  --auth-field-bg: #f9fbff;
  --auth-field-border: #d9e3f5;
  --auth-tab-bg: #f1f5fb;
  --auth-tab-active-bg: #fff;
  --auth-accent: var(--accent);
  --auth-shadow: 0 32px 100px rgba(0,0,0,0.18);

  --bg-main: #ffffff;
  --bg-soft: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
  --glass: rgba(255, 255, 255, 0.9);
  --glass-dark: rgba(10, 22, 48, 0.95);
  
  /* Heights */
  --h-btn-sm: 38px;
  --h-btn-md: 48px;
  --h-input: 52px;
  
  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

h1, h2, h3 {
  color: var(--primary);
  line-height: 1.2;
}

.hero { padding-top: 100px; }
h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 2rem; text-align: center; }
p { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--glass);
  backdrop-filter: blur(12px);
  z-index: 1000;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(26, 115, 232, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

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

/* UI Elements Enhancement */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.btn-sm {
  height: var(--h-btn-sm);
  padding: 0 16px;
  font-size: 13px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 16px rgba(26, 115, 232, 0.2);
}

.btn-primary:active { transform: scale(0.96); }

.btn-primary.logged-in {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 6px 12px rgba(26, 115, 232, 0.25);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
}

.btn-secondary {
  background: #f1f5fb;
  color: var(--primary);
}

.auth-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.auth-overlay.active { opacity: 1; pointer-events: all; }

.auth-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95);
  background: var(--auth-bg); border-radius: 28px; padding: 40px 32px; max-width: 440px; width: 92vw;
  max-height: 92vh; overflow-y: auto; z-index: 1001; opacity: 0; pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s; 
  box-shadow: var(--auth-shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  color: var(--auth-text);
}
.auth-modal.active { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: all; }

.auth-close {
  position: absolute; top: 18px; right: 20px; background: rgba(0,0,0,0.05); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 20px; cursor: pointer; color: #8a94a6; line-height: 32px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.auth-close:hover { background: rgba(0,0,0,0.1); color: var(--auth-text); }

/* Contact Section Styling */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  padding: 4rem 0;
}
.contact-info h2 { text-align: left; margin-bottom: 1.5rem; }
.contact-info p { max-width: 480px; }

.form-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid #f1f5f9;
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  height: var(--h-input);
  padding: 0 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--r-md);
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--bg-soft);
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

@media (max-width: 968px) {
  .contact-container { grid-template-columns: 1fr; gap: 3rem; }
  .contact-info h2 { text-align: center; }
  .contact-info p { text-align: center; margin: 0 auto 2rem; }
}

/* Modals & Overlays */
.auth-overlay, .dashboard-overlay, .drawer-overlay {
  position: fixed; inset: 0; background: rgba(10, 22, 48, 0.6); backdrop-filter: blur(8px);
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity .35s;
}
.auth-overlay.active, .dashboard-overlay.active, .drawer-overlay.active { opacity: 1; pointer-events: all; }

.auth-modal, .dashboard-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95);
  background: var(--bg-main); border-radius: var(--r-lg); padding: 40px 32px; 
  max-width: 440px; width: 92vw; max-height: 92vh; overflow-y: auto;
  z-index: 2001; opacity: 0; pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.35s; 
  box-shadow: 0 32px 100px rgba(0,0,0,0.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.auth-modal.active, .dashboard-modal.active { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: all; }

.dashboard-modal.glass-console {
  max-width: 700px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
}

/* Auth Decoration */
.auth-logo {
  width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #0f172a); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(26, 115, 232, 0.25);
}

.auth-tabs { display: flex; gap: 8px; background: #f1f5f9; padding: 4px; border-radius: 12px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 9px; cursor: pointer; font-weight: 700; color: #64748b; font-size: 14px; transition: 0.2s; }
.auth-tab.active { background: #fff; color: var(--accent); box-shadow: var(--shadow-sm); }

.auth-field { margin-bottom: 18px; }
.auth-field label { display: block; font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.auth-field input, .auth-field select, .auth-field textarea {
  width: 100%; height: var(--h-input); padding: 0 16px; border: 1px solid #e2e8f0; border-radius: var(--r-md);
  font-size: 15px; font-family: inherit; transition: border-color .25s; box-sizing: border-box;
}

.auth-submit {
  width: 100%; height: var(--h-input); border: none; border-radius: var(--r-md);
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
  transition: 0.3s; margin-bottom: 12px;
}
.auth-submit:hover { background: var(--accent-light); box-shadow: 0 10px 20px rgba(26, 115, 232, 0.2); }

.auth-form .auth-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.25s;
    background: transparent;
    border: 1px solid transparent;
}
.auth-form .auth-link:hover {
    background: rgba(26, 115, 232, 0.08);
    border-color: rgba(26, 115, 232, 0.2);
    color: var(--accent-light);
}

/* Dashboard UI */
.dashboard-superset { display: flex; flex-direction: column; gap: 24px; }
.dashboard-header { display: flex; align-items: center; gap: 20px; border-bottom: 1px solid #f1f5f9; padding-bottom: 20px; }
.dashboard-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }

.dashboard-tabs { display: flex; gap: 8px; background: #f1f5f9; border-radius: 16px; padding: 4px; }
.dashboard-tab { flex: 1; padding: 12px; border: none; background: transparent; border-radius: 12px; cursor: pointer; font-weight: 700; color: #64748b; font-size: 14px; }
.dashboard-tab.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }

.intelligence-score-card { background: #f8fafc; padding: 24px; border-radius: var(--r-lg); border: 1px solid #e2e8f0; margin-bottom: 24px; }
.intelligence-score-card h3 { font-size: 18px; margin-bottom: 16px; }

.score-row { margin-bottom: 16px; }
.score-info { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.score-track { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; background: var(--accent); border-radius: 4px; }

.dash-badge { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #e2e8f0; color: #475569; }
.dash-badge.admin { background: #dcfce7; color: #166534; }

/* Admin Grid */
.mgmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.mgmt-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 20px; text-align: center; }
.mgmt-card-stats { font-size: 28px; font-weight: 800; color: var(--accent); }

/* Visibility Engine Styles */
.visibility-card { background: #f8fafc; border-radius: 20px; padding: 24px; border: 1px solid #e2e8f0; margin-bottom: 24px; }
.visibility-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.engine-pulse { width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; transition: 0.3s; }
.engine-pulse.active { background: #10b981; box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); animation: pulse-anim 1.5s infinite; }
@keyframes pulse-anim { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } }
.engine-info { flex: 1; }
.engine-info strong { font-size: 15px; display: block; }
.engine-info div { font-size: 13px; color: #64748b; }

.visibility-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.v-stat { background: #fff; padding: 16px; border-radius: 16px; text-align: center; border: 1px solid #e2e8f0; }
.v-stat-val { font-size: 24px; font-weight: 800; display: block; color: var(--primary); }
.v-stat-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; }

/* portal Grid */
.portal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.portal-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 20px; text-align: center; transition: 0.3s; cursor: pointer; }
.portal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.portal-icon { font-size: 32px; margin-bottom: 12px; }
.portal-status { font-size: 12px; font-weight: 700; margin-top: 8px; }
.portal-status.connected { color: #10b981; }
.portal-status.disconnected { color: #94a3b8; }

/* Rules Engine */
.rules-header, .comm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rules-list { display: flex; flex-direction: column; gap: 12px; }
.rule-placeholder { text-align: center; padding: 40px; color: #94a3b8; font-style: italic; font-size: 14px; }
.rule-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; display: flex; justify-content: space-between; align-items: center; }

/* Plans & Billing */
.quota-section { background: #f1f5f9; padding: 20px; border-radius: 16px; margin-bottom: 24px; }
.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 24px; text-align: center; position: relative; }
.plan-card.featured { border: 2px solid var(--accent); background: linear-gradient(to bottom, #fff, #f0f7ff); }
.plan-name { font-weight: 800; margin-bottom: 8px; }
.plan-price { font-size: 24px; font-weight: 800; color: var(--primary); margin-bottom: 16px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 20px; font-size: 13px; color: #64748b; text-align: left; }
.plan-features li { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.plan-features li::before { content: "✓"; color: #10b981; font-weight: bold; }

/* Admin Console Sub-Tabs */
.sub-tabs { display: flex; gap: 12px; margin-bottom: 24px; border-bottom: 1px solid #f1f5f9; padding-bottom: 12px; }
.sub-tab { background: none; border: none; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer; transition: 0.2s; }
.sub-tab.active { background: var(--accent); color: #fff; }

.table-container { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { background: #f8fafc; padding: 16px; font-size: 12px; font-weight: 800; color: #64748b; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; }
.admin-table td { padding: 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.admin-table tr:last-child td { border-bottom: none; }

/* Mobile Specifics */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; z-index: 2200; padding: 10px; -webkit-tap-highlight-color: transparent; position: relative; }
.hamburger span { width: 24px; height: 2.5px; background: var(--primary); border-radius: 2.5px; transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); transform-origin: center; }

.hamburger.active span { background: var(--primary); }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-drawer {
  position: fixed; top: 0; right: -280px; width: 280px; height: 100vh;
  background: #ffffff; z-index: 2100; padding: 100px 24px;
  transition: transform 0.35s cubic-bezier(0.645, 0.045, 0.355, 1);
  display: flex; flex-direction: column; gap: 24px; align-items: center; box-shadow: -10px 0 50px rgba(0,0,0,0.08); border-left: 1px solid #e2e8f0;
}
.drawer-open { transform: translateX(-280px); }
.drawer-links { width: 100%; display: flex; flex-direction: column; gap: 0; align-items: stretch; }
.drawer-links a { 
  font-size: 0.95rem; font-weight: 700; color: #334155; text-decoration: none; 
  text-transform: uppercase; letter-spacing: 1.5px; padding: 20px 0; text-align: center; border-bottom: 1px solid #f1f5f9; transition: all 0.25s;
}
.drawer-links a:hover { color: var(--accent); transform: scale(1.05); }

/* Standardized Buttons */
.btn-lg { height: 52px; padding: 0 32px; font-size: 16px; border-radius: 26px; margin-bottom: 2rem; }
.btn-secondary.pill { 
  height: 38px !important; padding: 0 28px; border-radius: 19px !important; font-weight: 700; font-size: 14px; 
  display: inline-flex; justify-content: center; align-items: center; text-transform: uppercase; letter-spacing: 1px;
}
.mobile-drawer a.pill { align-self: center; width: auto; min-width: 140px; margin-top: 24px; }

.submit-btn {
  width: 100%;
  height: 48px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}
.submit-btn:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(26, 115, 232, 0.2); }

/* Footer */
footer {
  padding: 4rem 0 2rem;
  background: var(--bg-soft);
  border-top: 1px solid #e2e8f0;
  text-align: center;
}
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin-bottom: 1.5rem;
}
.footer-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
}
.footer-nav a:hover { color: var(--accent); }
.copyright { color: #94a3b8; font-size: 0.8rem; }

@media (max-width: 968px) {
  h1 { font-size: 2.5rem; text-align: center; }
  .hero-content { flex-direction: column; text-align: center; gap: 3rem; padding-top: 100px; }
  .hero-text { order: 2; }
  .hero-visual { order: 1; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  
  .features-grid, .contact-container, .showcase-content { grid-template-columns: 1fr; }
  
  .auth-modal { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .phone-row { flex-direction: column; }
  .phone-row select { width: 100%; }
  .auth-field input { width: 100% !important; }
}
