/* ============================================================
   FlyMachine — feuille de style maison (aucune dépendance)
   Bootstrap 5.3.3 + Bootstrap Icons via CDN + SRI
   ============================================================ */

:root {
    --fm-primary: #6366f1;
    --fm-primary-dark: #4f46e5;
    --fm-violet: #8b5cf6;
    --fm-fuchsia: #d946ef;
    --fm-slate-900: #0f172a;
    --fm-slate-800: #1e293b;
    --fm-slate-700: #334155;
    --fm-sidebar-width: 260px;
    --fm-topbar-height: 64px;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Marque ---------- */
.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-violet));
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}

.brand-icon-lg { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 14px; }

.brand-accent {
    background: linear-gradient(90deg, #a5b4fc, #f0abfc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.btn-brand {
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-violet));
    border: none;
    color: #fff;
    font-weight: 600;
}
.btn-brand:hover, .btn-brand:focus {
    background: linear-gradient(135deg, var(--fm-primary-dark), var(--fm-violet));
    color: #fff;
}

.text-bg-violet { background-color: var(--fm-violet) !important; color: #fff !important; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-fuchsia));
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .75rem; }

/* ============================================================
   Administration
   ============================================================ */
.admin-body { background: #f1f5f9; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--fm-sidebar-width);
    background: var(--fm-slate-900);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.15rem 1.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-nav { flex: 1; padding: 1rem .75rem; overflow-y: auto; }

.sidebar-section-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    margin: 0 .6rem .35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .8rem;
    border-radius: .55rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .92rem;
    margin-bottom: .15rem;
    transition: background .15s, color .15s;
}
.sidebar-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.sidebar-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-link.active {
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-violet));
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .4);
}

/* Lien désactivé (fonctionnalité à venir) */
.sidebar-link.disabled {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    color: #94a3b8;
}

/* Sous-liens : accès rapide aux catalogues */
.sidebar-sub {
    margin: .1rem 0 .4rem;
    padding-left: .9rem;
    border-left: 2px solid rgba(255, 255, 255, .08);
    margin-left: 1.45rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.sidebar-sub-row {
    display: flex;
    align-items: center;
    gap: .15rem;
}

.sidebar-sub-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .32rem .6rem;
    border-radius: .45rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: .84rem;
    flex: 1;
    min-width: 0;
    transition: background .15s, color .15s;
}
.sidebar-sub-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-sub-link.active { color: #fff; background: rgba(255, 255, 255, .09); }

.sidebar-sub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: .4rem;
    color: #64748b;
    text-decoration: none;
    font-size: .85rem;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.sidebar-sub-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-sub-icon.active { color: #fff; background: rgba(255, 255, 255, .14); }

.sidebar-cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sidebar-star { font-size: .7rem; color: #fbbf24; margin-left: auto; }

.sidebar-footer { padding: 1rem .75rem; border-top: 1px solid rgba(255, 255, 255, .06); }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.admin-topbar {
    height: var(--fm-topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-title { font-weight: 700; font-size: 1.02rem; }
.topbar-actions { display: flex; align-items: center; gap: .6rem; }

.admin-content { flex: 1; padding: 1.5rem; }

.admin-footer {
    padding: .8rem 1.5rem;
    color: #94a3b8;
    font-size: .8rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

/* Cartes de statistiques */
.stat-card { border-radius: .9rem; transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .08) !important; }

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.3rem;
    color: #fff;
}
.stat-icon-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); }
.stat-icon-violet { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.stat-icon-blue { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
.stat-icon-pink { background: linear-gradient(135deg, #ec4899, #f472b6); }

.stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: #64748b; font-size: .82rem; }

/* ============================================================
   Authentification
   ============================================================ */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(60rem 30rem at 110% -10%, rgba(217, 70, 239, .28), transparent 60%),
        radial-gradient(50rem 28rem at -10% 110%, rgba(99, 102, 241, .35), transparent 60%),
        var(--fm-slate-900);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-shell { width: 100%; max-width: 460px; }

.auth-brand {
    text-align: center;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
}

.auth-brand-name {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}

.auth-brand-tagline { color: #94a3b8; font-size: .9rem; margin: 0; }

.auth-card { border-radius: 1rem; }
.auth-card .card-body { border-radius: 1rem; }

.auth-footer { text-align: center; margin-top: 1.5rem; }

/* ============================================================
   Public
   ============================================================ */
.public-body { background: #f8fafc; }

.public-navbar {
    background: var(--fm-slate-900);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    padding-block: .7rem;
}

.public-hero {
    background:
        radial-gradient(50rem 25rem at 85% -20%, rgba(217, 70, 239, .3), transparent 60%),
        radial-gradient(40rem 22rem at -10% 20%, rgba(99, 102, 241, .4), transparent 60%),
        linear-gradient(160deg, var(--fm-slate-900), #1e1b4b);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.public-hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.public-hero-rocket {
    font-size: 9rem;
    color: rgba(255, 255, 255, .9);
    filter: drop-shadow(0 20px 40px rgba(99, 102, 241, .5));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-14px) rotate(3deg); }
}

.feature-card { border-radius: .9rem; transition: transform .15s, box-shadow .15s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 .6rem 1.6rem rgba(15, 23, 42, .1) !important; }

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, var(--fm-primary), var(--fm-violet));
}

.public-footer { border-top: 1px solid #e2e8f0; background: #fff; }

/* ============================================================
   Public — catalogues (couleurs via variables CSS --cat-*)
   ============================================================ */
.catalog-card { border-radius: .9rem; transition: transform .15s, box-shadow .15s; }
.catalog-card:hover { transform: translateY(-3px); box-shadow: 0 .6rem 1.6rem rgba(15, 23, 42, .12) !important; }

.catalog-card-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--cat-primary, #6366f1), var(--cat-secondary, #8b5cf6));
}

.catalog-card-btn {
    background: var(--cat-primary, #6366f1);
    color: #fff;
    border-radius: 2rem;
    padding-inline: 1.2rem;
}
.catalog-card-btn:hover { background: var(--cat-secondary, #8b5cf6); color: #fff; }

.catalog-hero {
    background:
        radial-gradient(40rem 22rem at 90% -20%, color-mix(in srgb, var(--cat-accent, #d946ef) 25%, transparent), transparent 60%),
        linear-gradient(160deg, color-mix(in srgb, var(--cat-primary, #6366f1) 88%, #0f172a), color-mix(in srgb, var(--cat-secondary, #8b5cf6) 80%, #1e1b4b));
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.catalog-hero .lead { color: rgba(255, 255, 255, .85); }

.catalog-hero-logo {
    max-height: 64px;
    max-width: 120px;
    object-fit: contain;
    background: #fff;
    padding: .35rem;
    border-radius: .6rem;
}

.catalog-hero-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
}

.catalog-hero-badge {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    padding: .5rem .9rem;
    font-weight: 600;
}

.catalog-cat-card { border-radius: .9rem; transition: transform .15s, box-shadow .15s; }
.catalog-cat-card:hover { transform: translateY(-3px); box-shadow: 0 .6rem 1.6rem rgba(15, 23, 42, .1) !important; }

.catalog-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.05rem;
    color: #fff;
    background: linear-gradient(135deg, var(--cat-primary, #6366f1), var(--cat-secondary, #8b5cf6));
}

/* ============================================================
   Public — grille produits & fiche produit (phase 6)
   ============================================================ */
.product-card {
    border-radius: .9rem;
    transition: transform .15s, box-shadow .15s;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 .7rem 1.8rem rgba(15, 23, 42, .12) !important;
}

.product-card-img {
    aspect-ratio: 1;
    background: #f8fafc;
    overflow: hidden;
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.04); }

.product-card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 2.2rem;
}

.product-card-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--cat-primary, #6366f1);
}

.thumb-btn { cursor: pointer; opacity: .65; transition: opacity .15s; }
.thumb-btn:hover { opacity: 1; }
.thumb-active { opacity: 1; box-shadow: 0 0 0 2px var(--cat-primary, #6366f1); }

/* ============================================================
   Thème sombre (admin uniquement)
   ============================================================ */
[data-bs-theme="dark"].admin-body { background: #0b1220; }

[data-bs-theme="dark"] .admin-topbar,
[data-bs-theme="dark"] .admin-footer {
    background: var(--fm-slate-800);
    border-color: rgba(255, 255, 255, .06);
    color: #cbd5e1;
}

[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--fm-slate-800); --bs-table-color: #e2e8f0; }
