/* =========================================
   1. FUNDAMENTY (Globalne)
   ========================================= */
:root {
    --primary: #0e0f61;       /* Granat */
    --accent: #8e1837;        /* Bordo */
    --bg-light: #f4f7fb;      /* Tło */
    --text-main: #333;
    --white: #fff;
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Raleway', sans-serif; color: var(--text-main); line-height: 1.6; background-color: var(--white); overflow-x: hidden; position: relative; }

h1, h2, h3, h4 { font-family: 'Inter', sans-serif; color: var(--primary); font-weight: 700; line-height: 1.2; margin-bottom: 15px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; }
section { padding: 80px 0; position: relative; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =========================================
   2. HEADER & NAWIGACJA
   ========================================= */
.site-header { background: rgba(255,255,255,0.98); box-shadow: 0 4px 20px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; padding: 15px 0; }
.nav-row { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 1.3rem; font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }

.main-menu { display: flex; gap: 25px; align-items: center; list-style: none; }
.main-menu a { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; color: var(--primary); }
.main-menu a:hover { color: var(--accent); }
.cta-btn { background: var(--accent); color: white !important; padding: 10px 22px; border-radius: 50px; }
.cta-btn:hover { background: var(--primary); transform: translateY(-2px); }
.mobile-toggle { display: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; }

/* =========================================
   3. UI ELEMENTS (Przyciski, Gridy Ogólne)
   ========================================= */
.btn { display: inline-block; padding: 12px 30px; border-radius: 50px; font-weight: 700; cursor: pointer; border: 2px solid transparent; }
.btn-primary { background: var(--accent); color: white; }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn:hover { transform: translateY(-3px); }
.btn-white { background: white; color: var(--primary); padding: 15px 35px; border-radius: 50px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; display: inline-block; }
.btn-white:hover { background: var(--accent); color: white; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

/* Podstawowe gridy - używane ostrożnie */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }

/* Karta domyślna (bezpieczna) */
.card { background: white; padding: 35px; border-radius: var(--radius); border: 1px solid #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.03); transition: 0.3s; }
.card:hover { transform: translateY(-5px); border-color: var(--accent); }
/* Ważne: Reset ikon w kartach, żeby nie psuły się na głównej */
.card i { font-size: 2rem; color: var(--primary); margin-bottom: 20px; display: block; }

/* =========================================
   4. STRONA GŁÓWNA (Index Specific)
   ========================================= */
.hero { background: linear-gradient(135deg, #f0f4ff 0%, #eef1f5 100%); padding: 100px 0; display: flex; align-items: center; }
.hero-centered { text-align: center; padding: 100px 0 60px; background: #f0f4ff; }

/* Sekcja Dlaczego Warto - Specyficzna */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }
.why-card { background: white; padding: 40px 30px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.04); transition: 0.3s; border-top: 4px solid transparent; }
.why-card:hover { transform: translateY(-5px); border-top-color: var(--accent); }
.why-card .check-icon { color: #d4a017; font-size: 1.5rem; margin-bottom: 15px; display: block; } /* Naprawa ikonek */

/* Statystyki - Specyficzne */
.stats-section { background: var(--primary); color: white; padding: 60px 0; border-radius: 20px; margin: 40px 0; box-shadow: 0 20px 40px rgba(14,15,97,0.2); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; text-align: center; }
.stat-item i.stat-icon { font-size: 2.5rem; color: var(--accent); margin-bottom: 15px; opacity: 0.8; display: block; } /* Naprawa ikonek */
.stat-number-box { display: flex; justify-content: center; align-items: baseline; gap: 5px; font-size: 3rem; font-weight: 800; font-family: 'Inter', sans-serif; line-height: 1; margin-bottom: 10px; }
.stat-label { font-size: 0.9rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; display: block; }

/* Partnerzy */
.partners-section { background: #fff; padding: 50px 0; border-bottom: 1px solid #eee; }
.partners-label { text-align: center; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; color: #888; margin-bottom: 30px; font-weight: 700; display: block; width: 100%; }
.partners-grid { display: flex; justify-content: center; gap: 50px; flex-wrap: wrap; align-items: center; }
.partner-logo { height: 40px; width: auto; filter: grayscale(100%); opacity: 0.6; transition: 0.4s ease; }
.partner-logo:hover { filter: grayscale(0%); opacity: 1; transform: scale(1.05); }

/* Maszyna do pisania */
.typing-cursor { display: inline-block; width: 2px; background-color: var(--accent); animation: blink 1s step-end infinite; margin-left: 5px; vertical-align: middle; height: 1em; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================
   5. MODUŁ KREDYTOWY (Kalkulatory 2x2)
   ========================================= */
/* Izolujemy style tylko do klas zaczynających się od .calc- */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
.calc-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    /* Resetujemy wpływ ogólnych stylów */
    box-shadow: none; 
}
.calc-card:hover {
    transform: translateY(-3px);
    border-color: #ccc;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.calc-card.active {
    border-color: var(--accent);
    background: #fffafa; 
    box-shadow: 0 5px 15px rgba(142, 24, 55, 0.15);
}
/* Trójkącik wskazujący */
.calc-card.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0; 
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--accent); 
}
.calc-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    transition: 0.3s;
    display: block; /* Ważne */
    margin-left: auto; margin-right: auto;
}
.calc-card.active .calc-icon {
    color: var(--accent);
    transform: scale(1.1);
}
.calc-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.calc-desc { font-size: 0.85rem; color: #777; }

/* Kontenery Widgetów */
.calc-container {
    display: none; /* Domyślnie ukryte */
    background: white;
    border-radius: 15px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 20px;
    margin-top: -20px;
    opacity: 0; /* Dla animacji */
}
/* Klasa, którą dodaje JS - MUSI nadpisywać display: none */
.calc-container.active {
    display: block !important;
    animation: slideDown 0.5s forwards; /* Forwards zatrzymuje stan końcowy */
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   6. WSPÓLNE KOMPONENTY (Timeline, CTA, Footer)
   ========================================= */
/* Timeline */
.timeline { position: relative; max-width: 900px; margin: 0 auto; padding: 20px 0; }
.timeline::after { content: ''; position: absolute; width: 4px; background: #eee; top: 0; bottom: 0; left: 50%; margin-left: -2px; }
.timeline-item { padding: 20px 40px; position: relative; background: inherit; width: 50%; box-sizing: border-box; }
.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; text-align: left; }
.timeline-item::after { content: ''; position: absolute; width: 20px; height: 20px; right: -10px; background: white; border: 4px solid var(--accent); top: 25px; border-radius: 50%; z-index: 1; }
.timeline-item.right::after { left: -10px; }
.timeline-content { padding: 25px; background: white; border-radius: 15px; border: 1px solid #eee; box-shadow: 0 5px 15px rgba(0,0,0,0.03); transition: 0.3s; }
.timeline-item:hover .timeline-content { transform: scale(1.02); border-color: var(--accent); }
.step-num { font-size: 0.8rem; font-weight: 800; color: var(--accent); text-transform: uppercase; margin-bottom: 5px; display: block; }

/* CTA */
.cta-section { background: linear-gradient(135deg, var(--primary) 0%, #1a1c85 100%); color: white; text-align: center; padding: 80px 0; }
.cta-section h2 { color: white; font-size: 2.2rem; margin-bottom: 20px; }
.cta-section p { color: rgba(255,255,255,0.9); max-width: 700px; margin: 0 auto 30px; font-size: 1.1rem; line-height: 1.8; }

/* Animacje Scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.5s ease-out; will-change: opacity, transform; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Guzik Scroll Top */
#scrollToTop {
    display: none; position: fixed; bottom: 20px; right: 20px; z-index: 999;
    border: none; outline: none; background-color: var(--accent); color: white; cursor: pointer;
    width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: background-color 0.3s, transform 0.3s;
    align-items: center; justify-content: center;
}
#scrollToTop:hover { background-color: var(--primary); transform: translateY(-3px); }

/* Inne */
.expert-box { text-align: center; background: white; padding: 40px; border-radius: 15px; border: 1px solid #eee; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.expert-img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; margin: 0 auto 20px; border: 4px solid var(--bg-light); }
.phone-link { font-size: 1.4rem; font-weight: 800; color: var(--primary); display: block; margin: 10px 0; }
.form-wrapper { background: white; padding: 30px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

/* Toggle */
.toggle-wrap { width: 320px; background: #e0e0e0; border-radius: 50px; padding: 5px; margin: 0 auto 40px; position: relative; display: flex; }
.toggle-bg { position: absolute; width: 50%; height: calc(100% - 10px); background: var(--primary); border-radius: 50px; transition: 0.3s; left: 5px; }
.toggle-wrap.right .toggle-bg { left: 50%; }
.toggle-opt { flex: 1; text-align: center; z-index: 2; cursor: pointer; font-weight: 700; color: #777; padding: 10px 0; transition: 0.3s; background: none; border: none; }
.toggle-opt.active { color: white; }

/* Footer */
.site-footer { background: var(--primary); color: white; padding: 60px 0 20px; }
.footer-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }
.footer-cols h4 { color: white; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 5px; }
.footer-links li { margin-bottom: 8px; list-style: none; }
.footer-links a { color: #ccc; }
.footer-links a:hover { color: var(--accent); padding-left: 5px; }
.copyright { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8rem; color: #888; }

/* =========================================
   7. MOBILE (Responsywność)
   ========================================= */
@media (max-width: 900px) {
    .grid-3, .grid-2, .footer-cols, .stats-grid, .why-grid, .calc-grid { grid-template-columns: 1fr; }
    .main-menu { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background: white; padding: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
    .main-menu.active { display: flex; }
    .mobile-toggle { display: block; }
    .hero { text-align: center; }
    .hero-centered h1 { font-size: 2rem; }
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; text-align: left; }
    .timeline-item.right { left: 0; }
    .timeline-item::after { left: 21px; }
}