:root {
    /* Pogłębione, wysoko kontrastowe kolory przewodnie (zgodne z WCAG AA/AAA) */
    --app-orange: #f08227; /* Mocny, wyrazisty odcień pomarańczy – doskonała czytelność z białym tekstem */
    --app-blue: #2b89dd;   /* Głęboki, wyraźny błękit królewski zamiast jasnego błękitu */
    
    /* Zdecydowane przyciemnienie krojów i tła dla gorszych matryc */
    --text-dark: #111111;  /* Głęboka czerń dla maksymalnego kontrastu tekstu głównego */
    --text-muted: #41464b; /* Ciemny szary zamiast jasnego – teksty pomocnicze przestają znikać */
    --bg-light: #e9ecef;   /* Wyraźniej odcinające się szare tło (widoczna separacja sekcji) */
    
    --main-theme-color: var(--app-orange);
}

body.theme-blue {
    --main-theme-color: var(--app-blue);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: #ffffff;
    overflow-x: hidden;
    transition: background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==== WYMUSZENIE WYSOKIEGO KONTRASTU DLA KLAS BOOTSTRAPA ==== */
.text-muted {
    color: var(--text-muted) !important;
}
.text-secondary {
    color: #212529 !important; /* Bardzo ciemny grafit */
}

/* ==== ANIMACJE (KLASY POMOCNICZE) ==== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

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

/* Pasek nawigacji */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.98) !important; /* Bardziej kryjące tło */
    border-bottom: 2px solid rgba(0, 0, 0, 0.1); /* Wyraźna fizyczna linia odcinająca menu */
    transition: all 0.3s ease;
    animation: fadeInDown 0.8s ease-out;
    z-index: 1050;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

.navbar-brand {
    white-space: normal;
    font-size: 1.2rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

@media (min-width: 576px) {
    .navbar-brand {
        font-size: 1.4rem;
    }
}

.nav-link {
    font-weight: 600; /* Grubsza czcionka linków */
    color: var(--text-dark) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--main-theme-color) !important;
}

/* Przełącznik - Kwadraciki */
.theme-squares-container {
    background: #ffffff;
    padding: 10px 24px;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

body.theme-blue .theme-squares-container {
    box-shadow: 0 8px 24px rgba(0, 78, 152, 0.25);
}

.color-square {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid rgba(0, 0, 0, 0.2); /* Widoczna ramka nieaktywnego kwadratu */
}

.square-orange { background-color: var(--app-orange); }
.square-blue { background-color: var(--app-blue); }

.color-square:hover {
    transform: scale(1.1);
}

.color-square.active {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px white, 0 0 0 5px #1a1a1a;
}

body:not(.theme-blue) .square-orange.active {
    box-shadow: 0 0 0 3px white, 0 0 0 5px var(--app-orange);
}

body.theme-blue .square-blue.active {
    box-shadow: 0 0 0 3px white, 0 0 0 5px var(--app-blue);
}

.switch-label {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 140px;
    text-align: left;
    transition: color 0.4s ease;
}

.text-senior { color: var(--app-orange); }
.text-volunteer { color: var(--app-blue); }

/* Sekcja Hero */
.hero-section {
    background-color: var(--main-theme-color);
    color: white;
    padding: 90px 0;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-section h1 {
    line-height: 1.2;
    letter-spacing: -0.5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2); /* Zwiększenie czytelności nagłówka na słońcu */
}

.btn-custom-light {
    background-color: white;
    color: var(--main-theme-color);
    font-weight: 700; /* Zwiększona waga tekstu */
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 12px; /* Klasyczne, bezpieczniejsze zaokrąglenie */
    padding: 14px 32px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-custom-light:hover {
    background-color: #f1f3f5;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    color: var(--main-theme-color);
}

.app-screenshot {
    filter: drop-shadow(0px 15px 30px rgba(0, 0, 0, 0.25));
    animation: float 6s ease-in-out infinite;
}

/* Sekcja Funkcji */
.features-container {
    background-color: var(--main-theme-color);
    padding: 50px 30px;
    border-radius: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: background-color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid rgba(0, 0, 0, 0.12); /* Pogrubiona, widoczna ramka kafelków */
    height: calc(100% - 24px);
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.18);
    border-color: rgba(0, 0, 0, 0.2);
}

.app-card-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    transition: all 0.4s ease;
    margin: 0 auto;
}

/* Dostosowanie kontrastu tła ikonek – bez pastelowych "plam" */
.icon-orange { 
    background-color: #ffe8cc; 
    color: var(--app-orange); 
    border: 1px solid rgba(200, 75, 0, 0.25);
}
body.theme-blue .icon-orange { 
    background-color: #e6f0ff; 
    color: var(--app-blue); 
    border: 1px solid rgba(0, 78, 152, 0.25);
}
.icon-blue { 
    background-color: #e6f0ff; 
    color: var(--app-blue); 
    border: 1px solid rgba(0, 78, 152, 0.25);
}

.app-card-content h4 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.app-card-content p {
    font-size: 1.05rem; /* Delikatnie powiększony tekst opisu */
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Kaskadowe pojawianie się kafelków */
.features-senior .col-md-6, .features-volunteer .col-md-6 {
    opacity: 0;
    animation: cardFadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.features-senior .col-md-6:nth-child(1), .features-volunteer .col-md-6:nth-child(1) { animation-delay: 0.1s; }
.features-senior .col-md-6:nth-child(2), .features-volunteer .col-md-6:nth-child(2) { animation-delay: 0.2s; }
.features-senior .col-md-6:nth-child(3) { animation-delay: 0.3s; }
.features-senior .col-md-6:nth-child(4) { animation-delay: 0.4s; }
.features-senior .col-md-6:nth-child(5) { animation-delay: 0.5s; }
.features-senior .col-md-6:nth-child(6) { animation-delay: 0.6s; }

/* Sekcja O nas */
.about-section {
    background-color: var(--bg-light);
    padding: 90px 0;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
    margin-top: 80px;
}

/* Stopka */
footer {
    background-color: #0b0c10;
    color: #ffffff;
    padding: 60px 0 30px;
    border-top: 4px solid var(--main-theme-color); /* Jaskrawy akcent odcinający dół strony */
}

footer h5 {
    color: #ffffff !important;
    font-weight: 700;
}

footer .footer-text, footer p, footer li {
    color: #cbd5e1 !important; /* Jaśniejszy szary dla lepszego czytania na czarnym tle */
}

footer a {
    color: #ffffff !important;
    text-decoration: underline; /* Podkreślenie linków – czytelne dla starszych osób */
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--main-theme-color) !important;
}

.logo-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    /* Usunięto ramkę logo */
}

/* Przełącznik ról (Switch) */
.role-switch {
    background-color: rgba(0, 0, 0, 0.2); /* Ciemniejsze, wyraźniejsze tło przełącznika */
    padding: 6px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.6); /* Mocniejsza biała linia */
    backdrop-filter: blur(5px);
}

.role-btn {
    background: transparent;
    border: none;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 12px 28px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.role-btn:hover {
    opacity: 1;
}

.role-btn.active {
    background-color: #ffffff;
    color: var(--main-theme-color);
    opacity: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
}

/* ==== SEKCJA KONTAKTOWA (ZOPTYMALIZOWANE UI/UX) ==== */
#kontakt {
    background-color: #fbfbfb;
}

.contact-form-wrapper {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03) !important;
}

/* Nowoczesne i czytelne pola tekstowe */
.senior-input {
    font-size: 1.1rem !important;
    padding: 14px 18px !important;
    border: 2px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: var(--text-dark) !important;
    border-radius: 12px !important;
    transition: all 0.25s ease-in-out !important;
}

.senior-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.senior-input:focus {
    background-color: #ffffff !important;
    border-color: var(--main-theme-color) !important;
    box-shadow: 0 0 0 4px rgba(200, 75, 0, 0.15) !important;
    outline: none !important;
}

body.theme-blue .senior-input:focus {
    box-shadow: 0 0 0 4px rgba(0, 78, 152, 0.15) !important;
}

/* Przycisk wysyłania o wysokim kontraście i nowoczesnym wyglądzie */
.btn-theme-submit {
    background-color: var(--main-theme-color) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    letter-spacing: 0.3px;
    transition: all 0.25s ease !important;
    box-shadow: 0 8px 20px rgba(200, 75, 0, 0.2) !important;
}

body.theme-blue .btn-theme-submit {
    box-shadow: 0 8px 20px rgba(0, 78, 152, 0.2) !important;
}

.btn-theme-submit:hover, 
.btn-theme-submit:focus {
    background-color: var(--main-theme-color) !important;
    filter: brightness(0.88);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(200, 75, 0, 0.3) !important;
}

body.theme-blue .btn-theme-submit:hover,
body.theme-blue .btn-theme-submit:focus {
    box-shadow: 0 10px 25px rgba(0, 78, 152, 0.3) !important;
}

/* ==========================================
   SYSTEM UŁATWIEŃ DOSTĘPNOŚCI (WCAG)
   ========================================== */

/* --- TRYB 1: POWIĘKSZONY TEKST --- */
body.accessibility-large-text {
    font-size: 1.25rem;
}
body.accessibility-large-text p, 
body.accessibility-large-text span, 
body.accessibility-large-text li, 
body.accessibility-large-text .nav-link,
body.accessibility-large-text .switch-label {
    font-size: 1.25rem !important;
}
body.accessibility-large-text h1 { font-size: 3.2rem !important; }
body.accessibility-large-text h2 { font-size: 2.6rem !important; }
body.accessibility-large-text h3 { font-size: 2.1rem !important; }
body.accessibility-large-text h4, 
body.accessibility-large-text .app-card-content h4 { font-size: 1.6rem !important; }
body.accessibility-large-text .senior-input { font-size: 1.3rem !important; }
body.accessibility-large-text .btn-theme-submit span { font-size: 1.3rem !important; }

body.accessibility-large-text #btn-contrast,
body.accessibility-large-text #btn-text-size {
    font-size: 1.05rem !important;
    padding: 10px 18px !important;
}

/* --- TRYB 2: WYSOKI KONTRAST (CZARNO-ŻÓŁTO-BIAŁY) --- */
body.accessibility-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.accessibility-contrast #kontakt {
    background-color: #000000 !important;
}


body.accessibility-contrast .navbar,
body.accessibility-contrast .contact-form-wrapper,
body.accessibility-contrast .app-card,
body.accessibility-contrast .theme-squares-container,
body.accessibility-contrast .about-section,
body.accessibility-contrast .hero-section,
body.accessibility-contrast .features-container,
body.accessibility-contrast .role-switch {
    background-color: #000000 !important;
    background: #000000 !important;
    color: #ffffff !important;
    border: 3px solid #ffff00 !important;
    box-shadow: none !important;
}

body.accessibility-contrast h1,
body.accessibility-contrast h2,
body.accessibility-contrast h3,
body.accessibility-contrast h4,
body.accessibility-contrast .nav-link,
body.accessibility-contrast .app-card-content h4,
body.accessibility-contrast .switch-label,
body.accessibility-contrast .navbar-brand {
    color: #ffff00 !important;
}

body.accessibility-contrast p,
body.accessibility-contrast span,
body.accessibility-contrast li,
body.accessibility-contrast i,
body.accessibility-contrast label,
body.accessibility-contrast .text-muted,
body.accessibility-contrast .text-secondary,
body.accessibility-contrast .text-dark,
body.accessibility-contrast .text-danger {
    color: #ffffff !important;
}

body.accessibility-contrast .senior-input::placeholder {
    color: #dddddd !important;
}

body.accessibility-contrast .senior-input {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 3px solid #ffff00 !important;
}
body.accessibility-contrast .senior-input:focus {
    background-color: #111111 !important;
    border-color: #ffffff !important;
}

body.accessibility-contrast .btn-theme-submit,
body.accessibility-contrast .btn-custom-light,
body.accessibility-contrast .role-btn.active {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 3px solid #ffffff !important;
}
body.accessibility-contrast .btn-theme-submit *,
body.accessibility-contrast .btn-custom-light *,
body.accessibility-contrast .role-btn.active * {
    color: #000000 !important;
}

body.accessibility-contrast .icon-orange,
body.accessibility-contrast .icon-blue {
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

body.accessibility-contrast #btn-contrast {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

body.accessibility-contrast #btn-text-size {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

body.accessibility-contrast .navbar .btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

body.accessibility-large-text div[style*="margin-top: 80px;"] {
    margin-top: 100px !important; 
}
@media (max-width: 991.98px) {
    body.accessibility-large-text div[style*="margin-top: 80px;"] {
        margin-top: 120px !important;
    }
}
