/* ============================================
   FreeITSM - Global Design System
   ============================================ */

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

/* --- CSS Variables --- */
:root {
    /* Primary brand */
    --color-primary: #2d6a4f;
    --color-primary-light: #40916c;
    --color-primary-dark: #1b4332;

    /* Warm accent */
    --color-accent: #e76f51;
    --color-accent-light: #f4a261;

    /* Neutrals */
    --color-bg: #faf8f5;
    --color-bg-alt: #f0ede8;
    --color-surface: #ffffff;
    --color-text: #2c3e50;
    --color-text-secondary: #5a6c7d;
    --color-text-light: #8896a4;
    --color-border: #e0dbd3;

    /* Module colors */
    --mod-tickets: #0078d4;
    --mod-assets: #107c10;
    --mod-knowledge: #8764b8;
    --mod-changes: #00897b;
    --mod-calendar: #ef6c00;
    --mod-checks: #00acc1;
    --mod-reporting: #ca5010;
    --mod-software: #5c6bc0;
    --mod-forms: #00897b;
    --mod-wiki: #c62828;

    /* Typography */
    --font-primary: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Cascadia Code', 'Consolas', 'SF Mono', monospace;

    /* Type scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Misc */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* --- Base --- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-light);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    color: var(--color-text);
}

h1 { font-size: var(--text-5xl); font-weight: 300; }
h2 { font-size: var(--text-3xl); font-weight: 600; }
h3 { font-size: var(--text-2xl); font-weight: 600; }
h4 { font-size: var(--text-xl); font-weight: 600; }

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-4xl) 0;
}

.section-alt {
    background: var(--color-bg-alt);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    font-size: var(--text-lg);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    z-index: 10000;
    font-size: var(--text-sm);
}

.skip-link:focus {
    top: 10px;
    color: white;
}

/* ============================================
   Header / Navigation
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    padding-bottom: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-size: var(--text-xl);
    font-weight: 700;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
}

.logo span {
    color: var(--color-primary);
}

.site-header nav {
    flex: 1;
    position: relative;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    padding-right: 120px;
}

.nav-links > li:last-child {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.nav-break {
    flex-basis: 100%;
    height: 0;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--color-primary);
    background: rgba(45, 106, 79, 0.06);
}

.nav-links a.active {
    color: var(--color-primary);
    background: rgba(45, 106, 79, 0.1);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: #24292e;
    color: white !important;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: var(--transition);
}

.nav-cta:hover {
    background: #1a1e22;
    color: white !important;
    transform: translateY(-1px);
}

.nav-cta svg {
    width: 18px;
    height: 18px;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text);
    margin-left: auto;
}

.hamburger svg {
    width: 24px;
    height: 24px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .site-header nav {
        flex: none;
        position: static;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        flex-direction: column;
        padding: var(--space-md);
        padding-right: var(--space-md);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        gap: var(--space-xs);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links > li:last-child {
        position: static;
        transform: none;
    }

    .nav-break {
        display: none;
    }

    .nav-links a {
        padding: 12px 16px;
        font-size: var(--text-base);
    }

    .nav-cta {
        justify-content: center;
        padding: 12px 20px;
    }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    font-family: var(--font-primary);
    line-height: 1;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.btn-github {
    background: #24292e;
    color: white;
}

.btn-github:hover {
    background: #1a1e22;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(36, 41, 46, 0.3);
}

.btn-lg {
    padding: 16px 36px;
    font-size: var(--text-lg);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Module Icon Component
   ============================================ */
.module-icon-sm {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-icon-sm svg {
    width: 24px;
    height: 24px;
    color: white;
}

.module-icon-lg {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-icon-lg svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* Module color backgrounds */
.bg-tickets { background: linear-gradient(135deg, #0078d4, #106ebe); }
.bg-assets { background: linear-gradient(135deg, #107c10, #0b5c0b); }
.bg-knowledge { background: linear-gradient(135deg, #8764b8, #6b4fa2); }
.bg-changes { background: linear-gradient(135deg, #00897b, #00695c); }
.bg-calendar { background: linear-gradient(135deg, #ef6c00, #e65100); }
.bg-checks { background: linear-gradient(135deg, #00acc1, #00838f); }
.bg-reporting { background: linear-gradient(135deg, #ca5010, #a5410a); }
.bg-software { background: linear-gradient(135deg, #5c6bc0, #3f51b5); }
.bg-forms { background: linear-gradient(135deg, #00897b, #00695c); }
.bg-wiki { background: linear-gradient(135deg, #c62828, #b71c1c); }
.bg-contracts { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-service-status { background: linear-gradient(135deg, #10b981, #059669); }
.bg-watchtower { background: linear-gradient(135deg, #1e293b, #0f172a); }
.bg-tasks { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.bg-lms { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.bg-process-mapper { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.bg-system { background: linear-gradient(135deg, #546e7a, #37474f); }

/* Module text colors */
.text-tickets { color: #0078d4; }
.text-assets { color: #107c10; }
.text-knowledge { color: #8764b8; }
.text-changes { color: #00897b; }
.text-calendar { color: #ef6c00; }
.text-checks { color: #00acc1; }
.text-reporting { color: #ca5010; }
.text-software { color: #5c6bc0; }
.text-forms { color: #00897b; }
.text-wiki { color: #c62828; }
.text-contracts { color: #f59e0b; }
.text-service-status { color: #10b981; }
.text-watchtower { color: #1e293b; }

/* Module badge */
.module-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--color-text);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-3xl);
    margin-bottom: var(--space-3xl);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-top: var(--space-md);
}

.footer-brand .logo {
    color: white;
}

.footer-col h4 {
    color: white;
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-lg);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: var(--space-sm);
}

.footer-col a {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    transition: color 0.2s;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
}

.footer-tagline {
    font-style: italic;
    color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- Page Header Banner --- */
.page-header {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    padding: var(--space-2xl) 0;
    text-align: center;
}

.page-header h1 {
    color: white;
    font-size: var(--text-4xl);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.page-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-lg);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Back to Top Button --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 900;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* --- Placeholder Image --- */
.placeholder-img {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: var(--text-sm);
    aspect-ratio: 16 / 9;
    gap: var(--space-sm);
}

.placeholder-img svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* ============================================
   Cookie Consent Banner
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 2px solid var(--color-primary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    padding: var(--space-lg);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.cookie-banner-text {
    flex: 1;
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.6;
}

.cookie-banner-text strong {
    font-weight: 600;
    color: var(--color-text);
}

.cookie-banner-text a {
    color: var(--color-primary);
    text-decoration: underline;
    margin-left: 4px;
}

.cookie-banner-text a:hover {
    color: var(--color-primary-light);
}

.cookie-banner-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: var(--color-primary);
    color: white;
}

.cookie-btn-accept:hover {
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

.cookie-btn-decline {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.cookie-btn-decline:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .cookie-banner-buttons {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
    }
}
