/**
 * AfterMachine - Styles principaux
 * Design moderne, responsive et SEO-friendly
 */

/* ==================== Variables CSS ==================== */
:root {
    /* Couleurs principales */
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-primary-light: #3b82f6;
    --color-secondary: #0f172a;
    --color-accent: #f59e0b;
    
    /* Couleurs de texte */
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-dark: #0f172a;
    
    /* Couleurs de fond */
    --color-bg: #ffffff;
    --color-bg-light: #f8fafc;
    --color-bg-dark: #0f172a;
    
    /* Couleurs d'état */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    
    /* Espacements */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Autres */
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

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

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

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

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

.section {
    padding: var(--spacing-2xl) 0;
}

.section-lg {
    padding: 4rem 0;
}

.text-center {
    text-align: center;
}

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

/* ==================== Typographie ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-dark);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

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

.lead {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    line-height: 1.8;
}

.text-muted {
    color: var(--color-text-light);
}

/* ==================== Header & Navigation ==================== */
.header {
    background-color: var(--color-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
}

/* Header inner container */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.6rem;
}

/* Bloc logo + textes */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}

/* Logo plus visible */
.brand-logo {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

/* Texte à droite du logo : empilé */
.brand-text {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.1;
    gap: 0.1rem;
}

/* Nom de la marque */
.brand-name {
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
    color: var(--color-text-dark);
    display: block;
    white-space: nowrap;
}

/* Baseline sur une vraie 2e ligne */
.brand-baseline {
    font-size: 0.78rem;
    opacity: 0.75;
    max-width: 12rem;
    color: var(--color-text-light);
    display: block;
    line-height: 1.2;
}

/* Bouton menu / burger */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
}

/* Version desktop : logo + texte un peu plus grands, baseline qui respire */
@media (min-width: 768px) {
    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .brand-name {
        font-size: 1.1rem;
    }

    .brand-baseline {
        font-size: 0.85rem;
        max-width: none;
    }

    .header-inner {
        padding-block: 0.9rem;
    }
}

.nav-main {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-main a {
    color: var(--color-text);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-main a:hover,
.nav-main a.active {
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.1);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--font-size-base);
    font-family: var(--font-sans);
}

.nav-dropdown-toggle:hover {
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.1);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    padding: var(--spacing-xs);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: var(--spacing-xs) var(--spacing-sm);
    color: var(--color-text);
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-dropdown-menu a:hover {
    color: var(--color-primary);
    background-color: rgba(37, 99, 235, 0.1);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text);
}

/* ==================== Boutons ==================== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-large {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

/* ==================== Hero Section ==================== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--spacing-2xl) 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--spacing-md);
}

.hero .lead {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-xl);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-badges {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    backdrop-filter: blur(10px);
}

.badge-icon {
    font-size: 1.2rem;
}

/* ==================== Cards ==================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.card {
    background-color: var(--color-bg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

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

.card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.card h3 {
    margin-bottom: var(--spacing-sm);
}

.card p {
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.card ul {
    list-style: none;
    margin-bottom: var(--spacing-md);
}

.card ul li {
    padding: var(--spacing-xs) 0;
    color: var(--color-text);
}

.card ul li::before {
    content: "✓ ";
    color: var(--color-success);
    font-weight: bold;
    margin-right: var(--spacing-xs);
}

/* ==================== Two Column Layout ==================== */
.two-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-xl);
}

.column {
    padding: var(--spacing-lg);
}

.column h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.column ul {
    list-style: none;
}

.column ul li {
    padding: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
    position: relative;
}

.column ul li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

/* ==================== Formulaires ==================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--color-text-dark);
}

.form-label.required::after {
    content: " *";
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: var(--font-sans);
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-help {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin-top: var(--spacing-xs);
}

.form-error {
    color: var(--color-error);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

/* ==================== Footer ==================== */
.footer {
    background-color: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-2xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-section h4 {
    color: white;
    margin-bottom: var(--spacing-md);
}

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

.footer-section ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
}

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

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== Alerts & Messages ==================== */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-color: var(--color-success);
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: var(--color-error);
    color: #991b1b;
}

.alert-warning {
    background-color: #fef3c7;
    border-color: var(--color-warning);
    color: #92400e;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 1.875rem;
        --font-size-3xl: 1.5rem;
        --spacing-2xl: 2rem;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .nav-main {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: var(--spacing-md) 0;
        gap: var(--spacing-sm);
    }
    
    .nav-main.active {
        display: flex;
    }
    
    .nav-main a {
        padding: var(--spacing-md);
        text-align: center;
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        text-align: center;
        padding: var(--spacing-md);
    }
    
    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        margin-top: var(--spacing-xs);
    }
    
    .btn-small {
        font-size: var(--font-size-base);
        padding: var(--spacing-md);
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .two-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* ==================== Accessibilité ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
