:root {
    --red: #e61e25;
    --red-dark: #b3161b; /* Ciemniejsza czerwień - lepszy kontrast (WCAG AA) */
    --gold: #ffcc00;
    --white: #ffffff;
    --dark: #1a1a1a;
    --gray: #f4f4f4;
}

html {
    scroll-behavior: smooth;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--gray);
    color: var(--dark);
    font-size: 20px;
    line-height: 1.8;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Readability improvements for main container and subsections */
.container p {
    font-size: 1.25rem; /* ~20-21px */
}
.container h2, .container .section-title {
    font-size: 1.8rem; /* larger section headings */
    margin-bottom: 0.75rem;
}
.container h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.card {
    padding: 36px;
}
.inspiration-box p {
    font-size: 1.25rem;
}
.step-v {
    padding: 36px;
}
.links-grid a {
    font-size: 1.1rem;
    padding: 18px;
}
.contact-form input, .contact-form textarea, .form-group input, .form-group textarea {
    font-size: 1.05rem;
    padding: 16px;
}

/* Larger buttons for better visibility */
.btn-cta {
    padding: 18px 48px;
    font-size: 1.05rem;
}
.btn-share {
    font-size: 1.05rem;
    padding: 14px 28px;
}

/* BANER W BARWACH FLAGI */
.hero {
    /* Tło graficzne z przyciemnieniem (overlay), aby tekst był czytelny i nierażący */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('polska-flaga.png');
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), image-set(url('polska-flaga.webp') type('image/webp'), url('polska-flaga.png') type('image/png'));
    background-size: cover;
    background-position: center;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 5px solid rgba(0,0,0,0.1);
}

.hero-overlay {
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
}

.main-title {
    font-size: clamp(2.5rem, 12vw, 5.5rem);
    font-weight: 900;
    color: #ffffff; /* Zawsze biały na tle zdjęcia */
    line-height: 1.2;
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.sub-title {
    font-size: clamp(1rem, 5vw, 1.8rem);
    color: var(--gray);
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 20px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

/* Dostosowanie kolorów tekstu w dolnej części baneru (na czerwonym tle) */
.hero-divider {
    width: 60px;
    height: 4px;
    background: var(--gold);
    margin: 20px auto;
}

.hero-text {
    font-size: clamp(1.125rem, 4.5vw, 1.4rem);
    color: #ffffff; /* Zawsze biały na tle zdjęcia */
    margin-bottom: 30px;
    line-height: 1.5;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

.btn-cta {
    background: var(--gold);
    color: #1a1a1a; /* Zawsze ciemny tekst na złotym tle */
    padding: 15px 40px;
    text-decoration: none;
    font-weight: 900;
    border-radius: 50px;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.9s forwards;
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-cta.secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

/* KONTENER I KARTY */
.container {
    max-width: 1200px;
    margin: -30px auto 60px;
    padding: 0 24px;
}

.inspiration-box {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    margin-bottom: 30px;
}
/* Ensure readable text color on cards and boxes regardless of page background */
.inspiration-box, .card {
    color: var(--dark);
}

/* Left-aligned variant for inspiration box with adaptive border and spacing */
.inspiration-box.text-left {
    text-align: left;
    border-left: 5px solid var(--red);
    padding-left: 18px;
}

/* WSPARCIE */
.support-section {
    background: var(--white);
    padding: 35px;
    border-radius: 18px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.support-header {
    text-align: center;
    margin-bottom: 25px;
}

.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.support-card {
    border: 2px solid #eee;
    border-radius: 14px;
    padding: 20px;
    background: var(--gray);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.support-card:hover {
    transform: translateY(-4px);
    border-color: var(--red-dark);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.support-badge {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.support-badge.alt {
    background: var(--red-dark);
}

.support-price {
    font-weight: 900;
    font-size: 1.1rem;
    margin: 8px 0 10px;
}

.btn-buycoffee-inline {
    display: inline-block;
    margin-top: 12px;
    background: var(--gold);
    color: #1a1a1a;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-buycoffee-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.18);
}

.support-note {
    text-align: center;
    margin-top: 20px;
    font-weight: 700;
    color: var(--red-dark);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    border-top: 5px solid var(--red);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* SEKcja JAK TO PRZEPROWADZIĆ (MOBILE FIX) */
.step-v {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.step-num {
    background: var(--red-dark);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 15px;
    flex-shrink: 0;
}

/* FORMULARZ */
.contact-section {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    margin: 40px 0;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin: 20px auto 0;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

.btn-submit {
    background: var(--dark);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* WSPARCIE BLIK */
.btn-blik-safe {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 2px solid var(--red);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--dark);
    font-weight: bold;
}

/* UDOSTĘPNIANIE */
.share-section {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-share {
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.btn-fb {
    background-color: #0d57a0; /* Facebook Blue with improved contrast */
}

.btn-tw {
    background-color: #0c80c7; /* Twitter Blue with improved contrast */
}

.btn-copy {
    background-color: #34495e; /* Ciemny szary/granat */
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

/* NIEZBĘDNIK OBYWATELA - LINKI */
.links-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.links-grid a {
    display: block;
    background: var(--white);
    border: 2px solid #eee;
    color: var(--dark);
    padding: 15px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
}

.links-grid a:hover {
    border-color: var(--red-dark);
    color: var(--red-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* RESPONSIVE */
@media (min-width: 768px) {
    .step-v { flex-direction: row; text-align: left; }
    .step-num { margin-bottom: 0; margin-right: 25px; }
    .links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ANIMACJE */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* STOPKA */
.main-footer {
    background: var(--dark);
    color: var(--white);
    padding: 50px 20px;
    text-align: center;
    margin-top: 60px;
}

.support-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
}

.btn-buycoffee {
    display: inline-block;
    transition: transform 0.3s;
}

.btn-buycoffee:hover {
    transform: scale(1.05);
}

.support-message {
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 300px;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .support-actions {
        flex-direction: row;
        justify-content: center;
        text-align: left;
    }
    
    .support-message {
        max-width: 450px;
        margin: 0;
    }
}

/* TRYB CIEMNY (DARK MODE) */
body.dark-mode {
    --white: #252525; /* Ciemne tło kart */
    --gray: #121212;  /* Bardzo ciemne tło strony */
    --dark: #f4f4f4;  /* Jasny tekst */
    --red-dark: #ff6b6b; /* Jaśniejsza czerwień dla kontrastu */
}

/* Poprawka dla przycisku formularza w trybie ciemnym */
body.dark-mode .btn-submit {
    color: var(--white); /* Tekst przycisku musi być ciemny, bo tło (var(--dark)) stało się jasne */
}

/* PRZYCISK ZMIANY MOTYWU */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    color: var(--dark);
    border: 2px solid var(--dark);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* =========================================
   FALLBACK TŁO HERO (gdy brak obrazu)
   ========================================= */
.hero {
    background-color: #c0001a;
}

/* =========================================
   CHECKBOX ZGODY RODO
   ========================================= */
.form-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
    cursor: pointer;
    text-align: left;
    color: var(--dark);
}

.form-consent input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--red);
    cursor: pointer;
}

/* =========================================
   DOSTĘPNOŚĆ - FOCUS VISIBLE
   ========================================= */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

/* =========================================
   KROK 4 - wyrównanie z resztą kroków
   ========================================= */
.step-v:last-child {
    margin-bottom: 0;
}

/* Dark mode - poprawki dla nowych elementów */
body.dark-mode .form-consent {
    color: var(--dark);
}

body.dark-mode .support-card {
    background: #1e1e1e;
    border-color: #333;
}
