/* ============================================================
   Vimiton — « Cahier lumineux »
   Système dérivé du logo : bulle-sourire (squircle turquoise),
   lettres rondes, duo bleu nuit / turquoise, double point.
   Polices embarquées (auto-hébergées, aucun CDN).
   Aucun JavaScript : tout est CSS (transitions, :has()).
   ============================================================ */

/* ---------- Polices ---------- */

@font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/baloo-2-v23-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Baloo 2';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/baloo-2-v23-latin-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/nunito-v32-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/nunito-v32-latin-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/nunito-v32-latin-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Nunito';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/nunito-v32-latin-italic.woff2') format('woff2');
}

/* ---------- Jetons du système ---------- */

:root {
    /* Encre */
    --vmt-ink: #091933;
    --vmt-ink-2: #3A4A63;
    --vmt-muted: #64748B;

    /* Turquoise (marque) et ses nuances */
    --vmt-teal: #01A796;
    --vmt-teal-bright: #17BDA9;
    --vmt-teal-deep: #018477;
    --vmt-teal-soft: #DCF3F1;
    --vmt-teal-faint: #F0FAF8;

    /* Surfaces et lignes */
    --vmt-line: #E3F2EF;
    --vmt-line-strong: #CBE5E0;
    --vmt-wash: #F4FAF9;

    /* Formes : bulle du logo = rayons généreux */
    --vmt-radius-card: 20px;
    --vmt-radius-control: 12px;

    /* Profondeur : ombres teintées turquoise, jamais de noir pur */
    --vmt-shadow: 0 1px 2px rgba(9, 25, 51, 0.05),
        0 6px 18px rgba(1, 132, 118, 0.07);
    --vmt-shadow-lift: 0 4px 10px rgba(9, 25, 51, 0.06),
        0 14px 34px rgba(1, 167, 150, 0.18);

    --vmt-font-display: 'Baloo 2', 'Trebuchet MS', sans-serif;
    --vmt-font-body: 'Nunito', 'Segoe UI', sans-serif;
}

/* ---------- Socle global (tout HumHub, pour la cohérence) ---------- */

body {
    background:
        radial-gradient(1100px 340px at 18% -60px, rgba(220, 243, 241, 0.55), transparent 70%),
        var(--vmt-wash);
    font-family: var(--vmt-font-body);
    color: var(--vmt-ink-2);
}

h1, h2, h3, h4 {
    font-family: var(--vmt-font-display);
    color: var(--vmt-ink);
    letter-spacing: -0.01em;
}

h1 {
    font-weight: 700;
}

/* ---------- Barre du haut : bleu nuit, accents turquoise ---------- */

#topbar-first.topbar {
    background: linear-gradient(100deg, #0B1F3E 0%, #091933 55%, #0D2745 100%) !important;
    background-color: #091933;
    box-shadow: 0 2px 14px rgba(9, 25, 51, 0.28);
}

#topbar-first .nav > li > a {
    color: #B9D9D4 !important;
}

/* Boutons ronds de la barre (notifications, messages, compte) :
   finis les carrés turquoise, place à la discrétion sur bleu nuit */

#topbar-first .btn-group > a,
#topbar-first .dropdown.account > a,
#topbar-first li.account > a {
    background: transparent !important;
    color: #B9D9D4 !important;
    border-radius: 12px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#topbar-first .btn-group > a:hover,
#topbar-first .dropdown.account > a:hover,
#topbar-first li.account > a:hover,
#topbar-first .nav > li > a:hover,
#topbar-first .nav > li.open > a,
#topbar-first .nav > li.active > a {
    background: rgba(255, 255, 255, 0.10) !important;
    color: #FFFFFF !important;
}

/* La rangée de menus blanche (#topbar-second) : libellés en Baloo,
   indicateur double point sur l'élément actif */

#topbar-second .nav > li > a,
#topbar-second .nav > li .nav-link {
    font-family: var(--vmt-font-display) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    position: relative;
}

#topbar-second .nav > li.active > a,
#topbar-second .nav > li.active .nav-link,
#topbar-second .nav > li > a:hover {
    color: var(--vmt-teal-deep) !important;
}

#topbar-second .nav > li.active > a::before,
#topbar-second .nav > li.active .nav-link::before {
    content: '';
    display: block;
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 5px;
    background:
        radial-gradient(circle at 3px 2.5px, var(--vmt-teal) 2.2px, transparent 2.7px),
        radial-gradient(circle at 12px 2.5px, var(--vmt-teal-bright) 2.2px, transparent 2.7px);
    background-size: 7px 5px, 7px 5px;
    background-repeat: no-repeat;
}

/* ---------- Boutons : pilules de la bulle ---------- */

.btn {
    border-radius: 999px;
    font-family: var(--vmt-font-display);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.16s ease, box-shadow 0.16s ease,
        background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn:not(.disabled):not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

.btn-primary {
    background: linear-gradient(135deg, var(--vmt-teal) 0%, var(--vmt-teal-deep) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(1, 167, 150, 0.32);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--vmt-teal-bright) 0%, var(--vmt-teal) 100%);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(1, 167, 150, 0.4);
}

.btn-outline-primary {
    color: var(--vmt-teal-deep);
    border: 1.5px solid var(--vmt-teal);
    background: #fff;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background: var(--vmt-teal-faint);
    color: var(--vmt-teal-deep);
    border-color: var(--vmt-teal);
    transform: translateY(-1px);
}

.btn-default, .btn-light {
    border-radius: 999px;
}

/* ---------- Feuille de page (nos écrans) ---------- */

.container[style*="max-width"] {
    background: #fff;
    border: 1px solid var(--vmt-line);
    border-radius: calc(var(--vmt-radius-card) + 6px);
    box-shadow: var(--vmt-shadow);
    padding: 2rem 2.2rem 2.4rem;
    margin-top: 1.4rem;
}

.container[style*="max-width"] h1 {
    margin-bottom: 0.2rem;
}

.container[style*="max-width"] .lead {
    color: var(--vmt-muted);
    font-size: 1.02rem;
}

/* Surligneur sous le titre : trait turquoise + double point */

.container[style*="max-width"] h1::after {
    content: '';
    display: block;
    width: 64px;
    height: 5px;
    margin-top: 0.55rem;
    border-radius: 999px;
    background:
        radial-gradient(circle at 4px 2.5px, var(--vmt-teal) 2.4px, transparent 3px),
        radial-gradient(circle at 12px 2.5px, var(--vmt-teal-bright) 2.4px, transparent 3px),
        linear-gradient(90deg, var(--vmt-teal) 22px, var(--vmt-teal-soft) 22px);
    background-size: 16px 5px, 16px 5px, 100% 5px;
    background-repeat: no-repeat;
}

.vmt-kicker {
    font-family: var(--vmt-font-display);
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--vmt-teal);
    margin-bottom: 0.1rem;
}

.vmt-sign {
    margin-top: 2.2rem;
    color: var(--vmt-muted);
    font-style: italic;
    font-size: 0.9rem;
}

/* ---------- Cartes génériques ---------- */

.card {
    border: 1px solid var(--vmt-line);
    border-radius: var(--vmt-radius-card);
    box-shadow: var(--vmt-shadow);
    background: #fff;
}

.card-body {
    border-radius: inherit;
}

/* ---------- PASTILLES D'ICÔNES : la bulle du logo ---------- */

.vmt-icon-disc,
.vmt-empty-disc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 32%;
    background: linear-gradient(140deg, var(--vmt-teal-soft) 0%, #C4EBE5 100%);
    color: var(--vmt-teal-deep);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vmt-icon-disc {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    box-shadow: inset 0 0 0 2px rgba(1, 167, 150, 0.25);
}

.vmt-empty-disc {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
}

/* ============================================================
   COMMUNAUTÉS
   ============================================================ */

.vmt-section {
    margin-bottom: 1.7rem;
}

.vmt-section-title {
    margin-bottom: 0.75rem;
}

.vmt-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--vmt-line-strong);
    color: var(--vmt-ink);
    border-radius: 999px;
    padding: 0.3rem 0.55rem 0.3rem 0.4rem;
    font-family: var(--vmt-font-display);
    font-weight: 700;
    font-size: 0.86rem;
}

.vmt-type-badge .fa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 32%;
    background: linear-gradient(140deg, var(--vmt-teal-soft), #C4EBE5);
    color: var(--vmt-teal-deep);
    font-size: 0.78rem;
}

.vmt-type-badge--soft {
    color: var(--vmt-muted);
}

.vmt-type-badge--soft .fa {
    background: #EEF2F5;
    color: var(--vmt-muted);
}

.vmt-type-count {
    background: var(--vmt-teal-soft);
    color: var(--vmt-teal-deep);
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 0.05rem 0.5rem;
    font-family: var(--vmt-font-body);
}

/* La grille et la CARTE communauté : la réponse au « on ne sait pas
   que c'est cliquable ». Toute la carte est un lien, le survol la lève. */

.vmt-comm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 0.9rem;
}

.vmt-comm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 1.05rem 2.6rem 1.05rem 1.15rem;
    background: #fff;
    border: 1px solid var(--vmt-line-strong);
    border-radius: var(--vmt-radius-card);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease,
        border-color 0.18s ease;
}

/* Balayage de lumière au survol (CSS pur) */
.vmt-comm-card::before {
    content: '';
    position: absolute;
    inset: -60% 55% 55% -30%;
    background: radial-gradient(closest-side, rgba(23, 189, 169, 0.16), transparent);
    opacity: 0;
    transform: translate(-30%, -30%);
    transition: opacity 0.25s ease, transform 0.4s ease;
    pointer-events: none;
}

.vmt-comm-card:hover,
.vmt-comm-card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--vmt-teal);
    box-shadow: var(--vmt-shadow-lift);
    text-decoration: none;
}

.vmt-comm-card:hover::before,
.vmt-comm-card:focus-visible::before {
    opacity: 1;
    transform: translate(0, 0);
}

.vmt-comm-name {
    font-family: var(--vmt-font-display);
    font-weight: 600;
    font-size: 1.04rem;
    color: var(--vmt-ink);
    line-height: 1.25;
}

.vmt-comm-card:hover .vmt-comm-name {
    color: var(--vmt-teal-deep);
}

.vmt-comm-meta {
    color: var(--vmt-muted);
    font-size: 0.85rem;
}

/* Chevron : glisse et s'allume au survol */
.vmt-comm-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--vmt-teal);
    background: var(--vmt-teal-faint);
    opacity: 0.55;
    transition: opacity 0.18s ease, transform 0.18s ease,
        background-color 0.18s ease, color 0.18s ease;
}

.vmt-comm-card:hover .vmt-comm-arrow,
.vmt-comm-card:focus-visible .vmt-comm-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    background: var(--vmt-teal);
    color: #fff;
}

/* Section vide : une ligne discrète, jamais un bloc */

.vmt-empty-line {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border: 1.5px dashed var(--vmt-line-strong);
    border-radius: 14px;
    color: var(--vmt-muted);
    font-size: 0.92rem;
}

.vmt-empty-line a {
    color: var(--vmt-teal-deep);
    font-weight: 700;
}

.vmt-empty-line a:hover {
    color: var(--vmt-teal);
}

/* ---------- États vides génériques ---------- */

.vmt-empty {
    text-align: center;
    padding: 1.6rem 1rem;
    color: var(--vmt-muted);
}

.vmt-empty .fa {
    display: block;
    font-size: 1.6rem;
    color: var(--vmt-teal);
    margin-bottom: 0.5rem;
}

/* ---------- Formulaires ---------- */

.form-label {
    font-weight: 700;
    color: var(--vmt-ink);
}

.form-control, .form-select {
    border-radius: var(--vmt-radius-control);
    border-color: var(--vmt-line-strong);
    font-family: var(--vmt-font-body);
}

.form-control:focus, .form-select:focus {
    border-color: var(--vmt-teal);
    box-shadow: 0 0 0 3px rgba(1, 167, 150, 0.18);
}

/* ---------- Cartes de rôle et cartes-choix (parcours) ---------- */

.vmt-role {
    transition: transform 0.18s ease, box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.vmt-role:hover {
    transform: translateY(-3px);
    border-color: var(--vmt-teal);
    box-shadow: var(--vmt-shadow-lift);
}

.vmt-role:hover .vmt-icon-disc {
    transform: scale(1.06) rotate(-3deg);
}

.vmt-choice {
    position: relative;
    display: block;
    border: 1.5px solid var(--vmt-line-strong);
    border-radius: var(--vmt-radius-card);
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
        background-color 0.15s ease, transform 0.15s ease;
}

.vmt-choice:hover {
    border-color: var(--vmt-teal);
    transform: translateY(-2px);
    box-shadow: var(--vmt-shadow);
}

.vmt-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vmt-choice:has(input:checked) {
    border-color: var(--vmt-teal);
    background: var(--vmt-teal-faint);
    box-shadow: 0 0 0 3px var(--vmt-teal-soft);
}

.vmt-choice:has(input:focus-visible) {
    outline: 3px solid var(--vmt-teal-soft);
    outline-offset: 2px;
}

.vmt-choice-title {
    font-family: var(--vmt-font-display);
    font-weight: 700;
    color: var(--vmt-ink);
}

.vmt-choice-desc {
    color: var(--vmt-muted);
    font-size: 0.92rem;
}

/* ---------- Fil du coach : bulles de dialogue (comme le logo) ---------- */

.vmt-thread {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.vmt-bubble {
    max-width: 85%;
    border-radius: 18px;
    padding: 0.75rem 1.05rem;
    font-size: 0.96rem;
    line-height: 1.5;
}

.vmt-bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--vmt-ink) 0%, #12305A 100%);
    color: #F2FBFA;
    border-bottom-right-radius: 6px;
}

.vmt-bubble-coach {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--vmt-line-strong);
    border-bottom-left-radius: 6px;
    box-shadow: var(--vmt-shadow);
}

.vmt-bubble-meta {
    font-family: var(--vmt-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--vmt-muted);
    margin-bottom: 0.2rem;
}

.vmt-bubble-coach .vmt-bubble-meta {
    color: var(--vmt-teal-deep);
}

/* ---------- Patience du coach ---------- */

.vmt-wait {
    border: 1.5px dashed var(--vmt-teal);
    background: linear-gradient(160deg, var(--vmt-teal-faint), #fff);
    border-radius: var(--vmt-radius-card);
    padding: 1.2rem 1.25rem;
    text-align: center;
}

.vmt-wait-dots {
    display: inline-flex;
    gap: 0.32rem;
    margin-bottom: 0.5rem;
}

.vmt-wait-dots span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--vmt-teal);
    display: inline-block;
    animation: vmtPulse 1.2s ease-in-out infinite;
}

.vmt-wait-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.vmt-wait-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes vmtPulse {
    0%, 100% { opacity: 0.25; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- Bannière de profil : fin du gris, place à la marque ---------- */

.img-profile-data,
.profile-banner-image-container,
.image-upload-container.profile-banner-image-container {
    background: linear-gradient(115deg, #0B1F3E 0%, #0A2440 45%, var(--vmt-teal-deep) 130%) !important;
    background-image: linear-gradient(115deg, #0B1F3E 0%, #0A2440 45%, var(--vmt-teal-deep) 130%) !important;
}

.img-profile-header-background {
    opacity: 0 !important;
}

/* Le nom sur la bannière, dans la police du logo */
.panel-profile-header .img-profile-data h1,
.panel-profile-header span.typed-username {
    font-family: var(--vmt-font-display) !important;
    color: #FFFFFF !important;
    text-shadow: 0 2px 10px rgba(9, 25, 51, 0.45);
}

/* ---------- Tableaux et listes HumHub usuelles ---------- */

.table > thead > tr > th {
    font-family: var(--vmt-font-display);
    color: var(--vmt-ink);
}

.list-group-item {
    border-color: var(--vmt-line);
    transition: background-color 0.15s ease;
}

.list-group-item:hover {
    background: var(--vmt-teal-faint);
}

/* ---------- Alertes ---------- */

.alert-success {
    border: 1px solid #BFE8D9;
    background: #F0FBF6;
    color: #14684F;
    border-radius: 14px;
}

.alert-danger {
    border: 1px solid #F3C6CE;
    background: #FDF3F5;
    color: #8E3245;
    border-radius: 14px;
}

/* ---------- Pages invités (connexion/inscription) : nuit de la marque ---------- */

body.login-container {
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(23, 189, 169, 0.35), transparent 65%),
        linear-gradient(160deg, #0B1F3E 0%, #091933 55%, #062B3F 100%) !important;
    background-attachment: fixed;
}

body.login-container #login-form,
body.login-container #register-form {
    border-radius: var(--vmt-radius-card) !important;
    border: none;
    box-shadow: 0 18px 44px rgba(4, 14, 30, 0.45);
}

body.login-container #img-logo {
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(4, 14, 30, 0.4);
}

body.login-container .panel-heading {
    font-family: var(--vmt-font-display);
    color: var(--vmt-ink);
}

/* ---------- Accessibilité ---------- */

a:focus-visible, button:focus-visible, .btn:focus-visible {
    outline: 3px solid var(--vmt-teal);
    outline-offset: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }

    .vmt-wait-dots span {
        animation: none;
        opacity: 0.85;
    }
}

/* ---------- Mobile ---------- */

@media (max-width: 767.98px) {
    .container[style*="max-width"] {
        padding: 1.3rem 1.1rem 1.6rem;
    }

    .vmt-icon-disc {
        width: 46px;
        height: 46px;
        font-size: 1.15rem;
    }

    .vmt-bubble {
        max-width: 100%;
    }

    .vmt-comm-grid {
        grid-template-columns: 1fr;
    }

    .vmt-comm-card {
        padding: 0.9rem 2.4rem 0.9rem 1rem;
    }

    .vmt-row {
        flex-direction: column;
        gap: 0.15rem;
        align-items: flex-start;
    }

    .vmt-row-meta {
        white-space: normal;
    }
}
