/* contact.css - ZOPTYMALIZOWANY DLA MOBILE & TABLET */

html,
body {
    height: 100%;
    margin: 0;
    /* Zapobiega poziomemu przewijaniu na małych ekranach */
    overflow-x: hidden;
    /* Poprawka dla płynności czcionek na iOS */
    -webkit-text-size-adjust: 100%;
}

.contact-wrapper {
    /* FIX: dvh (dynamic viewport height) naprawia skaczący pasek adresu na iPhone/Android */
    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    /* Wyśrodkowanie na dużych ekranach */
    padding: 40px 10%;
    box-sizing: border-box;

    /* Zapewnia przewijanie, jeśli ekran jest za mały w pionie (np. telefon poziomo) */
    overflow-y: auto;
}

/* KARTA FORMULARZA */
.contact-card {
    width: 100%;
    max-width: 380px;
    /* Lekko poszerzyłem dla lepszej czytelności */
    padding: 32px 28px;
    background: rgba(0, 0, 0, 0.01);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    /* Zapobiega zniekształceniu przy zmianie rozmiaru okna */
    flex-shrink: 0;
}

/* KARTA Z OBRAZKIEM */
.image-card {
    flex: 1;
    height: 100%;
    /* Dopasowanie wysokości do karty obok */
    align-self: stretch;
    min-height: 360px;
    padding: 20px;

    background: rgba(0, 0, 0, 0.01);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);

    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    /* Ograniczenie, żeby zdjęcie nie było gigantyczne na monitorach */
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ważne: zdjęcie wypełni ramkę i nie zostanie spłaszczone */
    border-radius: 12px;
    max-height: 400px;
}

/* TYPOGRAFIA I ELEMENTY FORMULARZA */
h1 {
    font-size: 20px;
    font-weight: 200;
    color: white;
    letter-spacing: 5px;
    margin-bottom: 6px;
    margin-top: 0;
}

.subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    margin-bottom: 28px;
    font-family: "Mona Sans", "Neue Montreal", "Inter", system-ui, sans-serif;
    font-variation-settings: "wdth" 90, "wght" 200;
}

.field {
    position: relative;
    margin-bottom: 32px;
}

/* STYLE DLA INPUTÓW - KLUCZOWE DLA MOBILE */
input,
textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    font-size: 17px;
    /* 17px zapobiega zoomowaniu na iPhone przy kliknięciu */
    padding: 10px 0 6px;
    outline: none;
    font-family: "Mona Sans", "Neue Montreal", "Inter", system-ui, sans-serif;
    font-variation-settings: "wdth" 90, "wght" 200;

    /* FIX: Reset stylów iOS (usuwa domyślne cienie i zaokrąglenia) */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
}

textarea {
    min-height: 40px;
    max-height: 120px;
    /* Nieco więcej miejsca na wiadomość */
    resize: vertical;
}

label {
    position: absolute;
    left: 0;
    top: 10px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 17px;
    pointer-events: none;
    transition: all 0.35s ease;
    font-family: "Mona Sans", "Neue Montreal", "Inter", system-ui, sans-serif;
    font-variation-settings: "wdth" 90, "wght" 200;
}

input:focus+label,
input:not(:placeholder-shown)+label,
textarea:focus+label,
textarea:not(:placeholder-shown)+label {
    top: -10px;
    font-size: 12px;
    color: #fff;
}

/* PRZYCISK SEND */
button {
    width: 100%;
    padding: 15px;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 15px;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Mona Sans", "Neue Montreal", "Inter", system-ui, sans-serif;
    font-variation-settings: "wdth" 90, "wght" 200;

    /* FIX: Reset stylów przycisku na iOS */
    -webkit-appearance: none;
    appearance: none;
}

button:hover,
button:active {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* FIX DLA AUTOUZUPEŁNIANIA (AUTOFILL) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px black inset !important;
    -webkit-text-fill-color: white !important;
    font-family: "Mona Sans", "Neue Montreal", "Inter", system-ui, sans-serif !important;
    font-size: 17px !important;
    transition: background-color 5000s ease-in-out 0s;
}

input {
    caret-color: white;
}

/* ========================================= */
/* === TABLET OPTIMIZATION (iPad itp.) === */
/* ========================================= */
@media (max-width: 1024px) {
    .contact-wrapper {
        padding: 60px 5%;
        /* Mniejsze marginesy boczne */
        flex-direction: column;
        /* Układ pionowy na tabletach */
        justify-content: center;
        gap: 30px;
    }

    .contact-card,
    .image-card {
        max-width: 500px;
        /* Szersze karty na tablecie */
        width: 100%;
    }

    .image-card {
        min-height: 250px;
        /* Niższa karta ze zdjęciem, żeby nie zajmowała całego ekranu */
    }
}

/* ========================================= */
/* === MOBILE OPTIMIZATION (Phones) === */
/* ========================================= */
@media (max-width: 640px) {
    .contact-wrapper {
        padding: 80px 20px 40px;
        /* Więcej miejsca u góry (na navbar) */
        gap: 20px;
    }

    .contact-card {
        padding: 24px 20px;
        /* Na małym ekranie karta zajmuje całą szerokość */
        max-width: 100%;
    }

    .image-card {
        /* Na małym telefonie zdjęcie jest mniej ważne, zmniejszamy je */
        min-height: 180px;
        max-height: 220px;
        padding: 15px;
    }

    .image-card img {
        max-height: 100%;
    }

    /* Poprawka dla bardzo małych ekranów (np. starsze iPhone, Galaxy Fold złożony) */
    @media (max-height: 700px) {
        .image-card {
            display: none;
            /* Ukrywamy zdjęcie, jeśli ekran jest niski, żeby klawiatura nie zasłoniła inputów */
        }

        .contact-wrapper {
            justify-content: flex-start;
            /* Przesuwamy treść do góry */
            padding-top: 100px;
        }
    }
}