/* ═══════ CompanyBrain Landing — Global Reset ═══════ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    /* Prevent iOS text zoom on orientation change */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #0a0a0f;
    color: rgba(255, 255, 255, 0.92);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* overflow-x: clip does NOT create a scroll container, so position:fixed
   children (the mobile drawer) stay fixed to the viewport on iOS Safari.
   overflow-x: hidden on body/html is the classic iOS Safari fixed-position bug. */
body {
    overflow-x: clip;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Selection */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ═══════════════════════════════════════════════════════════════════
   Auth-aware Navigation Visibility
   ═══════════════════════════════════════════════════════════════════ */

/* By default: show guest items, hide authenticated items */
.nav-auth-only {
    display: none !important;
}

/* When user is authenticated: hide guest items, show authenticated items */
body.user-authenticated .nav-guest-only {
    display: none !important;
}

body.user-authenticated .nav-auth-only {
    display: flex !important;
}

body.user-authenticated hr.nav-auth-only {
    display: block !important;
}

body.user-authenticated a.nav-auth-only {
    display: flex !important;
}

/* ═══════════════════════════════════════════════════════════════════
   Mobile Responsive Navigation
   ═══════════════════════════════════════════════════════════════════ */

/* Hide mobile menu button by default (desktop) */
.mobile-menu-btn {
    display: none !important;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s ease;
}

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

/* Hide mobile drawer on desktop */
.mobile-nav-overlay,
.mobile-nav-drawer {
    display: none !important;
}

/* Desktop navigation visible by default */
.desktop-nav {
    display: flex !important;
}

/* Mobile overlay - full screen dark backdrop */
.mobile-nav-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 9998 !important;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
    visibility: visible;
}

/* Mobile drawer - slides in from right */
.mobile-nav-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(320px, 85vw) !important;
    height: 100vh !important;
    height: -webkit-fill-available !important;
    z-index: 9999 !important;
    background: rgba(18, 18, 26, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex !important;
    flex-direction: column !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.mobile-nav-open .mobile-nav-drawer {
    transform: translateX(0);
}

/* Drawer header */
.mobile-nav-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

/* Drawer nav menu */
.mobile-nav-menu {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Nav links in drawer */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.mobile-nav-link .mud-icon-root {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.25rem;
}

/* Register button in drawer */
.mobile-nav-register {
    display: block;
    text-align: center;
    color: #001f24;
    border-radius: 10px;
    text-transform: none;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.mobile-nav-register:hover {
    opacity: 0.9;
}

/* Close button in drawer */
.mobile-nav-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.2s ease;
}

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

/* Divider in drawer */
.mobile-nav-divider {
    margin: 1rem 0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Animations */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tablet breakpoint (960px and below) */
@media (max-width: 960px) {
    /* Hide desktop navigation */
    .desktop-nav {
        display: none !important;
    }
    
    /* Show hamburger menu button in AppBar */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: 8px;
    }
    
    /* Show mobile overlay and drawer */
    .mobile-nav-overlay {
        display: block !important;
    }
    
    .mobile-nav-drawer {
        display: flex !important;
    }
    /* NOTE: No overflow:hidden on body here — that breaks position:fixed on iOS Safari.
       The full-screen overlay intercepts all touch/click events instead. */
}

/* Mobile breakpoint (600px and below) */
@media (max-width: 600px) {
    /* Reduce logo text size on mobile */
    .brand-name {
        font-size: 1rem !important;
    }
    
    /* Footer stacks vertically on mobile */
    .mobile-footer-stack {
        flex-direction: column !important;
        gap: 1.5rem;
        text-align: center;
    }
    
    .mobile-footer-stack > .mud-stack {
        align-items: center;
    }
}
/* ═══════ iOS / iPhone Safari Fixes ═══════ */

/* Footer: home-indicator clearance */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    footer > .mud-container {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* Hero section: account for taller navbar on notched iPhones */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 640px) {
        .nexus-hero-section {
            padding-top: calc(3.5rem + env(safe-area-inset-top)) !important;
        }
    }
}

/* CTA section: full-width buttons on small phones */
@media (max-width: 640px) {
    .landing-cta__actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .landing-cta__actions .nexus-button {
        width: 100% !important;
        min-width: unset !important;
    }
}

/* iPhone SE / mini: tighten hero title */
@media (max-width: 375px) {
    .nexus-hero-title {
        font-size: clamp(2.4rem, 14vw, 3.2rem) !important;
        line-height: 0.95 !important;
    }
}

/* Tap highlight & touch-action fixes */
.nexus-button,
.mobile-menu-btn,
.mobile-nav-link,
.mobile-nav-register,
.mobile-nav-close {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* iOS momentum scrolling on scroll containers */
.mobile-nav-menu {
    -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════════
   Shared Landing Page Utilities
   Used by /pricing, /about, /integrations, /security, /status
   ═══════════════════════════════════════════════════════════════════ */

.lp-page {
    position: relative;
    background:
        radial-gradient(circle at 50% 10%, color-mix(in srgb, var(--tenant-primary, #00daf3) 10%, transparent) 0%, transparent 30%),
        linear-gradient(180deg, #0a0e18 0%, #0f131d 100%);
    color: #dfe2f1;
    min-height: 100vh;
}

.lp-hero {
    padding: 7rem 0 4rem;
    text-align: center;
}

.lp-hero__label {
    display: inline-block;
    margin: 0 auto 1.2rem;
    color: #9cf0ff;
    font: 600 0.7rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.lp-hero__title {
    margin: 0 auto 1.2rem;
    max-width: 820px;
    color: transparent;
    background: linear-gradient(135deg, var(--tenant-primary, #00daf3) 0%, #d0bcff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    font: 700 clamp(2.6rem, 6vw, 4.8rem)/1.05 "Space Grotesk", Inter, sans-serif;
    letter-spacing: -0.04em;
    animation: lp-gradient-shift 8s ease-in-out infinite;
}

@keyframes lp-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

.lp-hero__sub {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: rgba(255, 255, 255, 0.6);
    font: 300 1.1rem/1.65 Inter, system-ui, sans-serif;
}

.lp-section {
    padding: 5rem 0;
}

.lp-section--alt {
    background: rgba(255, 255, 255, 0.015);
}

.lp-label {
    display: inline-block;
    margin: 0 0 0.75rem;
    color: #9cf0ff;
    font: 600 0.68rem/1 Inter, system-ui, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.lp-heading {
    margin: 0 0 1rem;
    color: #fff;
    font: 700 clamp(1.8rem, 3.5vw, 2.8rem)/1.15 "Space Grotesk", Inter, sans-serif;
    letter-spacing: -0.02em;
}

.lp-subheading {
    margin: 0 0 3rem;
    color: rgba(255, 255, 255, 0.55);
    font: 300 1rem/1.65 Inter, system-ui, sans-serif;
    max-width: 560px;
}

.lp-glass {
    background: rgba(38, 42, 53, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 42px rgba(0, 218, 243, 0.05);
    border-radius: 1.5rem;
    position: relative;
    overflow: hidden;
}

.lp-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.03) 50%, transparent 60%);
    transition: transform 0.8s ease;
    transform: translateX(-100%);
    pointer-events: none;
}

.lp-glass:hover::before {
    transform: translateX(100%);
}

.lp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 50px;
    padding: 0.7rem 1.8rem;
    border-radius: 0.6rem;
    font: 700 0.95rem/1 Inter, system-ui, sans-serif;
    text-decoration: none;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
}

.lp-btn:hover { transform: translateY(-2px); }

.lp-btn--primary {
    color: #fff;
    background: var(--tenant-primary, #00daf3);
}

.lp-btn--primary:hover {
    filter: brightness(1.12);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--tenant-primary, #00daf3) 40%, transparent);
}

.lp-btn--secondary {
    color: var(--tenant-primary, #00daf3);
    background: transparent;
    border: 1px solid var(--tenant-primary, #00daf3);
}

.lp-btn--secondary:hover {
    background: color-mix(in srgb, var(--tenant-primary, #00daf3) 10%, transparent);
    color: #fff;
}

.lp-cta-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.lp-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tenant-primary, #00daf3) 15%, transparent);
    color: var(--tenant-primary, #00daf3);
    flex-shrink: 0;
    font-size: 0.75rem;
}

.lp-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.25);
    flex-shrink: 0;
    font-size: 0.75rem;
}