/* =========================================
   1. ZMIENNE I RESET
   ========================================= */
:root {
    --primary: #054d7e;       /* Główny niebieski/zielony */
    --primary-light: #056f8a; /* Jaśniejszy dla hover */
    --text-main: #333;
    --bg-body: #f4f6f8;
    --white: #fff;
    --wcag-blue: #3b5998;     /* Kolor ikony dostępności */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 16px;
}

/* =========================================
   2. GLOBALNE ANIMACJE I PRZEJŚCIA
   ========================================= */
a, button, .c-btn, .wcag-toggle, input, .banner, .card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header, .content-box, .banner, .savings-box, .highlight-box {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

/* =========================================
   3. GÓRNY PASEK I HEADER
   ========================================= */
.top-bar { background-color: #222; padding: 10px 0; text-align: center; }
.top-bar img { height: 60px; max-width: 95%; object-fit: contain; transition: filter 0.3s; }
.top-bar img:hover { filter: brightness(1.1); }

header { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }

.header-cont { max-width: 1400px; margin: 0 auto; padding: 10px 20px; display: flex; justify-content: center; align-items: center; position: relative; min-height: 60px; }

.nav { display: flex; list-style: none; align-items: center; gap: 5px; margin: 0; padding: 0; }
.nav a { display: block; padding: 12px 18px; text-decoration: none; color: #333; font-weight: 600; font-size: 1rem; border-radius: 25px; white-space: nowrap; position: relative; overflow: hidden; }
.nav a.active { background-color: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(76, 102, 3, 0.3); }
.nav a:not(.active):hover { background-color: rgba(76, 102, 3, 0.08); transform: translateY(-2px); color: var(--primary); }
.nav a::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 3px; background-color: var(--primary); transition: width 0.3s ease, left 0.3s ease; }
.nav a:not(.active):hover::after { width: 60%; left: 20%; }

.hamburger { display: none; background: none; border: none; font-size: 35px; cursor: pointer; color: #000; padding: 5px; position: absolute; right: 20px; top: 15px; z-index: 1001; }

/* =========================================
   4. GŁÓWNA TREŚĆ I KOMPONENTY
   ========================================= */
main { flex: 1; padding-bottom: 60px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.page-header { background-color: var(--primary); color: #fff; text-align: center; padding: 50px 20px; margin-bottom: 40px; background-image: linear-gradient(135deg, var(--primary) 0%, #0260b8 100%); }
.page-header h2 { margin: 0 0 15px; font-size: 2.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.page-header p { font-size: 1.1rem; max-width: 800px; margin: 0 auto; opacity: 0.9; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.card { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); border: 1px solid #eee; display: flex; flex-direction: column; align-items: flex-start; opacity: 0; animation: fadeInUp 0.6s ease-out forwards; position: relative; top: 0; }
.card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); border-color: var(--primary-light); }
.card-icon { font-size: 2.5rem; margin-bottom: 15px; display: block; transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.card:hover .card-icon { transform: scale(1.2) rotate(5deg); }
.card h3 { font-size: 1.3rem; margin-bottom: 10px; color: #222; }
.card p { color: #555; margin-bottom: 0; flex: 1; text-align: left; }
.content-box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); margin-bottom: 30px; border: 1px solid #f0f0f0; }

.banner { display: block; background: #fff; padding: 25px; border-left: 6px solid var(--primary); margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); text-decoration: none; color: inherit; border-radius: 0 8px 8px 0; }
.banner:hover { transform: scale(1.02); border-left-width: 12px; background-color: #fafafa; box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.banner h4 { margin: 0 0 10px; color: #222; font-size: 1.2rem; font-weight: 700; }
.check-list, ul { list-style-type: disc; padding-left: 20px; }
.check-list li { margin-bottom: 8px; color: #444; }

/* =========================================
   5. WIDGET WCAG
   ========================================= */
.wcag-container { position: fixed; top: 160px; left: 0; z-index: 500; }
.wcag-toggle { width: 50px; height: 50px; background-color: var(--wcag-blue); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 28px; border: none; border-radius: 0 4px 4px 0; box-shadow: 2px 2px 5px rgba(0,0,0,0.2); }
.wcag-toggle:hover { background-color: #2a407a; width: 60px; }
.wcag-panel { display: none; position: absolute; top: 0; left: 50px; width: 260px; background: #fff; border: 1px solid #ccc; box-shadow: 5px 5px 15px rgba(0,0,0,0.2); text-align: left; border-radius: 4px; }
.wcag-panel.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.wcag-header { padding: 15px; font-weight: bold; border-bottom: 1px solid #eee; color: #333; background: #f9f9f9; }
.wcag-option { display: block; width: 100%; text-align: left; padding: 12px 15px; background: #fff; border: none; border-bottom: 1px solid #f5f5f5; cursor: pointer; color: #333; font-size: 14px; }
.wcag-option:hover { background: #f0f0f0; color: var(--wcag-blue); font-weight: bold; }

/* =========================================
   6. SKALOWANIE CZCIONKI I TRYBY WCAG
   ========================================= */
html.fs-inc-1 { font-size: 18px; } html.fs-inc-2 { font-size: 20px; } html.fs-inc-3 { font-size: 22px; }
html.fs-dec-1 { font-size: 14px; } html.fs-dec-2 { font-size: 13px; } html.fs-dec-3 { font-size: 12px; }
body.mode-contrast { filter: contrast(150%); background: #000; color: #fff; }
body.mode-contrast header, body.mode-contrast footer, body.mode-contrast .card, body.mode-contrast .content-box { background: #000; border: 1px solid #ff0; color: #ff0; }
body.mode-contrast a { color: #0ff; text-decoration: underline; }
body.mode-contrast .banner { background: #000; border: 1px solid #ff0; }
body.mode-gray { filter: grayscale(100%); }
body.mode-negative { filter: invert(100%); }
body.mode-light { background: #fff; color: #000; }
body.mode-links a { text-decoration: underline !important; font-weight: bold !important; }
body.mode-readable { font-family: Arial, Helvetica, sans-serif !important; letter-spacing: 0.5px; word-spacing: 2px; }

/* =========================================
   7. STOPKA
   ========================================= */
footer { background: #f9f9f9; border-top: 1px solid #eee; padding: 40px 0; text-align: center; margin-top: auto; }
.footer-cont { max-width: 1200px; margin: 0 auto; padding: 0 20px; color: #666; font-size: 0.9rem; }

/* =========================================
   8. MEDIA QUERIES (RWD)
   ========================================= */
@media (max-width: 1150px) {
    .hamburger { display: block; }
    .header-cont { justify-content: flex-end; }
    .nav { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; width: 100%; background: #fff; padding: 20px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); align-items: center; border-top: 1px solid #eee; }
    .nav.active { display: flex; animation: slideDown 0.3s ease-out; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
    .nav li { width: 100%; margin-bottom: 5px; text-align: center; }
    .nav a { display: block; width: 100%; padding: 15px; }
    .nav a::after { display: none; }
    .nav a:hover { transform: none; background: #f5f5f5; }
}

/* =========================================
   9. POPUP COOKIES & MODAL (NAPRAWIONE)
   ========================================= */

/* --- BANNER DOLNY --- */
.cookie-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 4px solid var(--primary);
    z-index: 9999;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
    padding: 20px;
    display: none; /* JS zmieni na flex */
    flex-direction: column;
}

.cookie-container-center {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (min-width: 768px) {
    .cookie-container-center {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .cookie-content {
        max-width: 60%;
        margin-right: 20px;
    }
    .cookie-buttons {
        display: flex;
        gap: 10px;
        flex-shrink: 0;
    }
}

.cookie-content p { margin: 0 0 15px 0; font-size: 0.95rem; color: #333; line-height: 1.4; }
@media (min-width: 768px) { .cookie-content p { margin: 0; } }

/* Przyciski */
.c-btn { padding: 10px 20px; cursor: pointer; border: none; font-weight: 600; border-radius: 6px; font-size: 0.9rem; transition: 0.2s; margin: 5px 0; }
.c-accept { background: var(--primary); color: #fff; }
.c-accept:hover { background: var(--primary-light); transform: translateY(-2px); }
.c-reject { background: #eaeaea; color: #333; }
.c-reject:hover { background: #dcdcdc; }
.c-settings { background: transparent; border: 2px solid #ccc; color: #555; }
.c-settings:hover { border-color: var(--primary); color: var(--primary); }

/* --- OKNO MODALNE (Poprawione) --- */
.cookie-modal-backdrop {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex; /* WAŻNE: Centrowanie */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.cookie-modal-box {
    background: #fff;
    width: 95%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header { background: #f9f9f9; padding: 15px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.2rem; color: #333; }
.close-modal { background: none; border: none; font-size: 28px; cursor: pointer; color: #666; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; text-align: left; }
.modal-footer { padding: 15px 20px; border-top: 1px solid #eee; background: #f9f9f9; }

/* Suwaki - NAPRAWIONE */
.cookie-option { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.cookie-option:last-child { border-bottom: none; margin-bottom: 0; }
.option-info { max-width: 75%; text-align: left; }
.option-info strong { display: block; margin-bottom: 4px; color: #222; }
.option-info span { font-size: 0.85rem; color: #666; }

/* KLUCZ: label z cursor: pointer */
.option-switch { position: relative; width: 50px; height: 26px; cursor: pointer; display: inline-block; }
.option-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 34px; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; border-radius: 50%; transition: .4s; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }
.slider.disabled { background-color: #a0cfa0; opacity: 0.7; cursor: not-allowed; } 

/* =========================================
   10. QUIZ BUTTONS
   ========================================= */
#quiz-box button:not(#nx) { transition: transform 0.2s, background-color 0.2s, border-color 0.2s; }
#quiz-box button:not(#nx):hover { transform: translateX(10px); border-color: var(--primary); background-color: #f9f9f9; }