/* System Design & CSS Reset for Capacitas Échelon */
:root {
    --bg-black: #000000;
    --primary-yellow: #FCF898;
    --accent-cyan: #00F0FF;
    --text-white: #FFFFFF;
    --text-muted: #B3B3B3;
    --text-dark: #808080;
    --nav-border: rgba(255, 255, 255, 0.1);
    
    /* Layout constants */
    --nav-height: 70px;
    --container-max-width: 1200px;
    --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Accessibility helper class for screen readers only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only.focusable:active,
.sr-only.focusable:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: var(--bg-black);
    color: var(--accent-cyan);
    padding: 1rem;
    z-index: 2000;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-black);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 4. NAVIGATION GÉNÉRALE */
.navbar {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background-color: #000;
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0 2rem;
}

.nav-container {
    width: 100%;
    max-width: var(--container-max-width);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 3.5rem; /* Generous spacing on desktop */
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em; /* Light letter-spacing approach */
    transition: color 0.3s ease, border-color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--text-white);
    outline: none;
}

/* Active link styling */
.nav-links a.active {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* Focus outline for accessibility */
.nav-links a:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 4px;
}

/* Hamburger mobile menu button (hidden by default) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    right: 2rem;
    z-index: 1001;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 2px;
    margin: 5px auto;
    background-color: var(--text-white);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 5. NOUVELLE COMPOSITION DE PAGE D'ACCUEIL UNIFIÉE */
.homepage {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #000;
}

.homepage-visual {
  position: relative;
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  justify-content: center;
  background: #000;
}

.homepage-visual-img {
  display: block;
  width: min(calc(100% - 32px), 1200px);
  height: auto;
  aspect-ratio: 2175 / 9000;
  margin-inline: auto;
  border: 0;
}

.homepage-closing-banner {
  width: 100%;
  margin: 0;
  padding: 0;
  background: #000;
  margin-top: 0;
}

.homepage-closing-banner-img {
  display: block;
  width: min(calc(100% - 32px), 1200px);
  height: auto;
  aspect-ratio: 2175 / 1242;
  margin-inline: auto;
  border: 0;
}

.homepage-anchor {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  margin: 0;
  padding: 0;
  z-index: -1;
  background: transparent;
  scroll-margin-top: calc(var(--nav-height) + 8px);
}

@media (max-width: 520px) {
  .homepage-visual-img {
    width: 100%;
    max-width: none;
  }
  .homepage-closing-banner-img {
    width: 100%;
    max-width: none;
  }
}

/* 10. RESPONSIVE DESIGN */

/* Responsive styling for the composition page */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Show hamburger button */
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.98);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.5rem;
        transform: translateY(-100%);
        opacity: 0;
        transition: transform 0.4s ease, opacity 0.4s ease;
        pointer-events: none;
        border-top: 1px solid var(--nav-border);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.1rem;
        letter-spacing: 0.2em;
    }

    /* Animate Hamburger icon when open */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .navbar {
        padding: 0 1.5rem;
    }
    .nav-links {
        gap: 2.2rem;
    }
}

/* UA-triggered Mobile Emulation Styles for Headless Testing */
body.mobile-nav-mode .menu-toggle {
    display: block !important;
}

body.mobile-nav-mode .nav-links {
    position: fixed !important;
    top: var(--nav-height) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.98) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2.5rem !important;
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    transition: transform 0.4s ease, opacity 0.4s ease !important;
    pointer-events: none !important;
    border-top: 1px solid var(--nav-border) !important;
}

body.mobile-nav-mode .nav-links.active {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}


/* 11. PAGES DE CONTENU ET FORMULAIRES */

/* Base Layout for Content Pages */
.content-page {
    width: 100%;
    min-height: calc(100vh - var(--nav-height));
    background-color: var(--bg-black);
    padding: 4rem 2rem 6rem;
    display: flex;
    justify-content: center;
}

.content-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* Page Header */
.content-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-bottom: 1px solid var(--nav-border);
    padding-bottom: 2rem;
}

.content-header .category {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.content-header h2 {
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--primary-yellow);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.content-header .positioning-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-white);
    max-width: 800px;
    font-weight: 300;
}

.content-header .strong-phrase {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--accent-cyan);
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

/* Illustration placeholder & existing images */
.content-illustration-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--nav-border);
    border-radius: 4px;
    padding: 2rem;
    overflow: hidden;
}

.content-illustration-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
}

.content-illustration-placeholder {
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    border: 1px dashed rgba(0, 240, 255, 0.3);
    border-radius: 4px;
    color: var(--text-dark);
}

.content-illustration-placeholder .placeholder-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dark);
}

.content-illustration-placeholder .placeholder-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Grid Layout for offer items and benefits */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.content-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.content-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-left: 2px solid var(--accent-cyan);
    padding-left: 0.75rem;
}

.content-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.content-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.content-card li {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-white);
    position: relative;
    padding-left: 1.25rem;
}

.content-card li::before {
    content: "·";
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

/* Action call footer */
.content-action-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--nav-border);
    padding-top: 3.5rem;
}

.content-action-footer p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
}

.content-btn {
    display: inline-block;
    padding: 0.8rem 2.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    background: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.content-btn:hover,
.content-btn:focus {
    background-color: var(--accent-cyan);
    color: var(--bg-black);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    outline: none;
}

/* Contact Form Styling */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.form-control {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--nav-border);
    border-radius: 2px;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.form-control:focus {
    border-color: var(--accent-cyan);
    outline: none;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--nav-border);
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: border-color 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    border-color: var(--accent-cyan);
    background-color: var(--accent-cyan);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--bg-black);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus-visible {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 5px var(--accent-cyan);
}

/* Success Message Alert */
.alert-success {
    border: 1px solid var(--accent-cyan);
    background-color: rgba(0, 240, 255, 0.03);
    color: var(--text-white);
    padding: 1.5rem;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.alert-success h4 {
    color: var(--accent-cyan);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustment for content page */
@media (max-width: 768px) {
    .content-page {
        padding: 3rem 1.5rem 5rem;
    }
    .content-container {
        gap: 2.5rem;
    }
    .content-header h2 {
        font-size: 1.8rem;
    }
    .content-header .positioning-text {
        font-size: 1rem;
    }
    .content-header .strong-phrase {
        font-size: 1.1rem;
    }
}


/* Accessibilité: Respect de prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .nav-links,
    .homepage-entry-link,
    .menu-toggle .bar {
        transition: none !important;
    }
}
