/* Design moderne pour l'en-tête card-waves */

.header-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
    border: none;
}

/* Variante CARFO avec couleur verte (comme login) */
.header-modern.header-carfo {
    background: linear-gradient(135deg, #0f7a2f 0%, #1e9d47 55%, #2fb344 100%);
    box-shadow: 0 12px 40px rgba(15, 122, 47, 0.18);
    border-radius: 16px;
}

/* En-tête public index : carte plus compacte (moins de hauteur) */
.header-modern.header-carfo .card-body {
    padding: 1.25rem 1.35rem;
}

.header-modern.header-carfo .header-logo-section {
    gap: 0.9rem;
    margin-bottom: 0.75rem;
}

.header-modern.header-carfo .header-logo {
    width: 64px;
    height: 64px;
    padding: 9px;
    animation: none;
}

.header-modern.header-carfo .header-title {
    min-width: 0;
}

.header-modern.header-carfo .header-title h1 {
    font-size: clamp(1.2rem, 2.8vw, 1.75rem);
    line-height: 1.22;
}

.header-modern.header-carfo .header-title .subtitle {
    font-size: clamp(0.78rem, 1.6vw, 0.92rem);
    margin-top: 0.3rem;
    line-height: 1.35;
}

.header-modern.header-carfo .header-badge {
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
}

.header-modern.header-carfo .header-title > .mb-2 {
    margin-bottom: 0.35rem !important;
}

.header-modern.header-carfo .header-info-box {
    padding: 0.75rem 0.95rem;
    margin-top: 0.65rem;
    border-radius: 12px;
}

.header-modern.header-carfo .header-info-box p {
    font-size: clamp(0.8rem, 1.5vw, 0.92rem);
    line-height: 1.45;
}

.header-modern.header-carfo .header-info-box i {
    font-size: 0.95rem;
    margin-right: 0.45rem;
    vertical-align: middle;
}

.header-modern.header-carfo .header-illustration img {
    max-width: 118px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.22));
}

.header-modern.header-carfo .header-nav {
    margin-top: 0.95rem;
    padding-top: 0.75rem;
    gap: 0.5rem;
}

.header-modern.header-carfo .header-nav .nav-link {
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
}

/* Effet de vague en arrière-plan */
.header-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23ffffff' fill-opacity='0.1' d='M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
    opacity: 0.10;
    pointer-events: none;
}

/* Corps de la carte avec padding moderne */
.header-modern .card-body {
    position: relative;
    z-index: 1;
    padding: 2.5rem 2rem;
}

/* Container du logo et titre */
.header-logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.header-logo {
    width: 90px;
    height: 90px;
    background: white;
    border-radius: 50%;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Titre principal moderne */
.header-title {
    flex: 1;
    min-width: 250px;
}

.header-title h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.14);
    letter-spacing: -0.5px;
}

.header-title .subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.95);
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Badge moderne */
.header-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Box d'information avec effet glassmorphism */
.header-info-box {
    background: rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 1.5rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

.header-info-box p {
    color: white;
    margin: 0;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    line-height: 1.6;
    font-weight: 400;
}

.header-info-box i {
    font-size: 1.3rem;
    margin-right: 0.8rem;
    opacity: 0.9;
}

/* Image d'illustration moderne */
.header-illustration {
    position: relative;
    text-align: center;
}

.header-illustration img {
    max-width: 200px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: fadeInRight 1s ease-out;
}

/* Navigation moderne avec effet glassmorphism */
.header-nav {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.header-shortcuts {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.header-shortcut-btn {
    flex: 1 1 260px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    border-radius: 18px;
    padding: 0.95rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.header-shortcut-btn::after {
    content: '';
    position: absolute;
    inset: -60px -60px auto -60px;
    height: 120px;
    transform: rotate(12deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
    opacity: 0.7;
    pointer-events: none;
}

.header-shortcut-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.16);
    filter: brightness(1.02);
}

.header-shortcut-btn i,
.header-shortcut-btn [data-feather] {
    font-size: 1.05rem;
}

.header-shortcut-new {
    background: linear-gradient(135deg, #45f3a4 0%, #00ac69 55%, #0b5e44 100%);
}

.header-shortcut-modify {
    background: linear-gradient(135deg, #ff6b6b 0%, #e11d48 55%, #a3122b 100%);
}

@media (max-width: 576px) {
    .header-shortcut-btn {
        flex: 1 1 100%;
    }
}

.header-nav .nav-link {
    color: white !important;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    margin-right: 0;
    margin-bottom: 0;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.header-nav .nav-link {
    /* Empêche un débordement sur très petits écrans */
    white-space: normal;
}

.header-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header-nav .nav-link.active {
    background: white;
    color: #00ac69 !important;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.header-nav .nav-link i {
    font-size: 1rem;
}

/* Boutons d'action dans l'en-tête */
.header-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.header-action-btn {
    background: white;
    color: #00ac69;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid white;
}

.header-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    color: #00ac69;
}

.header-action-btn.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.header-action-btn.btn-outline:hover {
    background: white;
    color: #00ac69;
}

/* Bouton "Faire ma demande" - raccourci dans le header
   Couleur unie rouge danger (identique au bandeau Flash Infos) */
.btn-quick-request,
a.btn-quick-request,
.btn.btn-quick-request {
    background: #dc3545 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-size: 1rem;
    letter-spacing: 0.3px;
    border: none !important;
    transition: all 0.35s ease;
    animation: btn-quick-pulse 2.2s infinite, btn-quick-wiggle 3s ease-in-out infinite;
    transform-origin: center center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-quick-request i.fa-arrow-right,
.btn-quick-request i.fa-arrow-down,
.btn-quick-request i.fa-file-signature {
    transition: transform 0.3s ease;
    font-size: 0.95rem;
}

.btn-quick-request:hover,
a.btn-quick-request:hover,
.btn.btn-quick-request:hover {
    transform: translateY(-2px);
    color: #ffffff !important;
    background: #c82333 !important;
    background-image: none !important;
    box-shadow: 0 8px 22px rgba(220, 53, 69, 0.55) !important;
    animation-play-state: paused;
}

.btn-quick-request:hover i.fa-arrow-right {
    transform: translateX(4px);
}

.btn-quick-request:hover i.fa-arrow-down {
    transform: translateY(3px);
}

.btn-quick-request:hover i.fa-file-signature {
    transform: scale(1.15) rotate(-6deg);
}

.btn-quick-request:focus,
.btn-quick-request:active,
a.btn-quick-request:focus,
a.btn-quick-request:active {
    color: #ffffff !important;
    background: #c82333 !important;
    background-image: none !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.45) !important;
}

/* Effet de surbrillance sur la section ciblée par le scroll */
.section-highlight {
    animation: section-flash 2s ease;
}

@keyframes section-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 172, 105, 0.55);
        transform: scale(1);
    }
    40% {
        box-shadow: 0 0 0 12px rgba(0, 172, 105, 0.18);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 172, 105, 0);
        transform: scale(1);
    }
}

@keyframes btn-quick-pulse {
    0% {
        box-shadow: 0 4px 14px rgba(220, 53, 69, 0.45), 0 0 0 0 rgba(220, 53, 69, 0.6);
    }
    70% {
        box-shadow: 0 4px 14px rgba(220, 53, 69, 0.45), 0 0 0 12px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 4px 14px rgba(220, 53, 69, 0.45), 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Animation de balancement (wiggle) : le bouton bouge légèrement
   pour attirer l'attention. La majorité du cycle reste immobile,
   puis un petit "shake" se produit en fin de cycle. */
@keyframes btn-quick-wiggle {
    0%, 70%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    74% {
        transform: translate(-3px, -1px) rotate(-3deg);
    }
    78% {
        transform: translate(3px, -1px) rotate(3deg);
    }
    82% {
        transform: translate(-3px, 0) rotate(-2deg);
    }
    86% {
        transform: translate(2px, -1px) rotate(2deg);
    }
    90% {
        transform: translate(-1px, 0) rotate(-1deg);
    }
    94% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes btn-gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Adaptations responsives du bouton de raccourci */
@media (max-width: 576px) {
    .btn-quick-request {
        font-size: 0.9rem;
        padding: 0.55rem 1.1rem !important;
    }
    .btn-quick-request i.fa-arrow-right,
    .btn-quick-request i.fa-arrow-down {
        display: none;
    }
}

/* Accessibilité : désactiver les animations pour les utilisateurs
   qui préfèrent un mouvement réduit. */
@media (prefers-reduced-motion: reduce) {
    .btn-quick-request,
    a.btn-quick-request,
    .btn.btn-quick-request {
        animation: none !important;
    }
}

/* Stats ou indicateurs */
.header-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.header-stat-item {
    text-align: center;
    color: white;
}

.header-stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.header-stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 0.3rem;
    display: block;
}

/* Responsive Design */
@media (max-width: 992px) {
    .header-modern .card-body {
        padding: 2rem 1.5rem;
    }

    .header-modern.header-carfo .card-body {
        padding: 1.1rem 1.15rem;
    }

    .header-logo {
        width: 70px;
        height: 70px;
        padding: 12px;
    }

    .header-modern.header-carfo .header-logo {
        width: 56px;
        height: 56px;
        padding: 8px;
    }

    .header-illustration img {
        max-width: 150px;
    }

    .header-modern.header-carfo .header-illustration img {
        max-width: 100px;
    }
}

@media (max-width: 768px) {
    .header-modern .card-body {
        padding: 1.5rem 1rem;
    }

    .header-modern.header-carfo .card-body {
        padding: 1rem 0.9rem;
    }

    .header-logo-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-modern.header-carfo .header-logo-section {
        gap: 0.65rem;
    }

    .header-title {
        text-align: center;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .header-info-box {
        padding: 1.2rem;
    }

    .header-modern.header-carfo .header-info-box {
        padding: 0.7rem 0.8rem;
    }

    .header-nav .nav-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .header-modern.header-carfo .header-nav .nav-link {
        padding: 0.45rem 0.85rem;
        font-size: 0.8rem;
    }

    .header-illustration img {
        max-width: 120px;
    }

    .header-modern.header-carfo .header-illustration img {
        max-width: 88px;
    }
}

@media (max-width: 576px) {
    .header-nav {
        justify-content: center;
        padding-top: 1.2rem;
        width: 100%;
    }

    .header-nav .nav-link {
        flex: 0 0 auto;
    }
}

/* Animation d'entrée */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Effet de brillance subtile */
.header-modern::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 10s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

