/* =================================================================
   KONTAKT - STYLES (prefix: ktn_)
   Wszystkie klasy poprzedzone "ktn_" aby uniknąć konfliktów
   z istniejącymi stylami na stronie. Brak font-family - dziedziczy
   się globalnie z całej strony.
================================================================= */

/* ---- Zmienne (CSS variables) + reset, zaczepione na .ktn_section
   (poziom niżej niż .sections, bo .content_contact i .sections są już
   zdefiniowane w głównym CSS strony) ---- */
.ktn_section {
    --ktn_red: #7a2230;
    --ktn_red-dark: #5e1a24;
    --ktn_dark: #1a1a1a;
    --ktn_gray-text: #4a4a4a;
    --ktn_gray-light: #6b6b6b;
    --ktn_bg-light: #f2f1ef;
    --ktn_bg-lighter: #f5f5f4;
    --ktn_bg-dark: #4a4a4a;
    --ktn_border: #d8d6d2;
    --ktn_white: #ffffff;

    --ktn_radius-sm: 4px;
    --ktn_radius-md: 8px;

    --ktn_gap-lg: 60px;
    --ktn_gap-md: 40px;
    --ktn_gap-sm: 20px;
}

.ktn_section * {
    box-sizing: border-box;
}

/* Screen-reader only - widoczne dla robotów i czytników, niewidoczne wizualnie */
/* H1 ukryty wizualnie - Google indeksuje treść h1 nawet przy display:none
   gdy jest spójna z widoczną zawartością strony (nie jest cloakingiem) */
.ktn_sr-only {
    display: none;
}

/* ---- Layout sekcji ---- */
.ktn_section {
    width: 100%;
    padding: 80px 100px;
}

/* Nadpisanie globalnych marginesów .sections - na stronie kontaktowej
   sekcje mają się stykać, oddzielone tylko cienką linią separatora */
.content_contact .sections {
    margin-top: 0;
    margin-bottom: 0;
    max-width: 100% !important;
}

/* Odsunięcie całego bloku kontaktowego od góry strony */
.content_contact {
    width: 100%;
    margin-top: 40px;
    position: relative;
}

/* ---- Typografia wspólna ---- */
.ktn_h2 {
    font-weight: 700;
    font-size: 40px;
    line-height: 1.2;
    color: var(--ktn_dark);
    margin: 0 0 16px 0;
}

.ktn_h3 {
    font-weight: 800;
    font-size: 20px;
    line-height: 1.3;
    color: var(--ktn_dark);
    margin: 0 0 12px 0;
}

.ktn_text {
    color: var(--ktn_gray-text);
    line-height: 1.6;
    margin: 0;
}

.ktn_text--bold {
    font-weight: 700;
    color: var(--ktn_dark);
    margin-bottom: 4px;
}

.ktn_eyebrow {
    display: block;
    font-weight: 600;
    color: var(--ktn_dark);
    margin-bottom: 16px;
}

.ktn_link {
    color: var(--ktn_red);
    font-weight: 700;
    text-decoration: none;
}

.ktn_link:hover {
    text-decoration: underline;
}

.ktn_section-header {
    margin-bottom: var(--ktn_gap-lg);
}

.ktn_section-header--center {
    text-align: center;
}

.ktn_section-header--center .ktn_text {
    max-width: 500px;
    margin: 0 auto;
}

/* =================================================================
   TŁA SEKCJI - działają na 100% bo .sections ma teraz max-width: 100%
================================================================= */
/* =================================================================
   TŁA NA .sections (100% szerokości ekranu)
   klasy ktn_bg--* są ustawione na div.sections w HTML
================================================================= */
.ktn_bg--form        { background-color: #f2f1ef; }
.ktn_bg--process     { background-color: #F6F4EE; }
.ktn_bg--safety      { background-color: #f5f5f4; }
.ktn_bg--faq         { background-color: #F6F4EE; }
.ktn_bg--testimonial { background-color: #ffffff; }
.ktn_bg--map         { background-color: #ffffff; }

/* =================================================================
   SEKCJA 1 / 6 - Formularz kontaktowy
================================================================= */
.ktn_section--form {
    padding: 0;
    position: relative;
    isolation: isolate;
}

/* Czarno-białe, ledwo widoczne tło ze zdjęciem */
.ktn_section--form::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/gfx/background-budynek.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(1);
    opacity: 0.12;
    z-index: 0;
}

/* Treść formularza nad tłem - padding dopasowany do reszty sekcji */
.ktn_section--form > .ktn_form-grid {
    position: relative;
    z-index: 1;
    padding: 80px 100px;
}

.ktn_form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 60px;
}

.ktn_form-intro {
    padding: 60px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.ktn_form-intro .ktn_h2 {
    margin-top: 0;
    margin-bottom: 24px;
}

.ktn_form-intro .ktn_text {
    font-size: 20px;
}

.ktn_section--form .ktn_form-card {
    background-color: var(--ktn_white);
    padding: 45px 30px;
    margin: 45px 0;
}

.ktn_form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.ktn_form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.ktn_form-row--three {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ---- Wiersz z select + dynamiczne pole "Inne" obok niego ---- */
.ktn_form-row--build-type {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 28px;
}

.ktn_form-row--build-type > .ktn_form-group:first-child {
    flex: 30 1 200px;
    min-width: 0;
}

.ktn_form-row--build-type .ktn_form-group--inline-extra {
    display: none !important;
    flex: 70 1 280px;
    min-width: 0;
    opacity: 0;
    padding: 8px 10px;
    margin: -8px -10px;
    border-radius: var(--ktn_radius-sm);
    animation: ktn_fade_in 0.3s ease forwards, ktn_blink 0.4s ease 0.3s 2;
}

.ktn_form-row--build-type .ktn_form-group--inline-extra.ktn_visible {
    display: flex !important;
}

@keyframes ktn_fade_in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ktn_blink {
    0%, 100% { background-color: transparent; }
    50%      { background-color: rgba(122, 34, 48, 0.08); }
}

.ktn_form-group--inline-extra .ktn_label,
.ktn_form-group--inline-extra .ktn_input {
    white-space: normal;
}

.ktn_form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ktn_label {
    font-weight: 600;
    color: var(--ktn_dark);
}

.ktn_input,
.ktn_select,
.ktn_textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid var(--ktn_border);
    background: transparent;
    padding: 6px 0 12px 0;
    color: #000000 !important;
    font-weight: 200 !important;
}

.ktn_input::placeholder,
.ktn_textarea::placeholder {
    color: #a8a6a2 !important;
    font-weight: 200 !important;
}

.ktn_input:focus,
.ktn_select:focus,
.ktn_textarea:focus {
    outline: none;
    border-bottom-color: var(--ktn_red);
}

.ktn_select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%234a4a4a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    cursor: pointer;
    color: #000000 !important;
    font-weight: 200 !important;
}

/* Tylko placeholder "Wybierz opcję" (option[disabled] wybrana) jest szary,
   reszta wybranych wartości jest zawsze czarna */
.ktn_select:invalid {
    color: #a8a6a2 !important;
}

.ktn_select option {
    color: #000000 !important;
    font-weight: 200 !important;
}

.ktn_textarea {
    resize: vertical;
    min-height: 90px;
    border: 1px solid var(--ktn_border);
    border-radius: var(--ktn_radius-sm);
    padding: 12px;
    color: #000000 !important;
    font-weight: 200 !important;
}

.ktn_textarea:focus {
    border-color: var(--ktn_red);
}

.ktn_checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ktn_checkbox {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--ktn_red);
}

.ktn_checkbox-label {
    color: var(--ktn_gray-text);
    line-height: 1.5;
}

/* ---- Spinner na przycisku submit ---- */
.ktn_btn--submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ktn_btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ktn_spin 0.7s linear infinite;
}

.ktn_btn--loading .ktn_btn-spinner {
    display: inline-block;
}

.ktn_btn--loading {
    opacity: 0.8;
    cursor: not-allowed;
}

@keyframes ktn_spin {
    to { transform: rotate(360deg); }
}

/* ---- Komunikat sukcesu ---- */
.ktn_form-success {
    padding: 30px 0;
    text-align: center;
}

.ktn_form-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: #2e7d32;
    color: #ffffff;
    margin-bottom: 24px;
}

.ktn_form-success-icon svg {
    width: 36px;
    height: 36px;
}

.ktn_form-success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--ktn_dark);
    margin: 0 0 16px 0;
}

.ktn_form-success-text {
    font-size: 18px;
    max-width: 420px;
    margin: 0 auto;
}

.ktn_form-success .ktn_btn {
    display: inline-block;
    margin-top: 24px;
}

/* ---- Przyciski ---- */
.ktn_btn {
    display: inline-block;
    border: none;
    border-radius: var(--ktn_radius-sm);
    padding: 16px 32px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    width: fit-content;
}

.ktn_btn--primary {
    background-color: var(--ktn_red);
    color: var(--ktn_white);
    transition: background-color 0.2s ease;
}

.ktn_btn--primary:hover {
    background-color: var(--ktn_red-dark);
}

/* =================================================================
   SEKCJA 2 - Proces wyceny
================================================================= */
.ktn_section--process {
}

.ktn_process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ktn_gap-md);
    text-align: center;
}

.ktn_process-item .ktn_h3 {
    margin-bottom: 20px;
}

/* =================================================================
   SEKCJA 3 - Bezpieczeństwo
================================================================= */
.ktn_section--safety {
}

.ktn_safety-header {
    display: grid;
    grid-template-columns: 55% 1fr;
    gap: var(--ktn_gap-md);
    margin-bottom: var(--ktn_gap-lg);
}

.ktn_safety-header-right {
    display: flex;
    align-items: flex-start;
    padding-top: 8px;
    text-align: right;
    justify-content: flex-end;
}

.ktn_safety-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--ktn_gap-md);
    border-top: 1px solid var(--ktn_border);
    padding-top: var(--ktn_gap-md);
}

.ktn_icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    color: var(--ktn_dark);
    margin-bottom: 24px;
}

.ktn_icon svg {
    width: 100%;
    height: 100%;
}

.ktn_safety-item .ktn_h3 {
    margin-bottom: 16px;
}

/* =================================================================
   SEKCJA 4 - FAQ
================================================================= */
.ktn_section--faq {
}

.ktn_section--faq > .ktn_h2 {
    margin-bottom: var(--ktn_gap-lg);
}

.ktn_faq-list {
    display: flex;
    flex-direction: column;
}

.ktn_faq-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ktn_gap-md);
    padding: 32px 0;
    border-top: 1px solid var(--ktn_border);
}

.ktn_faq-item:last-child {
    border-bottom: 1px solid var(--ktn_border);
}

.ktn_faq-item .ktn_h3 {
    font-size: 18px;
    margin: 0;
}

/* =================================================================
   SEKCJA 5 - Opinie inwestorów (video)
================================================================= */
.ktn_section--testimonial {
}

.ktn_section--testimonial > .ktn_h2 {
    margin-bottom: var(--ktn_gap-sm);
}

.ktn_video-responsive {
    max-width: 1200px;
    margin: 0 auto;
}

.ktn_video-responsive iframe {
    display: block;
}

/* =================================================================
   SEKCJA 7 - Mapa
================================================================= */
.ktn_section--map {
}

.ktn_map-wrapper {
    width: 100%;
    margin-bottom: var(--ktn_gap-md);
}

.ktn_map-iframe {
    width: 100%;
    height: 450px;
    display: block;
}

.ktn_map-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ktn_gap-md);
}

/* =================================================================
   RESPONSYWNOŚĆ
================================================================= */

/* Tablet */
@media (max-width: 992px) {
    .ktn_section {
        padding: 60px 60px;
    }

    .ktn_form-grid {
        grid-template-columns: 1fr;
        padding: 60px 20px;
    }

    .ktn_form-row--three {
        grid-template-columns: 1fr;
    }

    .ktn_form-intro {
        padding: 0 0 40px 0;
    }

    .ktn_form-card {
        padding: 40px 20px;
        margin: 0;
    }

    .ktn_process-grid {
        grid-template-columns: 1fr;
        gap: var(--ktn_gap-lg);
    }

    .ktn_safety-header {
        grid-template-columns: 1fr;
        gap: var(--ktn_gap-sm);
    }

    .ktn_safety-header-right {
        padding-top: 0;
    }

    .ktn_safety-grid {
        grid-template-columns: 1fr;
        gap: var(--ktn_gap-lg);
    }

    .ktn_map-footer {
        grid-template-columns: 1fr;
        gap: var(--ktn_gap-sm);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .ktn_section {
        padding: 40px 24px;
    }

    .ktn_h2 {
        font-size: 32px;
    }

    .ktn_form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ktn_form-grid {
        padding: 40px 16px;
    }

    .ktn_form-card {
        padding: 30px 16px;
        margin: 0;
    }

    .ktn_form-intro {
        padding: 0 0 30px 0;
    }

    .ktn_faq-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ktn_map-iframe {
        height: 300px;
    }

    .ktn_btn {
        width: 100%;
    }
}
