/* Global Design System */
:root {
    /* Palette: Ivory & Terracotta (Requested) */
    --bg-ivory: #FFF8F2;
    --text-slate: #2E3440;
    --brand-terracotta: #E28B6B;
    --brand-terracotta-dark: #c97658;
    --green-sage: #93B8A1;
    --blue-mist: #7CA7C8;
    --beige-rose: #F3DDD1;
    /* Semantic Mappings */
    --color-primary: var(--brand-terracotta);
    --color-primary-light: var(--beige-rose);
    --color-secondary: var(--bg-ivory);
    --color-accent: var(--green-sage);
    --color-text: var(--text-slate);
    --color-text-muted: #4B5563; /* Amélioré: plus foncé pour meilleur contraste (était #6B7280) */
    --color-text-light: #6B7280; /* Ancien muted, pour usage limité */
    --color-background: var(--bg-ivory);
    --color-surface: #FFFFFF;
    --color-border: #E7E0DB;
    /* Typography from Snippet */
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Poppins', sans-serif;
    /* Used for headings */
    --font-brand: 'Pacifico', cursive;
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    /* Transitions */
    --transition-base: all 0.2s ease-in-out;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: var(--font-sans);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

    /* Global Background Effect */
    body::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 50%;
        height: 100%;
        background: linear-gradient(to left, var(--beige-rose) 0%, rgba(255, 248, 242, 0) 100%);
        z-index: -1;
        pointer-events: none;
    }

h1,
h2,
h3 {
    font-family: var(--font-serif);
    /* Poppins */
    color: var(--color-text);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-base);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

    .btn-primary:hover {
        background-color: var(--brand-terracotta-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

    .btn-outline:hover {
        background-color: var(--color-primary);
        color: white;
    }

/* Typography Utilities */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-xl);
}

/* Header & Navbar */
header {
    padding: 20px 5%;
    /* Spacing from snippet */
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: transparent;
}

.navbar-brand {
    font-family: var(--font-brand);
    /* Pacifico */
    font-size: 1.8rem;
    color: var(--color-primary);
    font-weight: 400;
}

.navbar-nav {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.95rem;
}

    .nav-link:hover {
        color: var(--color-primary);
    }

/* Footer */
.footer {
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
    text-align: center;
    color: var(--color-text-muted);
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: var(--transition-base);
}

.footer-links a:hover {
    color: var(--color-primary);
}

.footer-links span {
    color: var(--color-border);
}

/* Auth Password Rules */
.password-rules {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.rule-item.invalid {
    color: #ef4444;
}

.rule-item.valid {
    color: #10b981;
}

.rule-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MOBILE RESPONSIVE & HAMBURGER MENU
   ============================================ */

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Hamburger button - hidden on desktop */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.navbar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar-overlay.active {
    display: block;
    opacity: 1;
}

/* Login button in navbar */
.nav-btn-login {
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
}

/* ============================================
   MOBILE STYLES (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Show hamburger on mobile */
    .navbar-toggle {
        display: flex;
    }

    /* Mobile navigation menu */
    .navbar-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: var(--color-surface);
        padding: 80px 24px 24px;
        gap: var(--spacing-md);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .navbar-nav.active {
        right: 0;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav .nav-link {
        display: block;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        font-size: 1rem;
    }

    .navbar-nav .nav-link:hover {
        background: var(--color-primary-light);
    }

    .navbar-nav .nav-btn-login {
        width: 100%;
        justify-content: center;
        margin-top: var(--spacing-md);
    }

    /* Header mobile adjustments */
    header {
        padding: 15px 4%;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    /* Container mobile padding */
    .container {
        padding: 0 16px;
    }

    /* Footer mobile */
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .footer-links span {
        display: none;
    }

    .footer-links a {
        padding: 4px 0;
    }

    /* Main content mobile */
    main {
        padding: 0;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ============================================
   TABLET STYLES (max-width: 992px)
   ============================================ */
@media (max-width: 992px) and (min-width: 769px) {
    .navbar-nav {
        gap: var(--spacing-md);
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .container {
        padding: 0 24px;
    }
}

/* ============================================
   GLOBAL RESPONSIVE FIXES
   ============================================ */

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Tables responsive */
table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Forms responsive */
input, textarea, select, button {
    max-width: 100%;
}

/* Cards responsive */
.card, .auth-card, .dashboard-card {
    max-width: 100%;
    overflow: hidden;
}

/* Fix any absolute positioned elements that might overflow */
[style*="position: absolute"],
[style*="position:absolute"] {
    max-width: 100vw;
}