:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f1626;
  --bg-card: #121b2e;
  --bg-card-hover: #18233a;
  --border-color: #1e293b;
  --border-accent: rgba(56, 189, 248, 0.35);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-green: #34d399;
  --accent-amber: #fbbf24;
  --accent-red: #f87171;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.08), transparent 45%),
              radial-gradient(circle at 85% 20%, rgba(129, 140, 248, 0.08), transparent 40%),
              var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #090d16;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.env-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.env-badge.prod {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
  border-color: rgba(52, 211, 153, 0.3);
}

/* Auth Controls (Portal Only) */
.auth-header-widget {
  display: none;
  align-items: center;
  gap: 10px;
}

.btn-auth-login {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.18));
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-auth-login:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: border-color 0.2s;
}

.user-profile-pill:hover {
  border-color: var(--accent-cyan);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #090d16;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-display-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.user-flyout {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  padding: 14px;
  z-index: 200;
}

.user-flyout.active {
  display: block;
}

.flyout-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.flyout-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.flyout-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.flyout-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.flyout-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
}

.flyout-row span:last-child {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.flyout-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.btn-flyout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-flyout:hover {
  background: rgba(56, 189, 248, 0.12);
}

.btn-flyout.danger {
  color: var(--accent-red);
}

.btn-flyout.danger:hover {
  background: rgba(248, 113, 113, 0.14);
}

/* Hero Section */
.hero {
  padding: 76px 0 56px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  max-width: 700px;
  margin: 0 auto 28px;
  font-size: 1.08rem;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #090d16;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
}

/* Portal Workspace Section (alpha.ibernet.id / app.ibernet.id only) */
.portal-section {
  display: none;
  margin: 24px 0 48px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 27, 46, 0.95), rgba(15, 22, 38, 0.95));
  border: 1px solid var(--border-accent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.portal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.portal-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.portal-status-chip.authenticated {
  background: rgba(52, 211, 153, 0.12);
  color: var(--accent-green);
  border-color: rgba(52, 211, 153, 0.35);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.portal-gate-box {
  padding: 28px;
  border-radius: var(--radius-md);
  background: rgba(9, 13, 22, 0.55);
  border: 1px dashed var(--border-color);
  text-align: center;
}

.portal-gate-box h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.portal-gate-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.subapps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.subapp-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.2s;
}

.subapp-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.subapp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subapp-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.subapp-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.subapp-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.sapi-telemetry-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #060911;
  border: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

/* Company Profile Sections */
.section {
  padding: 52px 0;
  border-top: 1px solid rgba(30, 41, 59, 0.6);
}

.section-heading {
  margin-bottom: 28px;
}

.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.section-heading h2 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-heading p {
  color: var(--text-muted);
  margin-top: 6px;
  max-width: 680px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s;
}

.info-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.info-card-icon {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.info-card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
  color: #fff;
}

.info-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-banner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.86rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }
}
