/*
 * Nucleus Design System
 * Southern Software, Inc.
 * Professional public safety platform styling
 */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --n-primary: #0066cc;
    --n-primary-dark: #004d99;
    --n-primary-light: #3399ff;
    --n-secondary: #00a86b;
    --n-secondary-dark: #008555;
    --n-accent-orange: #ff6b35;
    --n-accent-teal: #00bcd4;

    --n-dark: #0a1628;
    --n-dark-lighter: #1a2942;
    --n-gray-900: #111827;
    --n-gray-800: #1f2937;
    --n-gray-700: #374151;
    --n-gray-600: #4b5563;
    --n-gray-500: #6b7280;
    --n-gray-400: #9ca3af;
    --n-gray-300: #d1d5db;
    --n-gray-200: #e5e7eb;
    --n-gray-100: #f3f4f6;
    --n-gray-50: #f9fafb;
    --n-white: #ffffff;

    --n-danger: #e53e3e;
    --n-warning: #d69e2e;

    --n-gradient-primary: linear-gradient(135deg, #0066cc, #00a86b);
    --n-gradient-dark: linear-gradient(135deg, #0a1628, #1a2942);
    --n-gradient-hero: linear-gradient(135deg, #0a1628 0%, #0d2137 50%, #0a1628 100%);

    --n-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --n-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --n-shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --n-shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --n-shadow-glow: 0 0 40px rgba(0, 102, 204, 0.3);

    --n-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --n-radius: 8px;
    --n-radius-lg: 16px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--n-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--n-gray-800);
    background: var(--n-white);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--n-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--n-primary-dark); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.n-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 2rem;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    background: transparent;
}

.n-nav.scrolled {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.n-nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.n-nav-brand img {
    height: 36px;
    width: auto;
}

.n-nav-brand span {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--n-white);
    letter-spacing: -0.5px;
}

.n-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.n-nav-links a {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--n-radius);
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
}

.n-nav-links a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--n-secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.n-nav-links a:hover { color: var(--n-white); }
.n-nav-links a:hover::after { transform: scaleX(1); }

.n-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1.4rem;
    border-radius: var(--n-radius);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    font-family: var(--n-font);
}

.n-btn-primary {
    background: var(--n-gradient-primary);
    color: var(--n-white);
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.n-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--n-shadow-glow);
    color: var(--n-white);
}

.n-btn-outline {
    background: transparent;
    color: var(--n-white);
    border: 2px solid rgba(255,255,255,0.5);
}

.n-btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--n-white);
    color: var(--n-white);
}

.n-btn-secondary {
    background: var(--n-secondary);
    color: var(--n-white);
}

.n-btn-secondary:hover {
    background: var(--n-secondary-dark);
    transform: translateY(-2px);
    color: var(--n-white);
}

.n-btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.n-btn-white {
    background: var(--n-white);
    color: var(--n-primary);
    font-weight: 700;
}

.n-btn-white:hover {
    transform: translateY(-2px);
    box-shadow: var(--n-shadow-lg);
    color: var(--n-primary-dark);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.n-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--n-gradient-hero);
    position: relative;
    overflow: hidden;
    padding: 0 2rem;
}

.n-hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0,102,204,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.n-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--n-white), transparent);
    pointer-events: none;
}

.n-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.n-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(0, 168, 107, 0.15);
    border: 1px solid rgba(0, 168, 107, 0.3);
    border-radius: 50px;
    color: var(--n-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 28px;
    letter-spacing: 0.5px;
}

.n-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--n-white);
    line-height: 1.15;
    margin: 0 auto 24px;
    max-width: 900px;
    letter-spacing: -1px;
}

.n-hero h1 .n-gradient-text {
    background: var(--n-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.n-hero p {
    font-size: 1.2rem;
    color: var(--n-gray-400);
    max-width: 680px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.n-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.n-section {
    padding: 6rem 2rem;
}

.n-section-dark {
    background: var(--n-dark);
    color: var(--n-white);
}

.n-section-gray {
    background: var(--n-gray-50);
}

.n-container {
    max-width: 1200px;
    margin: 0 auto;
}

.n-section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.n-section-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(0, 102, 204, 0.1);
    color: var(--n-primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.n-section-dark .n-section-badge {
    background: rgba(0, 168, 107, 0.15);
    color: var(--n-secondary);
}

.n-section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0 0 16px;
    line-height: 1.2;
}

.n-section-header p {
    font-size: 1.1rem;
    color: var(--n-gray-500);
    line-height: 1.7;
    margin: 0;
}

.n-section-dark .n-section-header p {
    color: var(--n-gray-400);
}

/* ============================================================
   FEATURE CARDS (modules grid)
   ============================================================ */
.n-grid {
    display: grid;
    gap: 28px;
}

.n-grid-2 { grid-template-columns: repeat(2, 1fr); }
.n-grid-3 { grid-template-columns: repeat(3, 1fr); }
.n-grid-4 { grid-template-columns: repeat(4, 1fr); }

.n-card {
    background: var(--n-white);
    border: 1px solid var(--n-gray-200);
    border-radius: var(--n-radius-lg);
    padding: 2rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.n-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--n-gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.n-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--n-shadow-xl);
}

.n-card:hover::before {
    transform: scaleX(1);
}

.n-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.n-card-icon.blue { background: rgba(0,102,204,0.1); color: var(--n-primary); }
.n-card-icon.green { background: rgba(0,168,107,0.1); color: var(--n-secondary); }
.n-card-icon.orange { background: rgba(255,107,53,0.1); color: var(--n-accent-orange); }
.n-card-icon.teal { background: rgba(0,188,212,0.1); color: var(--n-accent-teal); }
.n-card-icon.purple { background: rgba(124,58,237,0.1); color: #7c3aed; }
.n-card-icon.red { background: rgba(229,62,62,0.1); color: var(--n-danger); }
.n-card-icon.indigo { background: rgba(67,56,202,0.1); color: #4338ca; }
.n-card-icon.amber { background: rgba(214,158,46,0.1); color: var(--n-warning); }
.n-card-icon.cyan { background: rgba(6,182,212,0.1); color: #06b6d4; }
.n-card-icon.emerald { background: rgba(16,185,129,0.1); color: #10b981; }

.n-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--n-gray-900);
}

.n-card p {
    font-size: 0.92rem;
    color: var(--n-gray-500);
    line-height: 1.65;
    margin: 0;
}

.n-card-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 14px;
}

.n-card-tag.core { background: rgba(0,102,204,0.1); color: var(--n-primary); }
.n-card-tag.operations { background: rgba(0,168,107,0.1); color: var(--n-secondary); }
.n-card-tag.compliance { background: rgba(255,107,53,0.1); color: var(--n-accent-orange); }
.n-card-tag.intelligence { background: rgba(124,58,237,0.1); color: #7c3aed; }

/* Dark section cards */
.n-section-dark .n-card {
    background: var(--n-dark-lighter);
    border-color: rgba(255,255,255,0.08);
}

.n-section-dark .n-card h3 { color: var(--n-white); }
.n-section-dark .n-card p { color: var(--n-gray-400); }

/* ============================================================
   STATS ROW
   ============================================================ */
.n-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 3rem 0;
}

.n-stat {
    text-align: center;
}

.n-stat-number {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--n-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.n-stat-label {
    font-size: 0.9rem;
    color: var(--n-gray-400);
    margin-top: 6px;
    font-weight: 500;
}

/* ============================================================
   VISION / CTA SECTION
   ============================================================ */
.n-cta {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--n-gradient-hero);
    position: relative;
}

.n-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, var(--n-white), transparent);
    pointer-events: none;
}

.n-cta h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--n-white);
    margin: 0 0 16px;
    letter-spacing: -0.5px;
}

.n-cta p {
    font-size: 1.15rem;
    color: var(--n-gray-400);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* ============================================================
   ARCHITECTURE SECTION
   ============================================================ */
.n-arch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--n-gray-200);
    border-radius: var(--n-radius-lg);
    overflow: hidden;
}

.n-arch-item {
    padding: 2rem;
    border-right: 1px solid var(--n-gray-200);
    border-bottom: 1px solid var(--n-gray-200);
    text-align: center;
    transition: background 0.2s;
}

.n-arch-item:nth-child(3n) { border-right: none; }
.n-arch-item:nth-last-child(-n+3) { border-bottom: none; }

.n-arch-item:hover { background: var(--n-gray-50); }

.n-arch-item i {
    font-size: 1.5rem;
    margin-bottom: 10px;
    display: block;
}

.n-arch-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.n-arch-item p {
    font-size: 0.82rem;
    color: var(--n-gray-500);
    margin: 0;
    line-height: 1.5;
}

/* ============================================================
   FOOTER
   ============================================================ */
.n-footer {
    background: var(--n-dark);
    color: var(--n-gray-400);
    padding: 4rem 2rem 2rem;
}

.n-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.n-footer-brand span {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--n-white);
    display: block;
    margin-bottom: 12px;
}

.n-footer-brand p {
    font-size: 0.88rem;
    line-height: 1.7;
    margin: 0;
}

.n-footer h4 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--n-gray-300);
    margin: 0 0 16px;
}

.n-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.n-footer ul li { margin-bottom: 10px; }

.n-footer ul a {
    color: var(--n-gray-400);
    font-size: 0.88rem;
    transition: color 0.2s;
}

.n-footer ul a:hover { color: var(--n-white); }

.n-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.82rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.n-login-page {
    min-height: 100vh;
    display: flex;
    background: var(--n-gradient-hero);
    position: relative;
    overflow: hidden;
}

.n-login-page::before {
    content: '';
    position: absolute;
    top: 30%;
    right: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0,102,204,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.n-login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    max-width: 560px;
}

.n-login-left h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--n-white);
    margin: 0 0 16px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.n-login-left p {
    font-size: 1.05rem;
    color: var(--n-gray-400);
    line-height: 1.7;
    margin: 0 0 32px;
}

.n-login-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.n-login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--n-gray-300);
    font-size: 0.92rem;
    padding: 8px 0;
}

.n-login-features li i {
    color: var(--n-secondary);
    font-size: 0.85rem;
    width: 20px;
    text-align: center;
}

.n-login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.n-login-card {
    background: var(--n-white);
    border-radius: var(--n-radius-lg);
    box-shadow: var(--n-shadow-xl);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
}

.n-login-card-header {
    padding: 32px 36px 24px;
    text-align: center;
    border-bottom: 1px solid var(--n-gray-100);
}

.n-login-card-header img {
    height: 44px;
    margin-bottom: 12px;
}

.n-login-card-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--n-gray-900);
    margin: 0 0 4px;
}

.n-login-card-header p {
    font-size: 0.85rem;
    color: var(--n-gray-500);
    margin: 0;
}

.n-login-card-body {
    padding: 32px 36px 36px;
}

.n-form-group {
    margin-bottom: 20px;
}

.n-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--n-gray-700);
    margin-bottom: 6px;
}

.n-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--n-gray-200);
    border-radius: var(--n-radius);
    font-size: 0.95rem;
    font-family: var(--n-font);
    transition: all 0.2s;
    background: var(--n-gray-50);
    color: var(--n-gray-900);
}

.n-form-input:focus {
    outline: none;
    border-color: var(--n-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    background: var(--n-white);
}

.n-form-input::placeholder { color: var(--n-gray-400); }

.n-password-wrap {
    position: relative;
}

.n-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--n-gray-400);
    font-size: 0.9rem;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 4px;
}

.n-password-toggle:hover { color: var(--n-primary); }

.n-form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0 24px;
}

.n-form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--n-primary);
    flex-shrink: 0;
    cursor: pointer;
}

.n-form-check label {
    font-size: 0.78rem;
    color: var(--n-gray-500);
    line-height: 1.5;
    cursor: pointer;
}

.n-btn-login {
    width: 100%;
    padding: 14px;
    background: var(--n-gradient-primary);
    color: var(--n-white);
    border: none;
    border-radius: var(--n-radius);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--n-font);
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 15px rgba(0,102,204,0.3);
}

.n-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--n-shadow-glow);
}

.n-btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.n-login-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
}

.n-login-links a {
    color: var(--n-gray-500);
    margin: 0 10px;
    transition: color 0.2s;
}

.n-login-links a:hover { color: var(--n-primary); }

.n-alert {
    padding: 14px 18px;
    border-radius: var(--n-radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.n-alert-danger {
    background: rgba(229,62,62,0.08);
    color: var(--n-danger);
    border: 1px solid rgba(229,62,62,0.2);
}

.n-login-footer {
    text-align: center;
    padding: 24px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.n-login-footer a { color: rgba(255,255,255,0.7); }
.n-login-footer a:hover { color: var(--n-white); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .n-hero h1 { font-size: 2.8rem; }
    .n-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .n-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .n-stats { grid-template-columns: repeat(2, 1fr); }
    .n-footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .n-arch-grid { grid-template-columns: repeat(2, 1fr); }
    .n-arch-item:nth-child(3n) { border-right: 1px solid var(--n-gray-200); }
    .n-arch-item:nth-child(2n) { border-right: none; }
}

@media (max-width: 768px) {
    .n-hero h1 { font-size: 2.2rem; }
    .n-section-header h2 { font-size: 2rem; }
    .n-grid-2, .n-grid-3, .n-grid-4 { grid-template-columns: 1fr; }
    .n-stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    .n-stat-number { font-size: 2.2rem; }
    .n-section { padding: 4rem 1.5rem; }
    .n-nav-links { display: none; }
    .n-footer-grid { grid-template-columns: 1fr; }
    .n-arch-grid { grid-template-columns: 1fr; }
    .n-arch-item { border-right: none !important; }

    .n-login-page { flex-direction: column; }
    .n-login-left { max-width: 100%; padding: 6rem 2rem 2rem; }
    .n-login-left h1 { font-size: 1.8rem; }
    .n-login-features { display: none; }
    .n-login-right { padding: 1rem 1.5rem 4rem; }
    .n-login-card-body { padding: 24px; }
    .n-login-card-header { padding: 24px; }
    .n-login-footer { position: relative; }
}

/* ============================================================
   MOBILE NAV TOGGLE
   ============================================================ */
.n-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--n-white);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .n-nav-toggle { display: block; }
}
