@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --primary-blue: #0046ad;
    --primary-blue-dark: #002d70;
    --accent-red: #e63946;
    --accent-red-hover: #c1121f;
    --text-dark: #1a1a1a;
    --text-light: #f8f9fa;
    --white: #ffffff;
    --bg-light: #f4f7f6;
    --bg-dark: #0a0a0a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Spacing & Borders */
    --section-padding: 80px 0;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--white);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 50px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-red);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

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

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

.btn-accent:hover {
    background-color: var(--accent-red-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
}

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

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
header {
    background: var(--white);
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-blue);
}

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

/* Brand logo image. Replaces the old OPES/WARE wordmark in the header,
   footer, account pages and forms. The -white variant keeps the blue ring
   and pixel-dots but turns the wordmark white for dark backgrounds. */
.logo-img {
    height: 42px;
    width: auto;
    display: block;
    /* nav is a flex row: without this the anchor is shrunk by .nav-links
       and the wordmark is squashed to a sliver instead of scaling. */
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img-sm {
    height: 34px;
}

.logo-img-lg {
    height: 56px;
}

footer .logo-img,
.logo-img-white {
    height: 38px;
}

@media (max-width: 768px) {
    .logo-img {
        height: 32px;
    }

    .logo-img-lg {
        height: 44px;
    }
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a:hover {
    color: var(--accent-red);
}

/* Hero Section */
.hero {
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-blue-dark) 0%, #001a4d 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('hero-pattern.svg'); /* To be added or generated */
    opacity: 0.1;
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 25px;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 35px;
    opacity: 0.9;
}

/* Cards & Sections */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #eee;
}

.card:hover {
    transform: translateY(-10px);
}

.card i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

/* Contact cards on the quote page. The EN page had lost its flex wrapper, so
   three cards with inline flex:1 sat as orphans and stacked at 350px. */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    align-items: stretch;
    text-align: center;
}

@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    background: #111;
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
    color: #888;
}

/* Responsive */
@media (max-width: 768px) {
    /* Mobile drawer. Slides in from the right, fills the viewport below the
       header so page content never shows through, and left-aligns every row.
       The !important rules override per-page inline styles on the Get Quote
       and EN|FR list items, which are baked into 68 static pages. */
    .nav-links {
        position: fixed;
        top: var(--header-height, 74px);
        right: -100%;
        /* A drawer, not a full-width sheet: the page stays partly visible
           behind the backdrop so the overlay reads as temporary. */
        width: min(78vw, 320px);
        border-left: 1px solid #eee;
        height: calc(100vh - var(--header-height, 74px));
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        background-color: var(--white);
        text-align: left;
        transition: right 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.08);
        padding: 8px 0 32px;
        gap: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        /* below the fixed header (1000), above the backdrop (998) */
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 0 !important;
        width: 100%;
        font-weight: 600 !important;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-links li a {
        display: flex;
        align-items: center;
        padding: 16px 24px;
        font-size: 1.05rem;
        color: var(--text-dark);
    }

    .nav-links li a:active {
        background: var(--bg-light);
    }

    /* Get Quote keeps its accent colour but becomes a full-width row button */
    .nav-links li:has(> .btn) {
        border-bottom: none;
        padding: 20px 24px 8px;
    }

    .nav-links .btn {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 20px !important;
        font-size: 1.05rem;
    }

    /* Language toggle sits last, quieter than the navigation rows */
    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links li:last-child a {
        padding-top: 20px;
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 998;
    }

    .nav-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    body.nav-open {
        overflow: hidden;
    }

    .hamburger {
        display: block !important;
        cursor: pointer;
        font-size: 1.5rem;
        color: var(--primary-blue);
        line-height: 1;
        padding: 4px;
        z-index: 1000;
    }

    /* auto-fit collapses to a single column at this width; force two */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 20px;
    }

    .footer-grid h4 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .footer-grid p,
    .footer-grid ul {
        font-size: 0.85rem;
        word-break: break-word;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .card {
        padding: 20px;
    }

    .card i {
        font-size: 2rem;
    }
}

.hamburger {
    display: none;
}
