/* style.css - Polska Finanse Państwowe avec animations */

:root {
    --primary: #DC143C;
    --primary-dark: #b01030;
    --primary-light: #ff1a4a;
    --primary-rgb: 220, 20, 60;
    --gray-dark: #1a1e29;
    --gray-light: #f8fafc;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--gray-light);
    color: var(--gray-dark);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, .font-serif {
    font-family: 'Playfair Display', serif;
}

/* ========== GOV BANNER ========== */
.gov-banner {
    background: var(--gray-dark);
    color: white;
    font-size: 0.7rem;
    padding: 0.25rem 0;
}

/* ========== ANIMATIONS GLOBALES ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 20, 60, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 20, 60, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 20, 60, 0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(220, 20, 60, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 20, 60, 0.6);
    }
    100% {
        box-shadow: 0 0 5px rgba(220, 20, 60, 0.3);
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Classes d'animation */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-fadeInScale {
    animation: fadeInScale 0.5s ease-out forwards;
}

.animate-slideInUp {
    animation: slideInUp 0.5s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 10s linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Délais d'animation */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ========== BOUTONS AVEC ANIMATIONS ========== */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 20, 60, 0.3);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 20, 60, 0.3);
}

/* ========== CARTES AVEC ANIMATIONS ========== */
.card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.card:hover::after {
    left: 100%;
}

/* ========== NAVBAR STICKY AVEC ANIMATION ========== */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* ========== HERO SLIDER ANIMATIONS ========== */
.carousel-item {
    transition: transform 0.6s ease-in-out;
}

.carousel-item .container {
    animation: fadeInUp 0.8s ease-out;
}

.carousel-control-prev,
.carousel-control-next {
    opacity: 0;
    visibility: hidden;
    width: 48px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    height: 48px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: opacity .25s ease, visibility .25s ease, background .2s ease;
    z-index: 10;
}
.carousel-control-prev { left: 1rem; }
.carousel-control-next { right: 1rem; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.carousel:hover .carousel-control-prev,
.carousel:hover .carousel-control-next {
    opacity: 1;
    visibility: visible;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(220,20,60,.6);
}

/* ========== STATS COUNTERS ========== */
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    transition: all 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
}

/* ========== FORMULAIRES AVEC ANIMATIONS ========== */
.form-control, .form-select {
    transition: all 0.3s ease;
    border-width: 1px;
}

.form-control:focus, .form-select:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.1);
    border-color: var(--primary);
}

/* ========== ACCORDION AVEC ANIMATIONS ========== */
.accordion-button {
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(220, 20, 60, 0.05);
    color: var(--primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.25);
}

.accordion-body {
    animation: fadeInUp 0.4s ease-out;
}

/* ========== TABLEAUX AVEC ANIMATIONS ========== */
.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(220, 20, 60, 0.05);
    transform: translateX(5px);
}

/* ========== PROGRESS BARS ========== */
.progress-bar {
    background-color: var(--primary);
    transition: width 1s ease-out;
}

/* ========== TOOLTIPS ========== */
.tooltip-inner {
    background-color: var(--primary);
}

/* ========== SCROLL REVEAL ========== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== PARTICLES BACKGROUND ========== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    background-color: rgba(220, 20, 60, 0.1);
    border-radius: 50%;
    pointer-events: none;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ========== HOVER AVATARS / ICONS ========== */
.icon-hover {
    transition: all 0.3s ease;
}

.icon-hover:hover {
    transform: scale(1.1) rotate(5deg);
    color: var(--primary) !important;
}

/* ========== COUNTDOWN / TIMER ========== */
.countdown {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    gap: 1rem;
}

.countdown-item {
    text-align: center;
    color: white;
}

.countdown-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: monospace;
}

.countdown-label {
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* ========== TYPING EFFECT ========== */
.typing-text {
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    overflow: hidden;
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* ========== LOADER ========== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.page-loader.hide {
    opacity: 0;
    pointer-events: none;
}

/* ========== NOTIFICATION TOAST ========== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

/* ========== BACK TO TOP BUTTON ========== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background-color: var(--primary-dark);
}

/* ========== MARQUEE AMÉLIORÉ ========== */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
}

.marquee-track {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.partner-logo {
    display: inline-block;
    width: 200px;
    margin: 0 0.75rem;
    vertical-align: middle;
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.partner-logo:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ========== RESPONSIVE MOBILE ========== */

/* Prevent horizontal overflow globally — override Bootstrap overflow-x:clip which breaks position:fixed */
html {
    overflow-x: hidden;
}
body {
    overflow-x: hidden !important; /* Bootstrap 5.3 sets overflow-x:clip which breaks position:fixed */
}
img {
    max-width: 100%;
}
video {
    max-width: 100%;
    height: auto;
}
/* Logos et images avec hauteur fixée dans le HTML : ne pas forcer height:auto */
.navbar-brand img,
.gov-logo-wrap img,
footer img {
    max-width: none;
}

@media (max-width: 991.98px) {
    /* ----- HAMBURGER: show on mobile ----- */
    .navbar-toggler {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: .35rem .5rem;
        order: -1;
    }
    /* Hide the desktop "Menu" button on mobile */
    button[data-bs-target="#sideMenu"].d-none {
        display: none !important;
    }

    /* ----- NAVBAR: compact on mobile ----- */
    .navbar .container {
        flex-wrap: nowrap;
        gap: .25rem;
    }
    .navbar-brand {
        gap: .5rem !important;
        flex: 1;
        min-width: 0;
    }
    .navbar-brand .navbar-brand-text .site-name {
        font-size: .85rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .navbar-brand .navbar-brand-text .site-sub {
        display: none;
    }
    .navbar-brand img {
        height: 36px !important;
        flex-shrink: 0;
    }

    /* ----- GOV LOGO in navbar: compact ----- */
    .gov-logo-wrap img {
        height: 32px !important;
    }
    .gov-logo-wrap .rp-label {
        display: none;
    }

    /* ----- SUB BANNER (below gov): simplify ----- */
    .sub-banner .d-flex {
        flex-direction: column;
        gap: .25rem !important;
        text-align: center;
    }
    .sub-banner .text-white-50,
    .sub-banner span:nth-child(n+3) {
        display: none;
    }

    /* ----- FLOATING CTA: centré en bas, largeur auto ----- */
    .floating-cta {
        left: 0 !important;
        right: 0 !important;
        bottom: 1rem !important;
        top: auto !important;
        display: flex;
        justify-content: center;
        white-space: nowrap;
        width: 100%;
    }
    .floating-cta a {
        padding: .55rem 1.25rem;
        font-size: .82rem;
        border-radius: 10px;
        display: inline-flex;
        animation: none !important;
    }

    /* ----- HERO SLIDE: smaller text, stack buttons ----- */
    .hero-slide h1 {
        font-size: 1.6rem !important;
        line-height: 1.25;
    }
    .hero-slide .display-4 {
        font-size: 1.6rem !important;
    }
    .hero-slide .lead {
        font-size: .875rem !important;
    }
    .hero-slide .d-flex.gap-3 {
        flex-direction: column;
        gap: .5rem !important;
    }
    .hero-slide .btn {
        width: 100%;
        text-align: center;
    }
    /* Carousel height on mobile */
    .hero-slide {
        min-height: 480px !important;
        padding-bottom: 4rem;
    }

    /* ----- STATS: 2 columns ----- */
    .stats-row .col-6 {
        margin-bottom: .5rem;
    }

    /* ----- COMPARATEUR TABLE: horizontal scroll label ----- */
    .table-responsive {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }

    /* ----- PARTNER LOGO width ----- */
    .partner-logo {
        width: 140px;
    }

    /* ----- GUARANTEE BANNER BADGES: wrap ----- */
    .rounded-4 .d-flex.flex-wrap {
        justify-content: flex-start !important;
    }
}

@media (max-width: 575.98px) {
    /* ----- CONTAINERS ----- */
    .container {
        padding-left: .875rem;
        padding-right: .875rem;
    }

    /* ----- NAVBAR brand even more compact ----- */
    .navbar-brand .navbar-brand-text .site-name {
        font-size: .78rem !important;
    }
    .navbar-brand img {
        height: 30px !important;
    }

    /* ----- HERO: very small screens ----- */
    .hero-slide h1,
    .hero-slide .display-4 {
        font-size: 1.35rem !important;
    }
    .hero-slide {
        min-height: 420px !important;
    }

    /* ----- STATS numbers ----- */
    .stat-number {
        font-size: 1.6rem;
    }

    /* ----- STEP CARDS: stack fully ----- */
    .row.g-4 > .col-md-4 {
        width: 100%;
    }

    /* ----- TRUST SECTION 3 cards: full width ----- */
    .row.g-4 > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* ----- TESTIMONIALS: full width ----- */
    .row.g-4 > .col-md-4 {
        flex: 0 0 100%;
    }

    /* ----- PROPAGANDE guarantee band: stack ----- */
    .rounded-4 .row.align-items-center > .col-md-6 {
        text-align: center;
    }
    .rounded-4 .d-flex.flex-wrap.gap-2 {
        justify-content: center !important;
    }

    /* ----- TAB BUTTONS: smaller text ----- */
    .nav-tabs .nav-link {
        font-size: .8rem;
        padding: .5rem .75rem;
    }

    /* ----- HERO CAROUSEL INDICATORS: smaller ----- */
    .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
    }

    /* ----- MARQUEE LOGOS smaller ----- */
    .partner-logo {
        width: 110px;
        padding: .5rem;
    }
}

/* Legacy catch-all */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1.8rem;
    }
}

/* ========== HAMBURGER / MENU OFFCANVAS BUTTONS ========== */
/* Desktop: hide the hamburger (≡) AND the "Menu" text button */
@media (min-width: 992px) {
    .navbar-toggler,
    button[data-bs-target="#sideMenu"]:not(.navbar-toggler) {
        display: none !important;
    }
}
/* Mobile: hamburger visible, desktop Menu button hidden */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: inline-flex !important;
    }
    button[data-bs-target="#sideMenu"]:not(.navbar-toggler) {
        display: none !important;
    }
}

/* ========== HOVER DROPDOWNS (desktop) ========== */
@media (min-width: 992px) {
    .navbar .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
        pointer-events: none;
        margin-top: 0;
        /* Alignement à droite du bouton parent */
        left: auto !important;
        right: 0 !important;
        min-width: 220px;
    }
    
    .navbar .nav-item.dropdown:hover > .dropdown-menu,
    .navbar .nav-item.dropdown.show > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    /* Garde l'élément parent actif pendant le hover */
    .navbar .nav-item.dropdown:hover > .dropdown-toggle {
        color: var(--primary);
    }
}

/* Forcer l'alignement à droite pour tous les dropdowns de la navbar */
.navbar .dropdown-menu[data-bs-popper] {
    left: auto !important;
    right: 0 !important;
}

/* Correction pour éviter le chevauchement des dropdowns */
.navbar-nav .dropdown-menu {
    position: absolute !important;
    z-index: 1050 !important;
}

/* S'assurer que les dropdowns ne débordent pas de l'écran à droite */
@media (min-width: 992px) {
    .navbar-nav .dropdown-menu {
        right: 0 !important;
        left: auto !important;
    }
}