﻿:root {
    --main-green: #16a34a;
    --accent-yellow: #eab308;
    --bg: #f3f4f6;
    --text-main: #111827;
    --text-muted: #6b7280;
    --white: #ffffff;
}

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

body {
    background: radial-gradient(circle at top left, #bbf7d0, var(--bg));
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========= LANDING (non connecté) ========= */

.landing-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER landing */

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
}

/* Logo CesiZen (commun) */
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--main-green), var(--accent-yellow));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* Boutons Connexion / Inscription en haut à droite (landing) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* CONTENU CENTRAL landing */

.landing-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;   /* milieu vers le haut */
    padding: 2rem 1.5rem 3rem;
}

.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3rem;          /* pour remonter vers le haut */
    text-align: center;
    max-width: 480px;
}

/* Bloc pour le logo de l'app */
.hero-logo {
    width: 200px;
    height: 200px;
    border-radius: 1.5rem;
    background: var(--white);
    box-shadow:
            0 10px 26px rgba(15, 23, 42, 0.12),
            0 0 0 1px rgba(148, 163, 184, 0.25);
    margin-bottom: 1.5rem;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* Si tu ajoutes un <img> dedans, il prendra toute la place */
.hero-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Texte sous le logo */
.hero-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.placeholder-text {
    font-style: italic;
}

/* FOOTER landing */

.landing-footer {
    padding: 0 2rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ========= BOUTONS GÉNÉRIQUES (communs) ========= */

.btn {
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-out;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.btn-small {
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.6);
}

.btn-ghost:hover {
    background: rgba(15, 23, 42, 0.03);
}

.btn-primary {
    background: linear-gradient(135deg, var(--main-green), var(--accent-yellow));
    color: var(--white);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

/* ========= PAGES INTERNES / APP (connecté) ========= */

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER / NAVBAR */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

/* Brand dans la navbar */
.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

/* NAVIGATION PRINCIPALE */

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 1.5rem;
    flex: 1;
}

.nav-link {
    position: relative;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.3rem 0.4rem;
}

.nav-link:hover {
    color: var(--text-main);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.15rem;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--main-green), var(--accent-yellow));
    transition: width 0.15s ease-out;
}

.nav-link:hover::after {
    width: 100%;
}

/* ACTIONS COMPTE / UTILISATEUR (connecté) */
/* .header-actions déjà défini plus haut et réutilisé */

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 0.5rem;
    border-right: 1px solid rgba(148, 163, 184, 0.5);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: var(--main-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* CONTENU DES PAGES INTERNES */

.app-main {
    flex: 1;
    padding: 2rem;
}

/* FOOTER app */

.app-footer {
    padding: 0.8rem 2rem 1.3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: auto;
}

body.home-page .app-main {
    display: flex;
    justify-content: center;   /* centre horizontalement le bloc */
    align-items: center;       /* centre verticalement entre navbar et footer */
}

body.home-page .hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 480px;
    margin: 0;
}

/* ========= MENU BURGER (ajout) ========= */

.nav-toggle {
    display: none; /* caché en desktop */
    background: transparent;
    border: 0;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-main);
}

.nav-toggle svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.nav-toggle line {
    transition: 0.3s ease;
    transform-origin: center;
}

/* État ouvert du burger (X) */
[aria-expanded="true"] .line-middle {
    opacity: 0;
}

[aria-expanded="true"] .line-top {
    transform: translateY(6px) rotate(45deg);
}

[aria-expanded="true"] .line-bottom {
    transform: translateY(-6px) rotate(-45deg);
}

/* Cache les actions mobiles par défaut en desktop */
.nav-mobile-actions {
    display: none;
}

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

@media (max-width: 900px) {
    .app-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.7rem 1.5rem;
        position: relative;
    }

    /* Affiche le bouton burger */
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        /* met le burger à droite sur la première ligne */
        margin-left: auto;
        align-self: center;
    }

    .brand {
        align-self: center;
    }

    /* Menu déroulant (remplace ton ancien menu "wrap") */
    .main-nav {
        order: 3;
        width: 100%;

        display: none;          /* fermé par défaut */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;

        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(148, 163, 184, 0.35);

        margin: 0;              /* annule margin desktop */
        padding: 0.75rem 1rem;

        flex: none;             /* annule flex:1 desktop */
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;

        z-index: 1000;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav .nav-link {
        padding: 0.6rem 0.4rem;
    }

    /* Styles pour les liens de navigation qui ne sont pas de simples liens texte (comme le divider) */
    .main-nav hr.nav-divider {
        padding: 0;
    }

    .nav-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-divider {
        border: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.3);
        margin: 0.5rem 0;
    }

    .header-actions {
        display: none;
    }

    .header-brand-name {
        display: none;
    }

    .app-main {
        padding: 1.5rem;
    }
}