/* 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%); }
}


/* ── CRITICAL: suppress Bootstrap's default SVG background on .navbar-toggler ─ */
/* Bootstrap 5.3 auto-injects a hamburger/cross SVG via background-image.        */
/* We use our own <i class="bi bi-list"> so we must kill the default.             */
.navbar-toggler {
    background-image: none !important;
}
.navbar-toggler:focus {
    box-shadow: none !important;
}
.navbar-toggler-icon {
    display: none !important;
    background-image: none !important;
}

/* ========== RESPONSIVE — see RESPONSIVE SYSTEM block below ========== */

/* ================================================================
   RESPONSIVE SYSTEM — PFN
   Principe : même disposition sur tous les appareils.
   On réduit les tailles et paddings, on ne réorganise pas.
   3 breakpoints : 1200px · 992px · 576px
   ================================================================ */

/* ── BASE : anti-overflow global ─────────────────────────────── */
html { overflow-x: hidden; }
body { overflow-x: hidden !important; }

*, *::before, *::after { box-sizing: border-box; }

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
}
/* Logos à hauteur fixe : ne pas écraser */
.navbar-brand img,
footer img {
    height: auto;
    max-height: 55px;
}

/* Tables : toujours scrollables horizontalement */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
/* Hint scroll sur tablette/mobile */
@media (max-width: 991.98px) {
    .table-responsive::before {
        content: '← Przewiń →';
        display: block;
        text-align: center;
        font-size: .68rem;
        color: #9ca3af;
        padding: .2rem 0 .4rem;
    }
}

/* ── FLOATING CTA ─────────────────────────────────────────────── */
.floating-cta {
    position: fixed;
    bottom: 90px;
    right: 28px;
    z-index: 9999;
    max-width: calc(100vw - 2rem);
}
.floating-cta a {
    white-space: nowrap;
}

/* ── NAVBAR ───────────────────────────────────────────────────── */
/* Desktop : inchangé */
@media (min-width: 992px) {
    .navbar-toggler { display: none !important; }
    button[data-bs-target="#sideMenu"]:not(.navbar-toggler) { display: none !important; }
    .navbar-collapse { display: flex !important; }
}

/* Tablette + mobile */
@media (max-width: 991.98px) {
    .navbar > .container,
    .navbar > .container-fluid {
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0 !important;
    }
    /* Logo brand : flex-grow, mais laisse place au godlo (≈42px) + hamburger (≈44px) */
    .navbar-brand {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 96px); /* 44px hamburger + 44px godlo + 8px gap */
        overflow: hidden;
    }
    .navbar-brand img {
        height: 34px !important;
        max-height: 34px;
        flex-shrink: 0;
        width: auto;
    }
    .navbar-brand .site-sub,
    .navbar-brand > div > div:last-child {
        display: none !important;
    }
    .navbar-brand .site-name,
    .navbar-brand .fw-bold {
        font-size: .82rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    /* Godlo / gov-logo : taille réduite, flex-shrink 0 */
    .godlo-wrap,
    .gov-logo-wrap {
        flex-shrink: 0;
        order: 98;
    }
    .godlo-wrap img,
    .gov-logo-wrap img {
        height: 32px !important;
        width: auto;
    }
    .godlo-wrap .rp-label,
    .gov-logo-wrap .rp-label {
        display: none;
    }
    /* Hamburger : toujours à droite en dernier */
    .navbar-toggler {
        display: inline-flex !important;
        flex-shrink: 0;
        order: 99;
        padding: .3rem .45rem;
        margin-left: .25rem;
    }
    /* Cache le nav horizontal — utilise offcanvas */
    .navbar-collapse { display: none !important; }
    button[data-bs-target="#sideMenu"]:not(.navbar-toggler) { display: none !important; }
}

@media (max-width: 575.98px) {
    .navbar-brand img { height: 28px !important; max-height: 28px; }
    .navbar-brand .site-name,
    .navbar-brand .fw-bold { font-size: .73rem !important; }
    .navbar-brand { max-width: calc(100% - 84px); }
    .godlo-wrap img,
    .gov-logo-wrap img { height: 26px !important; }
}

/* ── SYNERGY STRIP ────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .synergy-strip { font-size: .68rem; padding: .3rem 0; }
    .synergy-strip .container > div > span:nth-child(n+3) { display: none; }
}

/* ── HERO CAROUSEL ────────────────────────────────────────────── */
/* Tablette */
@media (max-width: 991.98px) {
    .hero-slide { min-height: 520px !important; padding-bottom: 3.5rem; }
    .hero-slide h1, .hero-slide .display-4 { font-size: 1.65rem !important; line-height: 1.22; }
    .hero-slide .lead { font-size: .9rem !important; }
    .hero-slide .d-flex.gap-3.flex-wrap { gap: .6rem !important; }
    .hero-slide .btn { min-width: 0; }
    .carousel-indicators [data-bs-target] { width: 10px; height: 10px; }
}
/* Mobile */
@media (max-width: 575.98px) {
    .hero-slide { min-height: 440px !important; padding-bottom: 3rem; }
    .hero-slide h1, .hero-slide .display-4 { font-size: 1.3rem !important; }
    .hero-slide .lead { font-size: .82rem !important; }
    /* Boutons hero : côte à côte sur mobile petit, pas empilés */
    .hero-slide .d-flex.gap-3.flex-wrap .btn {
        flex: 1 1 auto;
        font-size: .8rem;
        padding: .55rem .8rem;
    }
    .hero-slide .pfn-badge { font-size: .6rem; }
}

/* ── SECTIONS TEXTE + TITRES ──────────────────────────────────── */
@media (max-width: 991.98px) {
    .display-4 { font-size: 1.9rem !important; }
    .display-5 { font-size: 1.55rem !important; }
}
@media (max-width: 575.98px) {
    .display-4 { font-size: 1.5rem !important; }
    .display-5 { font-size: 1.25rem !important; }
    h2, .h2 { font-size: 1.3rem !important; }
    h3, .h3 { font-size: 1.1rem !important; }
    h4, .h4 { font-size: 1rem !important; }
    .lead { font-size: .9rem !important; }
    .container { padding-left: .875rem !important; padding-right: .875rem !important; }
}

/* ── GRILLES DE CARTES ────────────────────────────────────────── */
/* Sur tablette (< 992px) : 2 colonnes au lieu de 3 ou 4 */
@media (max-width: 991.98px) and (min-width: 576px) {
    .row.g-4 > .col-lg-3,
    .row.g-3 > .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
/* Sur mobile (< 576px) : toujours 1 colonne pour les cartes md-4/md-6 */
@media (max-width: 575.98px) {
    .row.g-4 > [class*="col-md-"],
    .row.g-3 > [class*="col-md-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    /* Exception : colonnes col-6 restent en 2 colonnes (stats, trust bar) */
    .row.g-4 > .col-6,
    .row.g-3 > .col-6,
    .row > .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* ── STAT NUMBERS ─────────────────────────────────────────────── */
@media (max-width: 991.98px) { .stat-number { font-size: 2rem !important; } }
@media (max-width: 575.98px) { .stat-number { font-size: 1.6rem !important; } }

/* ── BANDES IMAGE HERO (o-nas, kontakt, nbp) ──────────────────── */
/* Les images dans des divs position:relative avec h-100 */
.overflow-hidden[style*="min-height"],
.overflow-hidden[style*="height:auto"] {
    position: relative;
}
.overflow-hidden[style*="min-height"] img,
.overflow-hidden[style*="height:auto"] img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}
@media (max-width: 575.98px) {
    .overflow-hidden[style*="min-height"],
    .rounded-4.overflow-hidden[style*="min-height"] {
        min-height: 0 !important;
        padding-bottom: 42% !important;
    }
}

/* ── CARTES COMMENT ÇA MARCHE (index) ────────────────────────── */
/* Images dans les cartes "3 étapes" */
@media (max-width: 575.98px) {
    div[style*="height:200px"][style*="overflow:hidden"] {
        height: 160px !important;
    }
}

/* ── SECTION OFERTY (dark bg, 2 cols) ────────────────────────── */
/* Les 2 grandes cartes restent côte à côte sur tablette, empilées sur mobile */
@media (max-width: 767.98px) {
    .col-lg-6.scroll-reveal { flex: 0 0 100% !important; max-width: 100% !important; }
}

/* ── TABLEAUX COMPARATEUR ─────────────────────────────────────── */
@media (max-width: 767.98px) {
    #comparateur table { font-size: .75rem; }
    #comparateur table th,
    #comparateur table td { padding: .35rem .4rem; white-space: normal; word-break: break-word; }
    #comparateur table td:first-child { min-width: 120px; }
    #comparateur table td:not(:first-child),
    #comparateur table th:not(:first-child) { min-width: 55px; }
    .nav-tabs .nav-link { font-size: .8rem; padding: .4rem .6rem; }
}

/* ── PARTENAIRES MARQUEE ──────────────────────────────────────── */
@media (max-width: 991.98px) { .partner-logo { width: 145px; height: 65px; } }
@media (max-width: 575.98px) { .partner-logo { width: 110px; height: 55px; padding: .4rem .6rem; } }

/* ── BANDE GARANTIES (rouge) ──────────────────────────────────── */
@media (max-width: 767.98px) {
    .rounded-4[style*="padding:2rem"] {
        padding: 1.25rem 1rem !important;
    }
    .rounded-4[style*="padding:2rem"] .col-md-6:last-child {
        text-align: center;
    }
    .rounded-4[style*="padding:2rem"] .d-flex.flex-wrap {
        justify-content: center !important;
    }
}

/* ── CTA FINAL (dark) ─────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .bg-dark .d-flex, .bg-dark .btn + .btn {
        margin-top: .5rem;
    }
}

/* ── FOOTER ───────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    footer .col-md-3,
    footer .col-md-2 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
@media (max-width: 575.98px) {
    footer .col-md-3,
    footer .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    footer .d-flex.gap-3 { gap: .75rem !important; }
}

/* ── BACK TO TOP + TOAST ──────────────────────────────────────── */
@media (max-width: 575.98px) {
    .back-to-top { bottom: 1rem; right: 1rem; width: 38px; height: 38px; }
    .toast-notification { left: .5rem; right: .5rem; bottom: .75rem; width: auto; }
    .floating-cta { right: 1rem !important; bottom: 1rem !important; }
    .floating-cta a { font-size: .78rem; padding: .55rem 1rem; }
}

/* ── PAGES OFERTY (ofertes per / firmy) ───────────────────────── */
@media (max-width: 575.98px) {
    /* Cards oferty : boutons pleine largeur */
    .d-flex.gap-2.flex-wrap .btn,
    .d-flex.gap-3.flex-wrap .btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: .82rem;
    }
    /* Badges petits */
    .badge.fs-6 { font-size: .75rem !important; }
    .badge.fs-5 { font-size: .7rem !important; }
}

/* ── SYMULATOR ────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    /* Le tableau d'amortissement */
    #scheduleTable { font-size: .75rem; }
    #scheduleTable th, #scheduleTable td { padding: .3rem .4rem; }
    /* La section résultat : flex col */
    .sim-results-grid {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 575.98px) {
    /* Sliders : pleine largeur */
    .sim-slider-row { flex-direction: column !important; }
    /* Résultats valeurs */
    .sim-value { font-size: 1.4rem !important; }
}

/* ── WNIOSEK (formulaire 3 étapes) ───────────────────────────── */
/* Stepper */
@media (max-width: 575.98px) {
    .pfn-step-label { font-size: .58rem; letter-spacing: 0; }
    .pfn-step-dot { width: 34px !important; height: 34px !important; font-size: .85rem !important; }
    .pfn-card-header { padding: .875rem 1rem !important; }
    .pfn-card-body { padding: 1rem !important; }
    /* Grilles internes */
    .row2 { grid-template-columns: 1fr !important; }
    .sum-grid { grid-template-columns: 1fr 1fr !important; }
    .sum-row { grid-template-columns: 1fr !important; }
    .cat-rate-grid { grid-template-columns: 1fr !important; }
    .profile-pick { grid-template-columns: 1fr 1fr; } /* reste 2 colonnes */
}

/* ── FAQ ──────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    .accordion-button { font-size: .88rem; padding: .75rem .9rem; }
    .accordion-body { font-size: .85rem; padding: .75rem .9rem; }
}

/* ── KONTAKT ──────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
    /* Carte infos contact */
    .d-flex.flex-wrap.gap-3.justify-content-center { gap: 1rem !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;
        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;
    }
    .navbar .nav-item.dropdown:hover > .dropdown-toggle { color: var(--primary); }
}
.navbar .dropdown-menu[data-bs-popper] { left: auto !important; right: 0 !important; }
.navbar-nav .dropdown-menu { position: absolute !important; z-index: 1050 !important; }

/* ================================================================
   CORRECTIONS MOBILES CRITIQUES — Android & iOS
   ================================================================ */

/* ── iOS Safari : safe-area pour notch/Dynamic Island ─────────── */
.navbar.sticky-top {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
.floating-cta {
    bottom: max(90px, calc(env(safe-area-inset-bottom) + 70px));
}
@media (max-width: 575.98px) {
    .floating-cta {
        bottom: max(1rem, calc(env(safe-area-inset-bottom) + 0.75rem));
    }
}
footer {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ── Tap highlight suppression (Android/iOS) ───────────────────── */
a, button, .btn, .nav-link, .accordion-button, .card-hover {
    -webkit-tap-highlight-color: transparent;
}

/* ── Touch-action sur éléments scrollables ─────────────────────── */
.table-responsive,
.marquee-container,
.offcanvas-body {
    touch-action: pan-x pan-y;
}

/* ── Font-size minimum sur iOS (évite le zoom auto sur les inputs) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    font-size: max(16px, 1rem) !important;
}

/* ── Correction : navbar brand ne déborde pas sur iOS ────────────── */
@media (max-width: 991.98px) {
    .navbar-brand {
        max-width: calc(100% - 90px); /* laisse place au govlogo + hamburger */
        overflow: hidden;
        flex-shrink: 1;
    }
    .navbar-brand img {
        flex-shrink: 0;
    }
    /* Gov/Godlo logo wrapper — two class names used across pages */
    .gov-logo-wrap,
    .godlo-wrap {
        flex-shrink: 0;
        order: 98;
    }
}
@media (max-width: 575.98px) {
    .navbar-brand {
        max-width: calc(100% - 72px);
    }
}

/* ── Table comparateur : toujours scrollable, jamais débordant ── */
#comparateur .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
#comparateur table {
    min-width: 480px;
}

/* ── Hero carousel : indicator dots accessibles au doigt ─────── */
.carousel-indicators [data-bs-target] {
    min-width: 24px;
    min-height: 10px;
    cursor: pointer;
}

/* ── Boutons : taille minimale cible tactile (WCAG 2.5.5) ──────── */
@media (max-width: 991.98px) {
    .btn {
        min-height: 44px;
    }
    .btn-sm {
        min-height: 36px;
    }
    .nav-tabs .nav-link {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .accordion-button {
        min-height: 48px;
    }
}

/* ── Overflow x : sections de contenu ──────────────────────────── */
/* Note: ne pas mettre overflow sur body/html car cela casse position:fixed */
.hero-slide,
.marquee-container + *,
section > .container {
    max-width: 100%;
}
/* Offcanvas scroll */
.offcanvas {
    overflow-x: hidden !important;
    overflow-y: auto !important;
}
