:root {
    --bg-color: #FAF9F6; /* Delikatny beż */
    --card-bg: #FFFFFF;
    --text-main: #2C2C2C;
    --text-sub: #666666;
    --accent-green: #2D5A27; /* Ciemna zieleń */
    --pillar-burgundy: #8B0000; /* Bordowy Pillar */
    --border-color: #E5E5E0;
    --input-focus: #D4D4C8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Barlow', sans-serif;
    background-color: #084b01; /* Głęboka zieleń */
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' stroke-opacity='0.2'%3E%3Cpath d='M5 55 L5 40 L12.5 32.5 L20 40 L20 55 M27.5 55 L27.5 20 L42.5 20 L42.5 55 M47.5 55 L47.5 45 L52.5 40 L57.5 45 L57.5 55'/%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column; /* Układ pionowy */
    align-items: center; /* Centrowanie w poziomie */
    min-height: 100vh;
    min-height: 100dvh; /* Instagram/FB in-app browser - dynamic viewport (uwzględnia toolbar) */
    padding: 40px 20px; /* Większy margines dla oddechu */
}

.container {
    width: 100%;
    max-width: 550px;
    padding: 40px 30px;
    background-color: #FFFFFF; /* Biały blok */
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

/* HEADER & PROGRESS */
header {
    margin-bottom: 30px;
    text-align: center;
}

.logo {
    font-size: 50px; /* Zwiększone z 42px (+20%) */
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: -1px;
    color: var(--text-main);
    display: inline-block;
}

.header-text {
    font-size: 28px; /* Zwiększone z 20px */
    font-weight: 700;
    color: #084b01;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin-top: 15px; /* Zmniejszone z 25px */
    line-height: 1.2;
}

.logo span {
    color: #084b01;
    font-weight: 400;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.progress-bar {
    width: 25%;
    height: 100%;
    background: #084b01;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.trust-banner {
    font-size: 18px; /* Zwiększone z 16px */
    color: #000000; /* Zmienione na czarny dla maksymalnej czytelności */
    line-height: 1.4;
    margin-top: 10px;
    margin-bottom: 25px; /* Dodano margines dolny dla 'oddechu' przed formularzem */
    padding: 0 10px;
    text-align: center;
}

/* FORM STEPS */
.step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #084b01; /* Kolor zielony z tła */
}

.h1-sub {
    color: #000000;
    text-transform: none; /* Wyłącza kapitaliki dla tego fragmentu */
    font-weight: 400;
    font-size: 20px;
    display: block;
    margin-top: 12px;
    letter-spacing: 0;
}

.subtitle {
    color: var(--text-sub);
    font-size: 15px;
    margin-bottom: 25px;
}

/* INPUTS */
.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 14px; /* Powiększone o 1px */
    font-weight: 600;
    margin-bottom: 6px;
    margin-left: 10px; /* Margines od lewej krawędzi pola */
    text-transform: uppercase;
    color: #444444; /* Mocniejsza szarość */
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(102, 102, 102, 0.7); /* Szary 70% */
    border-radius: 12px;
    font-size: 16px;
    background: var(--card-bg);
    transition: all 0.1s ease;
    outline: none;
    color: var(--text-main);
}

/* Styl dla placeholderów i nieaktywnego select */
::placeholder {
    color: rgba(102, 102, 102, 0.7);
    opacity: 1; /* Firefox */
}

select:invalid {
    color: rgba(102, 102, 102, 0.7);
}

select option {
    color: var(--text-main);
}

select {
    padding-right: 24px; /* Odsunięcie strzałki o dodatkowe 10px */
    appearance: none; /* Reset dla customizacji paddingu w niektórych przeglądarkach */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

input:focus, select:focus {
    border: 2px solid #084b01; /* Ramka 2px w kolorze tła */
    padding: 13px; /* Zmniejszony padding o 1px aby zrekompensować grubszą ramkę (brak skakania) */
}

/* VALIDATION STATES */
input.invalid, select.invalid {
    border-color: #ff4d4d !important;
}

input.valid, select.valid {
    border-color: #2D5A27 !important;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.row.address-row {
    grid-template-columns: 3fr 1fr; /* 75% i 25% */
}

/* BUTTONS */
.btn-next, .btn-submit, .btn-prev {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-family: 'Barlow', sans-serif;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    box-sizing: border-box;
    margin-top: 20px; /* Jednolity margines dla wszystkich przycisków */
}

.btn-next, .btn-submit {
    width: 100%;
    background-color: var(--pillar-burgundy);
    color: white;
    border: none;
}

.btn-prev {
    background-color: #adc85d; /* Nowy kolor tła */
    border: 1px solid transparent; /* Przezroczysta ramka dla równej wysokości */
    color: #FFFFFF; /* Biały tekst dla kontrastu */
    width: 100%;
}

.btn-group {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    /* Usunięto margin-top stąd, aby przyciski wewnątrz same zarządzały odstępem */
}

.btn-group .btn-next, .btn-group .btn-submit, .btn-group .btn-prev {
    margin-top: 0; /* Wyzerowanie marginesu dla wszystkich typów przycisków w grupie */
}

.btn-group {
    margin-top: 20px;
}

button:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* CHECKBOX CARDS */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

.checkbox-card input {
    display: none;
}

.card-content {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.card-content .icon {
    font-size: 24px;
}

.checkbox-card input:checked + .card-content {
    border-color: var(--accent-green);
    background-color: #F0FFF0;
}

/* SUCCESS & LEGAL */
/* LEGAL CHECKS */
.legal-checks {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-container {
    display: flex;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    color: #444444;
    line-height: 1.4;
    text-align: left;
    text-transform: none; /* Wyłączenie kapitalików dla legali */
    font-weight: 400; /* Normalna waga fontu */
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 1px solid rgba(102, 102, 102, 0.7);
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #f0f0f0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #084b01;
    border-color: #084b01;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.legal-text a {
    color: #084b01;
    text-decoration: underline;
}

.checkbox-container input.invalid ~ .checkmark {
    border-color: #ff4d4d !important;
    background-color: #fff5f5;
}

.checkbox-container input.valid ~ .checkmark {
    border-color: #2D5A27 !important;
}

.legal {
    font-size: 12px;
    color: var(--text-sub);
    margin: 20px 0;
    text-align: center;
}

.success-content {
    text-align: center;
    padding: 40px 0;
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    height: 80px; /* Zwiększone z 60px */
    margin-bottom: 40px;
}

.pillar-bar {
    width: 20px; /* Zwiększone z 14px */
    background-color: #084b01;
    border-radius: 8px;
    animation: pillarGrow 1.2s ease-in-out infinite;
}

.pillar-bar:nth-child(1) { height: 35px; animation-delay: 0s; }
.pillar-bar:nth-child(2) { height: 60px; animation-delay: 0.2s; }
.pillar-bar:nth-child(3) { height: 40px; animation-delay: 0.4s; }

@keyframes pillarGrow {
    0%, 100% { transform: scaleY(1); opacity: 0.5; }
    50% { transform: scaleY(1.4); opacity: 1; }
}

footer {
    margin-top: auto;
    padding: 40px 0 20px;
    text-align: center;
    font-size: 18px; /* Powiększone o 50% */
    color: var(--text-sub);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    padding-bottom: 30px;
}

.footer-links a {
    color: #FFFFFF; /* Zmienione na biały zgodnie z instrukcją */
    text-decoration: none;
    font-size: 16px; /* Zwiększone z 14px */
    font-weight: 400;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* COOKIE BANNER */
.cookie-card {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: 400px;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10000;
    display: none; /* Domyślnie ukryty, pokazywany przez JS */
    animation: slideUp 0.5s ease;
}

@media (min-width: 600px) {
    .cookie-card {
        left: auto;
        bottom: 30px;
        right: 30px;
    }
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cookie-content p {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.4;
}

.cookie-content a {
    color: #084b01;
    text-decoration: underline;
}

.cookie-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-cookie-accept, .btn-cookie-settings {
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-cookie-accept {
    background: var(--pillar-burgundy);
    color: white;
}

.btn-cookie-settings {
    background: transparent;
    border: 1px solid #084b01;
    color: #084b01;
}

.btn-cookie-accept:hover { opacity: 0.9; }
.btn-cookie-settings:hover { background: #f0f0f0; }

/* AUTOCOMPLETE ADDRESS */
.autocomplete {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: none; /* Usunięto obramowanie */
    z-index: 9999;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-items:empty {
    display: none; /* Ukrywa pusty kontener */
}

.autocomplete-items div {
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.autocomplete-items div:last-child {
    border-bottom: none;
}

.autocomplete-items div:hover {
    background-color: #f0f0f0;
}

.autocomplete-active {
    background-color: var(--accent-green) !important;
    color: #ffffff;
}

/* GOOGLE PLACES AUTOCOMPLETE DROPDOWN */
.pac-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    margin-top: 4px;
    overflow: hidden;
}
.pac-item {
    padding: 10px 14px;
    cursor: pointer;
    border-top: 1px solid var(--border-color);
    color: var(--text-main);
    line-height: 1.4;
}
.pac-item:first-child { border-top: none; }
.pac-item:hover, .pac-item-selected {
    background-color: #f0f0f0;
}
.pac-item-query {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}
.pac-icon { display: none; }
.pac-logo { display: none !important; }

/* MOBILE FIXES */
@media (max-width: 480px) {
    body {
        padding: 12px 10px;
        background-attachment: scroll; /* iOS Safari fix — fixed nie działa na iPhone */
    }
    .container {
        padding: 25px 18px;
        border-radius: 16px;
    }
    .row.address-row {
        grid-template-columns: 1fr;
        gap: 0; /* Na mobile input-group margin-bottom (20px) wystarcza */
    }
    .header-text {
        font-size: 24px;
    }
    .trust-banner {
        font-size: 16px;
    }
    .logo {
        font-size: 38px;
    }
}