:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-glow: rgba(99, 102, 241, 0.15);
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --font-sans: 'Plus Jakarta Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    line-height: 1.6;
    position: relative; /* Globalny punkt odniesienia dla poświat */
}

/* Ambient background glow effects */
.ambient-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
}

.ambient-glow-2 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    top: 600px;
    left: -200px;
    z-index: -1;
    filter: blur(100px);
    pointer-events: none;
}

/* Navbar Layout */
@import url('https://googleapis.com');

/* Navbar Layout */
nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

/* Kontener główny - bezpieczny dla Safari flexbox */
.logo-area {
    display: -webkit-inline-flex; /* Wsparcie dla Safari na starszych iOS */
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    text-decoration: none;

    /* Poprawka dla Safari: zapobiega ucinaniu antyaliasingu czcionek na iOS */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ikona logo - responsywna i bezpieczna na telefony */
.logo-icon {
    width: 34px;
    height: 34px;
    max-width: 100%;
    object-fit: contain;
    -webkit-flex-shrink: 0; /* Poprawka dla Safari: zapobiega zgniataniu ikony na małych ekranach */
    flex-shrink: 0;
}

/* Baza dla całego napisu */
.logo-text {
    font-size: 22px;
    letter-spacing: 1px;
    display: inline-block; /* Niezbędne dla poprawnego działania gradientu na tekście w Safari */
    line-height: 1.2;
}

/* Człon "AdGram" - Poprawiona składnia dla Safari i innych */
.text-brand-1 {
    font-weight: 800;
    background-image: linear-gradient(90deg, rgb(22, 61, 100), rgb(22, 61, 100));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Człon drugiej części - Analogiczna poprawka */
.text-brand-2 {
    font-weight: 600;
    background-image: linear-gradient(90deg, rgb(227, 107, 44), rgb(227, 107, 44));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* --- NOWE STYLE: Przełącznik języków (Dla desktopu) --- */
.lang-switcher {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;

    /* Рівномірний відступ між УСІМА елементами (і посиланнями, і спанами) */
    gap: 10px;

    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Робимо кожен елемент мови окремим флекс-об'єктом із чіткими межами */
.lang-item {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    line-height: 1; /* Вирівнювання по вертикалі всередині флексбокса */
}

a.lang-item:hover {
    color: var(--text-primary);
}

.lang-item.active {
    color: var(--text-primary);
    font-weight: 700;
    pointer-events: none;
}

/* Розділова риска тепер теж флекс-елемент, симетричний до інших */
.lang-divider {
    display: inline-block;
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
    line-height: 1;
}

/* Standardowe linki i przycisk */
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.btn-launch {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.btn-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

/* Hidden checkbox logic */
.menu-toggle {
    display: none;
}

/* Hamburger button styles */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    z-index: 110;
    align-self: center; /* Safari Fix */
}

.hamburger span {
    background-color: white;
    height: 3px;
    width: 25px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* ==========================================================
   RESPONSYWNOŚĆ I OPTYMALIZACJA MOBILNA
   ========================================================== */

/* Dla tabletów i telefonów (Układ menu wypraszanego) */
/* --- НОВИЙ ОПТИМІЗОВАНИЙ СТИЛЬ: ПЕРЕМИКАЧ МОВ --- */
.lang-switcher {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;

    /* Рівномірний відступ між УСІМА елементами (і посиланнями, і спанами) */
    gap: 10px;

    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Робимо кожен елемент мови окремим флекс-об'єктом із чіткими межами */
.lang-item {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    line-height: 1; /* Вирівнювання по вертикалі всередині флексбокса */
}

a.lang-item:hover {
    color: var(--text-primary);
}

.lang-item.active {
    color: var(--text-primary);
    font-weight: 700;
    pointer-events: none;
}

/* Розділова риска тепер теж флекс-елемент, симетричний до інших */
.lang-divider {
    display: inline-block;
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
    line-height: 1;
}

/* ==========================================================
   ОПТИМІЗАЦІЯ ДЛЯ ТЕЛЕФОНІВ (Зміна логіки відступів)
   ========================================================== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #0b0b0f;
        padding: 2rem 0;
        gap: 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    .nav-links a:not(.btn-launch) {
        width: 100%;
        text-align: center;
        padding: 0.5rem 0;
        font-size: 1.1rem;
    }

    /* Мобільний перемикач мов: ідеальне центрування без деформації gap */
    .lang-switcher {
        width: auto; /* Скасовуємо 100% ширину, щоб елементи не роз'їжджалися */
        margin: 0.5rem auto; /* Центруємо сам контейнер по горизонталі всередині меню */
        font-size: 1.1rem; /* Збільшений тач-таргет для пальців */
        gap: 14px; /* Трохи більший, ідеально рівномірний простір для екранів телефонів */
    }

    .btn-launch {
        width: 75%;
        text-align: center;
        padding: 0.8rem 0;
        margin-top: 0.5rem;
    }
}

/* Dla bardzo małych telefonów (poniżej 480px) */
@media (max-width: 480px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .logo-area {
        gap: 8px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-text {
        font-size: 19px;
    }
}

/* Hero Section Component */
header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
}

.badge {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom right, #ffffff 40%, #9ca3af 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 span {
    background: linear-gradient(to right, var(--primary), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-p {
    max-width: 650px;
    margin: 0 auto 3rem auto;
    font-size: 1.15rem;
    color: var(--text-muted);
}

/* Feature Section & Responsive Grid */
.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 4rem auto;
    font-size: 1.05rem;
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.grid-3 {
    display: grid;
    /* Poprawione z 300px na 280px pod kątem małych telefonów */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    padding: 2.5rem;
    border-radius: 20px;
    -webkit-backdrop-filter: blur(12px); /* Safari Fix */
    backdrop-filter: blur(12px);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-4px);
}

.card-icon-wrapper {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.card-icon-wrapper.accent {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Matrix Pricing Section Components */
.pricing-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.matrix-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 24px;
    overflow-x: auto; /* Zapobiega rozpychaniu ekranu przez tabele */
    -webkit-overflow-scrolling: touch; /* Płynne przewijanie tabel na iOS */
    -webkit-backdrop-filter: blur(12px); /* Safari Fix */
    backdrop-filter: blur(12px);
    margin-top: 2rem;
}

.matrix-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem 2rem;
}


/* --- ZBIORCZE MEDIA QUERIES DLA URZĄDZEŃ MOBILNYCH (Poniżej 768px) --- */
@media (max-width: 768px) {
    /* Blokowanie uciekania elementów na boki i optymalizacja poświat */
    body, html {
        overflow-x: hidden;
    }

    .ambient-glow {
        width: 100vw;
        height: 100vw;
        top: -5%;
        right: -20%;
        filter: blur(50px);
        opacity: 0.6;
    }

    .ambient-glow-2 {
        width: 90vw;
        height: 90vw;
        top: 35%;
        left: -30%;
        filter: blur(60px);
        opacity: 0.5;
    }

    /* Nawigacja Mobilna */
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #0b0f19; /* Dopasowane dokładnie do var(--bg-main) */
        padding: 2rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        gap: 1.5rem;
        box-sizing: border-box;
        text-align: center;
        z-index: 9;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }

    .menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    /* Animacja X w menu */
    .menu-toggle:checked ~ .hamburger span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .menu-toggle:checked ~ .hamburger span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle:checked ~ .hamburger span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    .btn-launch {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    /* Optymalizacja Sekcji Hero */
    header {
        padding: 3rem 1.5rem;
    }

    h1 {
        font-size: 2.5rem; /* Zmniejszenie zbyt dużego fontu na telefon */
    }

    .hero-p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    /* Sekcje i Karty */
    .features-container, .pricing-section {
        padding: 2rem 1rem;
    }

    .section-title {
        font-size: 1.75rem;
        margin-top: 2rem;
    }

    .card {
        padding: 1.75rem; /* Mniejszy wewnętrzny odstęp na małym ekranie */
    }
}

/* Matrix Pricing Section Components */
.pricing-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.matrix-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 24px;
    overflow: hidden;
    -webkit-backdrop-filter: blur(12px); /* Safari Fix */
    backdrop-filter: blur(12px);
    margin-top: 2rem;
}

.matrix-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

.matrix-grid {
    display: flex;
    flex-direction: column;
}

.matrix-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.matrix-row:last-child {
    border-bottom: none;
}

.time-slot {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tariff-packages-wrapper {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tariff-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tariff-tag span {
    color: var(--accent);
    font-weight: 700;
}

.tariff-tag.prime {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.tariff-tag.prime span {
    color: #818cf8;
}

/* How It Works Section */
.steps-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.grid-2 {
    display: grid;
    /* POPRAWKA: Zmiana z 450px na 280px, aby siatka nie psuła się na mniejszych telefonach */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
}

.steps-box {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 3rem;
}

.steps-box h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-item {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.step-item:last-child {
    margin-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0; /* Safari Fix: blokuje spłaszczanie koła z numerem */
}

.step-text h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.step-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* FAQ Section Layout */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer and Disclaimer layout styles */
footer {
    background: #070a12;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4rem 2rem 2rem 2rem;
    margin-top: 6rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.legal-disclaimer {
    max-width: 1200px;
    margin: 2rem auto 0 auto;
    color: #4b5563;
    font-size: 0.78rem;
    text-align: justify;
    line-height: 1.5;
}

/* --- DOPASOWANIE DLA TELEFONÓW (Media Queries) --- */
@media (max-width: 768px) {
    .pricing-section, .steps-section, .faq-section, footer {
        padding: 3rem 1.25rem; /* Mniejsze, bezpieczne marginesy boczne */
    }

    .matrix-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .matrix-row {
        grid-template-columns: 1fr; /* Jedna kolumna na telefonie */
        gap: 1.25rem;
        padding: 1.5rem 1.25rem;
    }

    .tariff-packages-wrapper {
        gap: 0.5rem; /* Zmniejszony rozstaw tagów cenowych */
    }

    .tariff-tag {
        width: 100%; /* Tagi rozciągają się na pełną szerokość dla lepszej czytelności */
        justify-content: space-between;
    }

    .steps-box {
        padding: 1.75rem; /* Zmniejszenie wewnętrznego paddingu pudełka z krokami */
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .footer-copyright {
        color: var(--text-muted);
        font-size: 0.9rem;
        margin-top: 0.5rem; /* Opcjonalny odstęp od logo */
    }

    .legal-disclaimer {
        text-align: left; /* Justowanie tekstu (justify) na małych ekranach iOS wygląda nienaturalnie */
    }
}