/* popup.css - WERSJA PREMIUM (Złoto/Czerń) */

/* Overlay (przyciemnienie tła) */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75); /* Ciemniejszy overlay dla kinowego efektu */
    backdrop-filter: blur(5px); /* Rozmycie tła - premium glassmorphism */
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

/* Popup "Sprawdź termin" */
#contactPopup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #0d0e12; /* Głęboka kinowa czerń */
    border: 1px solid rgba(212, 175, 55, 0.2); /* Subtelna złota ramka */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.15); /* Złota poświata */
    border-radius: 12px;
    z-index: 10001;
    width: 90%;
    max-width: 420px;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
    box-sizing: border-box; /* NAPRAWA WYŚRODKOWANIA */
}

#contactPopup *, #contactPopup *::before, #contactPopup *::after {
    box-sizing: inherit; /* NAPRAWA WYŚRODKOWANIA PÓŁ */
}

#contactPopup.active {
    opacity: 1;
}

.popup-overlay.active {
    opacity: 1;
}

#contactPopup h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    color: #d4af37; /* Eleganckie złoto */
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Przycisk zamknięcia */
.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #888;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1;
}

.close-popup:hover {
    color: #d4af37; /* Złoty przy hoverze */
    transform: rotate(90deg);
}

.popup-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Formularz */
#contactForm {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center; /* Wyśrodkowanie grupy */
    width: 100%;
}

#contactForm label {
    font-size: 14px;
    font-weight: 500;
    color: #a0a0a0;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
    display: block;
}

#contactForm input,
#contactForm select {
    padding: 14px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background-color: #16181f;
    color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    width: 100%; /* Pełna szerokość względem wyśrodkowanej grupy */
    max-width: 100%;
    text-align: center; /* Wyśrodkowany tekst w inpucie */
    display: block;
    margin: 0 auto;
}

#contactForm input:focus,
#contactForm select:focus {
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
    background-color: #1a1c24;
    outline: none;
}

#contactForm input::placeholder,
#contactForm select:invalid {
    color: #555;
    font-weight: 300;
    text-align: center; /* Wyśrodkowany placeholder */
}

/* Przycisk wysyłania w formularzu */
#contactForm button[type="submit"] {
    background: linear-gradient(135deg, #c59a3f 0%, #e8c872 50%, #c59a3f 100%);
    color: #0d0e12;
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 50px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    width: 80%; /* Skrócony, wyśrodkowany przycisk */
    margin: 15px auto 0 auto; /* Idealne wyśrodkowanie przycisku z odstępem od góry */
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

#contactForm button[type="submit"]:hover {
    background: linear-gradient(135deg, #e8c872 0%, #f3e5ab 50%, #e8c872 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Stylizacja wszystkich .cta-button na całej stronie (button, div, a) */
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 35px;
    background: linear-gradient(135deg, #c59a3f 0%, #e8c872 50%, #c59a3f 100%);
    color: #0d0e12;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* Hover dla wszystkich .cta-button */
.cta-button:hover {
    background: linear-gradient(135deg, #e8c872 0%, #f3e5ab 50%, #e8c872 100%);
    transform: translateY(-2px);
    color: #000000;
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Kontekstualne wyśrodkowanie w różnych sekcjach */
header.site-header .cta-button-wrapper,
.main-content .com-content-article__body .cta-button,
.bottom-1 .wzk-bottom1-package .cta-button {
    display: flex;
    justify-content: center;
}

/* Zapewnienie, że <a> i <div> zachowują się jak przycisk */
.cta-button[href],
.cta-button:not([href]):not(button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Responsywność */
@media (max-width: 575.98px) {
    #contactPopup {
        width: 92%;
        max-width: 350px;
        padding: 25px 20px;
    }

    #contactPopup h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    #contactForm label {
        font-size: 13px;
    }

    #contactForm input,
    #contactForm select {
        padding: 12px;
        font-size: 15px;
    }

    #contactForm button[type="submit"] {
        padding: 14px 20px;
        font-size: 15px;
    }

    /* Wyrazy pod sobą i wyśrodkowanie dla wszystkich .cta-button */
    button.cta-button {
        display: inline-flex !important;
        flex-direction: column !important;
        white-space: normal !important;
        padding: 12px 20px !important;
        font-size: 1em !important;
        line-height: 1.2 !important;
        margin: 0 auto !important;
        width: auto !important;
        min-width: unset !important;
        max-width: 100% !important;
        background: linear-gradient(135deg, #c59a3f 0%, #e8c872 50%, #c59a3f 100%) !important;
        border-radius: 50px !important;
    }
}
