:root {
    /* Radosna paleta barw */
    --primary-color: #0073e6;    
    --primary-dark: #005bb5;     
    --accent-color: #ff9f1c;     
    --bg-color: #f7f9fb;         
    --text-color: #2c3e50;
    --white: #ffffff;
    --border-radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Bazowy rozmiar czcionki na poziomie dokumentu do obsługi skalowania (A+ / A-) */
html { font-size: 100%; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- WIERSZ 1: Top Bar --- */
.top-bar {
    background-color: var(--primary-color);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    color: var(--white);
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo { display: flex; align-items: center; }
.logo img { height: 45px; display: block; }

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-form { display: flex; gap: 5px; }
.search-form input { 
    padding: 8px 12px; 
    border: none; 
    border-radius: 4px; 
    outline: none; 
}
.search-form button { 
    padding: 8px 15px; 
    background: var(--accent-color); 
    color: var(--white); 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-weight: bold;
    transition: background-color 0.3s; 
}
.search-form button:hover { background: #e68a00; }

.action-link { 
    color: var(--white); 
    text-decoration: none; 
    font-weight: 600; 
    letter-spacing: 0.5px;
}
.action-link:hover { color: var(--accent-color); }

/* --- WIERSZ 2: Ticker --- */
.ticker-wrapper {
    background: var(--primary-dark);
    color: var(--white);
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 60px;
    font-size: 1rem;
}

.ticker-label {
    background: #00478f;
    padding: 0 25px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    letter-spacing: 1px;
    z-index: 10;
    white-space: nowrap;
}

.ticker-container {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    padding-left: 100%;
    animation: tickerAnim 35s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }
.ticker-track span { padding-right: 60px; }

@keyframes tickerAnim {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --- WIERSZ 3: Kafelki (Jednostki rem dla skalowania) --- */
.main-content { padding: 60px 20px; }
.section-title { 
    text-align: center; 
    margin-bottom: 50px; 
    color: var(--primary-dark); 
    font-size: 2.25rem; 
    font-weight: 700;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1px));
    gap: 35px;
}

.app-tile {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 35px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border-top: 5px solid var(--accent-color); 
}

.app-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

.tile-icon { font-size: 2.8rem; margin-bottom: 20px; }
.app-tile h3 { margin-bottom: 15px; font-size: 1.5rem; color: var(--primary-color); }
.app-tile p { flex-grow: 1; color: #555; margin-bottom: 25px; line-height: 1.6; font-size: 1rem; }

.btn-more {
    font-weight: 700;
    color: var(--accent-color);
    margin-top: auto;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* --- Formularz kontaktowy --- */
.content-box {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.contact-form { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    width: 100%; 
}

.form-group { display: flex; flex-direction: column; }
.form-group label { 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.form-group input, 
.form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ccd1d9; 
    border-radius: var(--border-radius); 
    font-family: inherit; 
    font-size: 1rem;
    background-color: var(--white);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 230, 0.2);
}

.form-group textarea { resize: vertical; }

.form-actions { margin-top: 10px; }
.btn-submit { 
    background-color: var(--accent-color); 
    color: var(--white); 
    padding: 14px 20px; 
    border: none; 
    border-radius: var(--border-radius); 
    cursor: pointer; 
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.3s;
}
.btn-submit:hover { background-color: #e68a00; }

/* --- OKNO MODALNE (Szczegóły systemu) --- */
.modal {
    display: none; 
    position: fixed;
    z-index: 200; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(4px); 
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto; 
    padding: 40px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: modalFadeIn 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-btn {
    color: #999;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}
.close-btn:hover { color: var(--accent-color); }

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.modal-icon { font-size: 2.8rem; }
.modal-header h2 { color: var(--primary-dark); font-size: 2rem; }
.modal-text { line-height: 1.7; color: #444; font-size: 1rem; }

.submodules-title { margin-top: 35px; margin-bottom: 15px; color: var(--primary-color); font-size: 1.25rem;}
.submodules-list { list-style: none; padding-left: 0; }
.submodules-list li {
    background: var(--bg-color);
    padding: 15px 20px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    font-size: 0.95rem;
}
.submodules-list li strong {
    color: var(--primary-dark);
    display: inline-block;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

/* --- NARZĘDZIA DOSTĘPNOŚCI (WCAG) --- */
.accessibility-tools {
    display: flex;
    gap: 8px;
    align-items: center;
}

.accessibility-tools button {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.accessibility-tools button:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* --- TRYB WYSOKIEGO KONTRASTU --- */
body.high-contrast {
    --primary-color: #000000;
    --primary-dark: #000000;
    --accent-color: #ffff00;
    --bg-color: #000000;
    --text-color: #ffff00;
    --white: #000000;
}

body.high-contrast .app-tile, 
body.high-contrast .content-box,
body.high-contrast .modal-content,
body.high-contrast .submodules-list li {
    border: 2px solid #ffff00;
    box-shadow: none;
}

body.high-contrast .top-bar { border-bottom: 2px solid #ffff00; }

body.high-contrast .btn-submit,
body.high-contrast .search-form button,
body.high-contrast .form-group input,
body.high-contrast .form-group textarea {
    background-color: #000000;
    color: #ffff00;
    border: 2px solid #ffff00;
}

body.high-contrast .btn-submit:hover,
body.high-contrast .search-form button:hover,
body.high-contrast .accessibility-tools button:hover {
    background-color: #ffff00;
    color: #000000;
}

body.high-contrast a,
body.high-contrast .btn-more,
body.high-contrast .action-link,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast p,
body.high-contrast .modal-text,
body.high-contrast label,
body.high-contrast .submodules-list li strong {
    color: #ffff00;
}

/* Poprawka kontrastu dla aktualności */
body.high-contrast .ticker-wrapper {
    background-color: #000000;
    border-bottom: 2px solid #ffff00;
    color: #ffff00;
}
body.high-contrast .ticker-label {
    background-color: #000000;
    color: #ffff00;
    border-right: 2px solid #ffff00;
}
body.high-contrast .ticker-track span { color: #ffff00; }

/* Responsywność */
@media (max-width: 768px) {
    .top-actions { width: 100%; justify-content: space-between; margin-top: 15px; }
    .search-form { flex-grow: 1; }
    .search-form input { width: 100%; }
    .ticker-wrapper { height: auto; flex-direction: column; }
    .ticker-label { width: 100%; justify-content: center; padding: 10px 0; border-right: none; }
}