/* File: public_html/phase2/assets/css/phase2.css */

/* FIXED: Strict Box-Sizing and Overflow locks to permanently prevent horizontal scrolling on mobile */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
}
*, *::before, *::after {
    box-sizing: border-box;
}

/* Dynamic Color Palette & eCitizen Theme */
:root {
    --bg-main: #e2e8f0; 
    --card-surface: #ffffff;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --brand-red: #d11f46;
    --brand-red-hover: #a31836;
    --border-color: #cbd5e1;
    
    --nav-bg: #0b1120;
    --nav-text: #f8fafc;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-main: #070b14;
    --card-surface: #111827;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #1f2937;
    --nav-bg: #070b14;
    --nav-text: #f8fafc;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, sans-serif;
    transition: var(--transition);
    position: relative;
}

/* Dynamic CNC Blueprint Motion Background */
body::before {
    content: ''; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 200vw; 
    height: 200vh;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px), linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px; 
    opacity: 0.15; 
    z-index: -999; 
    pointer-events: none;
    animation: cncPan 40s linear infinite;
}
@keyframes cncPan { 
    0% { transform: translate(0, 0); } 
    100% { transform: translate(-40px, -40px); } 
}

/* Universal Header */
.top-bar { display: flex; justify-content: space-between; padding: 10px 5vw; background: var(--brand-red); color: #fff; font-size: 0.85rem; font-weight: 600; flex-wrap: wrap; gap: 10px; width: 100%; }
.top-bar a { color: #fff; text-decoration: none; }

.site-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 5vw; background: var(--nav-bg); border-bottom: 2px solid var(--brand-red); position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,0.2); width: 100%; }
.site-logo img { transition: var(--transition); }

.site-nav { display: flex; gap: 25px; align-items: center; }
.site-nav a { text-decoration: none; color: var(--nav-text); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; transition: var(--transition); }
.site-nav a:hover, .site-nav a.active { color: var(--brand-red); }
.site-nav a.nav-btn { background: var(--brand-red); color: #fff; padding: 10px 25px; border-radius: 4px; box-shadow: 0 4px 10px rgba(209,31,70,0.3); display: inline-block; }

.mobile-toggle { display: none; background: transparent; border: none; font-size: 2rem; color: var(--nav-text); cursor: pointer; transition: var(--transition); position: relative; z-index: 1005; }
.mobile-toggle:hover { color: var(--brand-red); }

/* Perfectly Centered Hero */
.hero { position: relative; height: 85vh; min-height: 500px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; border-bottom: 5px solid var(--brand-red); width: 100%; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero-overlay { position: absolute; inset: 0; background: rgba(7, 11, 20, 0.75); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 900px; padding: 20px; display: flex; flex-direction: column; align-items: center; width: 100%; }
.hero-content h1 { color: #fff; font-size: clamp(2.5rem, 6vw, 4.5rem); text-transform: uppercase; font-weight: 900; margin: 15px 0; letter-spacing: -1px; text-shadow: 0 4px 15px rgba(0,0,0,0.5); line-height: 1.1; }
.hero-content p { color: #cbd5e1; font-size: clamp(1rem, 3vw, 1.25rem); margin-bottom: 35px; line-height: 1.6; max-width: 800px; }
.hero-badge { background: rgba(209,31,70,0.2); color: #ff4d6d; border: 1px solid var(--brand-red); padding: 8px 16px; font-weight: 800; border-radius: 4px; letter-spacing: 2px; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 10px; display: inline-block; }

/* eCitizen Cards & Grids */
.card-layout { padding: 80px 5vw; max-width: 1400px; margin: 0 auto; width: 100%; }
.grid-system { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.content-card { background: var(--card-surface); padding: 40px; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.04); transition: var(--transition); display: flex; flex-direction: column; word-wrap: break-word; }
.content-card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.08); border-color: var(--brand-red); }
.content-card h3 { color: var(--text-primary); font-size: 1.5rem; margin-top: 0; }
.content-card p { color: var(--text-muted); line-height: 1.7; flex-grow: 1; margin-bottom: 20px; }

/* Button Architecture */
.btn { display: inline-block; padding: 15px 35px; font-weight: 800; text-transform: uppercase; text-decoration: none; border-radius: 4px; transition: var(--transition); cursor: pointer; text-align: center; border: 2px solid transparent; }
.btn-red { background: var(--brand-red); color: #fff; box-shadow: 0 5px 15px rgba(209,31,70,0.3); }
.btn-red:hover { background: var(--brand-red-hover); transform: translateY(-2px); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: #fff; color: #000; }

/* Form Elements */
.form-group { margin-bottom: 20px; width: 100%; }
.form-group label { display: block; color: var(--text-primary); font-weight: 700; margin-bottom: 8px; text-transform: uppercase; font-size: 0.9rem; }
.form-control { width: 100%; padding: 15px; background: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-primary); border-radius: 4px; font-family: inherit; font-size: 1rem; transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--brand-red); box-shadow: 0 0 0 3px rgba(209,31,70,0.1); }

/* Logo Contrast Protector for Footer */
.partner-logos img { filter: drop-shadow(0px 2px 5px rgba(0,0,0,0.3)); max-height: 40px; transition: var(--transition); }
[data-theme="dark"] .partner-logos img { filter: drop-shadow(0px 2px 5px rgba(255,255,255,0.2)) brightness(1.2); }

/* Floating Controls */
.float-ctrl { position: fixed; bottom: 30px; right: 30px; display: flex; flex-direction: column; gap: 15px; z-index: 9999; }
.float-btn { background: var(--card-surface); color: var(--text-primary); border: 1px solid var(--border-color); width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.1); transition: var(--transition); }
.float-btn:hover { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }


/* =========================================
   MOBILE RESPONSIVENESS & MEDIA QUERIES
   ========================================= */

@media (max-width: 1024px) {
    .site-nav a { font-size: 0.8rem; padding: 5px; }
    .site-nav { gap: 15px; }
}

@media (max-width: 900px) {
    .mobile-toggle { display: block; }
    
    .site-nav { 
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: var(--nav-bg); 
        flex-direction: column; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.2); 
        max-height: 0; overflow: hidden; 
        transition: max-height 0.4s ease-in-out; 
        align-items: center;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    
    .site-nav.active { max-height: 600px; padding-bottom: 20px; }
    
    .site-nav a { width: 100%; padding: 15px 5vw; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: center; }
    .site-nav a.nav-btn { margin: 15px 5vw 0 5vw; width: calc(100% - 10vw); }
    
    .top-bar { flex-direction: column; text-align: center; gap: 10px; }
    .top-bar .contact-info { display: flex; flex-direction: column; gap: 5px; }
}

@media (max-width: 768px) {
    .grid-system { grid-template-columns: 1fr; }
    .card-layout { padding: 40px 5vw; }
    .content-card { padding: 25px; }
    .site-logo img { max-height: 60px !important; }
    .form-panel form div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .hero-content > div[style*="display: flex"] { flex-direction: column; width: 100%; }
    .hero-content .btn { width: 100%; }
    footer .grid-system { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    footer .grid-system > div { align-items: center; }
}