/* Layout — TECH Menuiserie Espace Client */

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

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Skip Link (accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ========== HEADER ========== */

.header {
    background: var(--primary);
    padding: 16px 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo svg {
    height: 48px;
    width: auto;
}

.header-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header-links a {
    color: white;
    text-decoration: none;
    font-size: var(--text-sm);
    transition: opacity var(--transition);
}

.header-links a:hover {
    opacity: 0.8;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: default;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: white;
}

.user-name {
    color: white;
    font-size: var(--text-sm);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
}

/* ========== PAGE HEADER ========== */

.page-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 32px 0;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--primary);
}

.logout-btn {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--text-sm);
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition);
}

.logout-btn:hover {
    color: var(--error);
}

/* ========== MAIN LAYOUT ========== */

.account-main {
    padding: 32px 0;
}

.account-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
}

/* ========== SIDEBAR ========== */

.account-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 24px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 15px;
    transition: all var(--transition);
}

.sidebar-nav a:hover {
    background: var(--bg-alt);
    color: var(--text);
}

.sidebar-nav a.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav a.active svg {
    stroke: white;
}

.nav-badge {
    background: var(--accent);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
}

.nav-badge:empty {
    display: none;
}

.sidebar-backdrop {
    display: none;
}

/* ========== CONTENT AREA ========== */

.account-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 400px;
}

/* ========== FOOTER ========== */

.footer {
    background: var(--primary);
    color: white;
    padding: 32px 0;
    margin-top: 48px;
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: var(--text-sm);
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin: 0 16px;
    font-size: var(--text-sm);
}

.footer a:hover {
    color: white;
}

/* ========== BACK TO TOP ========== */

.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
    z-index: 100;
}

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

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ========== RESPONSIVE ========== */

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

    .header-links a:not(:last-child) {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Sidebar overlay on mobile */
    .account-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh;
        z-index: 500;
        border-radius: 0;
        padding: 24px;
        transition: left var(--transition-slow);
        overflow-y: auto;
    }

    .account-sidebar.open {
        left: 0;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 499;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-slow);
    }

    .sidebar-backdrop.visible {
        opacity: 1;
        visibility: visible;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .header {
        padding: 12px 16px;
    }

    .logo svg {
        height: 36px;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }

    .footer a {
        margin: 0 8px;
    }
}
