.core-home-page {
    min-height: 100vh;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    /* Reprend telle quelle la nappe de degrades de la page de login
       (.login-v1-bg-wash, IGNORE_login_v1.css) pour que l'accueil partage la
       meme signature couleur -- scope a .core-home-page uniquement, jamais a
       la sidebar (voir MAQUETTES_ACCUEIL_VALIDEES/README.md, section "Hors
       perimetre"). */
    background:
        radial-gradient(46% 40% at 10% 0%, rgba(243, 175, 56, 0.10), transparent 60%),
        radial-gradient(40% 34% at 50% 0%, rgba(226, 115, 54, 0.07), transparent 58%),
        radial-gradient(46% 42% at 96% 10%, rgba(88, 198, 150, 0.07), transparent 62%),
        var(--page-bg);
}

.theme-dark .core-home-page {
    background:
        radial-gradient(46% 40% at 10% 0%, rgba(243, 175, 56, 0.07), transparent 60%),
        radial-gradient(40% 34% at 50% 0%, rgba(226, 115, 54, 0.05), transparent 58%),
        radial-gradient(46% 42% at 96% 10%, rgba(88, 198, 150, 0.05), transparent 62%),
        var(--page-bg);
}

.core-home-dashboard {
    width: 100%;
    max-width: none;
}

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

.core-home-hero {
    padding: 2.5rem 2rem 1.6rem;
}

/* Fond plat (pas de degrade propre a la carte) : la seule touche de couleur
   vient de la nappe de .core-home-page -- un 2e degrade superpose ici cassait
   le contraste du "T-TRIS" en degrade texte du titre. */
.core-home-hero-copy {
    position: relative;
    padding: 1.4rem 1.55rem;
    border: 0.5px solid var(--surface-border-color);
    border-radius: 24px;
    background: var(--surface-bg);
    box-shadow: 0 16px 36px rgba(17, 19, 31, 0.05);
}

/* ===================== ANIMATION DECORATIVE DU COIN DU HERO =====================
   Desactivable d'un seul booleen cote Python (home.py::HERO_CORNER_ANIMATION_ENABLED).
   4 variantes tirees aleatoirement a chaque rendu (home.py::_build_hero_corner) --
   purement decoratives, aucune info fonctionnelle dedans, jamais de blocage de clic
   (pointer-events: none) ni d'impact sur la mise en page du titre/sous-titre. */
.core-home-hero-corner {
    pointer-events: none;
}

@keyframes chc-snap {
    0%, 8% { transform: translate(var(--sx), var(--sy)); opacity: .9; }
    45%, 55% { transform: translate(var(--gx), var(--gy)); opacity: 1; }
    92%, 100% { transform: translate(var(--sx), var(--sy)); opacity: .9; }
}

.core-home-hero-corner--snap-grid {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 52px;
    height: 40px;
}

.chc-snap-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-accent-orange);
    animation: chc-snap 5s ease-in-out infinite;
}

@keyframes chc-converge {
    0%, 10% { transform: translate(var(--fx), var(--fy)) scale(1); }
    50%, 60% { transform: translate(0, 0) scale(0.85); }
    100% { transform: translate(var(--fx), var(--fy)) scale(1); }
}

.core-home-hero-corner--converge {
    position: absolute;
    top: 30px;
    right: 44px;
    width: 50px;
    height: 34px;
}

.chc-converge-dot {
    position: absolute;
    border-radius: 50%;
    animation: chc-converge 4.5s ease-in-out infinite;
}

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

.core-home-hero-corner--crates {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 52px;
    height: 36px;
}

.chc-crate {
    position: absolute;
    border-radius: 2.5px;
    animation: chc-drift 4.2s ease-in-out infinite;
    box-shadow: 0 2px 4px rgba(17, 19, 31, 0.08);
}

@keyframes chc-scan {
    0%, 92%, 100% { background: var(--surface-border-color); }
    4%, 8% { background: var(--color-accent-orange); }
}

.core-home-hero-corner--scan-grid {
    position: absolute;
    top: 16px;
    right: 20px;
    display: grid;
    grid-template-columns: repeat(5, 5px);
    gap: 3px;
}

.chc-scan-cell {
    width: 5px;
    height: 5px;
    border-radius: 1.5px;
    background: var(--surface-border-color);
    animation: chc-scan 3.2s linear infinite;
}

/* Même animation comme indicateur de chargement (core/ui.py::chargement, popins d'import) : dans un cadre à sa
   taille, en haut à gauche, et toujours visible (y compris sur téléphone). */
.ttris-chargement {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 4px;
}

.ttris-chargement-animation {
    position: relative;
    flex: none;
    width: 60px;
    height: 44px;
}

.ttris-chargement .core-home-hero-corner {
    display: block;
    top: 4px;
    left: 4px;
    right: auto;
}

.ttris-chargement .core-home-hero-corner--scan-grid {
    display: grid;
}

/* Les points de cette variante s'écartent de 16 px autour de leur origine : origine décalée pour rester dans le cadre */
.ttris-chargement .core-home-hero-corner--converge {
    top: 20px;
    left: 22px;
}

@media (prefers-reduced-motion: reduce) {
    .core-home-hero-corner * {
        animation: none !important;
    }
}

@media (max-width: 640px) {
    .core-home-hero-corner {
        display: none;
    }
}

.core-home-eyebrow {
    margin-bottom: 0.75rem;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.18em;
    color: var(--text-color-soft);
}

.core-home-title {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.15;
    color: var(--text-color);
}

/* Portion "T-TRIS" du titre en degrade texte, identique a .login-v1-headline em
   (IGNORE_login_v1.css) plutot qu'une simple couleur plate. */
.core-home-title-accent {
    padding-right: 0.06em;
    background: linear-gradient(135deg, var(--color-accent-amber), var(--color-accent-orange));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.core-home-subtitle {
    max-width: 760px;
    margin: 0.85rem 0 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-color-soft);
}

.core-home-modules-shell {
    margin: 0 2rem 1.5rem;
    padding: 1.2rem;
    border: 0.5px solid var(--surface-border-color);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(10px);
}

.theme-dark .core-home-modules-shell {
    background: rgba(23, 24, 34, 0.72);
}

.core-home-modules-shell-head {
    padding: 0.2rem 0.2rem 1rem;
}

.core-home-modules-shell-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-color);
}

.core-home-modules-shell-subtitle {
    margin-top: 0.3rem;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-color-soft);
}

/* Grille a 6 colonnes virtuelles : chaque carte occupe 2 colonnes (span 2) par
   defaut, donc 3 cartes par ligne. Modificateurs --wide (span 3, 2 cartes se
   partagent la derniere ligne a 50/50) et --full (span 6, une carte seule
   prend toute la largeur) appliques cote Python (home.py::_span_class_for)
   quand le nombre de modules ne tombe pas juste sur un multiple de 3. Ajouter
   un module ne demande aucune retouche ici : la logique recalcule seule quelles
   cartes elargir. */
.core-home-modules {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.core-home-module-link {
    display: block;
    grid-column: span 2;
    color: inherit;
    text-decoration: none;
}

.core-home-module-link--wide {
    grid-column: span 3;
}

.core-home-module-link--full {
    grid-column: span 6;
}

.core-home-module-link--disabled {
    pointer-events: none;
}

.core-home-module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    border: 0.5px solid var(--surface-border-color);
    border-radius: 18px;
    background: var(--surface-bg);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.core-home-module-card:hover,
.core-home-module-link:focus-visible .core-home-module-card {
    border-color: var(--input-border-color);
    background: var(--page-bg-alt);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(17, 19, 31, 0.08);
}

.core-home-module-link:focus-visible {
    outline: none;
}

.core-home-module-strip {
    width: 100%;
    height: 3px;
    background: var(--module-accent);
}

/* Badge de statut ("Actif"/"Bientot") -- plus de numero de module a cote
   (cf. decision "pas de numerotation", MAQUETTES_ACCUEIL_VALIDEES/README.md
   point 1), place en coin haut-droit de la carte. */
.core-home-status-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 3px 8px;
    border-radius: 99px;
    border: 0.5px solid #B3E9CC;
    background: #EAFBF2;
    color: #1C7A4A;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
}

.core-home-status-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.core-home-status-badge--disabled {
    border-color: var(--surface-border-color);
    background: var(--page-bg-alt);
    color: var(--text-color-soft);
}

.core-home-module-body {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.25rem 1.1rem;
}

.core-home-module-icon-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: var(--module-accent-soft);
    margin-bottom: 1rem;
}

.core-home-module-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.core-home-module-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-color);
}

.core-home-module-description {
    margin: 0.35rem 0 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-color-soft);
}

.core-home-module-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding: 0.95rem 1.25rem 1.15rem;
    border-top: 0.5px solid var(--surface-border-color);
}

.core-home-module-tag {
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-color-soft);
}

.core-home-module-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: var(--module-accent-strong);
}

.core-home-module-cta-arrow {
    display: inline-block;
    transition: transform 0.15s ease;
}

.core-home-module-card:hover .core-home-module-cta-arrow,
.core-home-module-link:focus-visible .core-home-module-cta-arrow {
    transform: translateX(2px);
}

.core-home-module-card--disabled {
    opacity: 0.64;
    cursor: default;
}

/* Brique désactivée (« Inactif ») : nettement distincte d'une brique utilisable
   -- grisée, sans couleur de marque, bordure pointillée, sans « Ouvrir » ni
   effet de survol. */
.core-home-module-card--inactive {
    opacity: 0.72;
    filter: grayscale(1);
    background: var(--page-bg-alt);
    border-style: dashed;
    box-shadow: none;
}
.core-home-module-card--inactive,
.core-home-module-card--inactive:hover {
    transform: none;
    box-shadow: none;
}
.core-home-module-card--inactive .core-home-module-strip {
    background: var(--surface-border-color) !important;
}
.core-home-module-card--inactive .core-home-module-title,
.core-home-module-card--inactive .core-home-module-description,
.core-home-module-card--inactive .core-home-module-tag {
    color: var(--text-color-soft);
}
.core-home-module-cta--inactive {
    color: var(--text-color-soft) !important;
    font-style: italic;
}

/* ===================== SECTION "RESERVE AUX MEMBRES MGIB" =====================
   Rendue uniquement pour les comptes identifies MGIB (home.py::_is_mgib_member).
   Style volontairement different des briques client : pas de couleur de
   marque, bordure pointillee, badge neutre -- pour qu'on reconnaisse au
   premier coup d'oeil qu'on sort du catalogue client. */
.core-home-mgib-section {
    margin: 0 2rem 1.5rem;
}

.core-home-mgib-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 0.6rem;
}

.core-home-mgib-divider-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-color-soft);
    white-space: nowrap;
}

.core-home-mgib-divider-icon {
    width: 12px;
    height: 12px;
    display: block;
}

.core-home-mgib-divider-line {
    flex: 1;
    height: 1px;
    background: var(--surface-border-color);
}

.core-home-mgib-sub {
    margin: 0 0 1rem;
    max-width: 560px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-color-soft);
}

.core-home-mgib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.core-home-mgib-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.3rem 1.2rem;
    border: 1.5px dashed var(--surface-border-color);
    border-radius: 14px;
    background: var(--surface-bg);
}

.core-home-mgib-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0.9rem;
}

.core-home-mgib-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-color-soft);
    background: var(--page-bg-alt);
    border: 1px solid var(--surface-border-color);
}

.core-home-mgib-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-accent-orange);
}

.core-home-mgib-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.core-home-mgib-name {
    margin: 0 0 0.5rem;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.core-home-mgib-desc {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-color-soft);
}

@media (max-width: 1100px) {
    .core-home-modules {
        grid-template-columns: 1fr;
    }

    .core-home-module-link,
    .core-home-module-link--wide,
    .core-home-module-link--full {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .core-home-hero {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .core-home-hero {
        padding-top: 2rem;
    }

    .core-home-title {
        font-size: 24px;
    }

    .core-home-modules-shell {
        margin-left: 1rem;
        margin-right: 1rem;
        padding: 0.9rem;
    }

    .core-home-mgib-section {
        margin-left: 1rem;
        margin-right: 1rem;
    }
}
