/* =========================================================
   KONTAKT — Termo Garaż
   Zdjęcie w ramce, lewa treść prosta, ciemna karta formularza.
   ========================================================= */

.tg-contact {
    position: relative;
    background-color: var(--tg-base);
    color: var(--tg-ink);
    padding-block: clamp(3.25rem, 6.5vh, 5.25rem);
    scroll-margin-top: 5.5rem;
}

.tg-contact__layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(19rem, 26rem);
    gap: clamp(1.5rem, 3.2vw, 3.25rem);
    align-items: stretch;
    padding: clamp(1.5rem, 3.6vw, 3.15rem);
    overflow: hidden;
    border-radius: 28px;
    background-color: #101010;
    opacity: 0;
    transform: translateY(14px);
}

.tg-contact.is-in .tg-contact__layout {
    animation: tg-rise 0.8s var(--tg-ease-out) forwards;
}

.tg-contact__stage {
    display: contents;
}

.tg-contact__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 38% 55%;
    pointer-events: none;
}

.tg-contact__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7, 7, 7, 0.82) 0%, rgba(7, 7, 7, 0.46) 46%, rgba(7, 7, 7, 0.28) 100%),
        linear-gradient(180deg, rgba(7, 7, 7, 0.12), rgba(7, 7, 7, 0.38));
    pointer-events: none;
}

.tg-contact__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(1.5rem, 3vh, 2.5rem);
    min-width: 0;
    min-height: 100%;
    padding-block: 0.35rem;
}

.tg-contact__title {
    margin: 0 0 1.05rem;
    font-size: clamp(2.15rem, 4.4vw, 3.45rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.tg-contact__title span {
    display: block;
}

.tg-contact__lead {
    margin: 0;
    max-width: 28rem;
    font-size: clamp(1rem, 1.35vw, 1.125rem);
    line-height: 1.55;
    color: rgba(245, 245, 247, 0.78);
    text-wrap: pretty;
}

.tg-contact__list {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tg-contact__item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
}

.tg-contact__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border: 1px solid rgba(245, 245, 247, 0.2);
    border-radius: 50%;
    color: var(--tg-ink);
}

.tg-contact__icon svg {
    display: block;
    width: auto;
    height: auto;
    max-width: 1.05rem;
    max-height: 1.05rem;
    flex-shrink: 0;
    overflow: visible;
}

.tg-contact__item a,
.tg-contact__item span:not(.tg-contact__icon):not(.tg-contact__social) {
    min-width: 0;
    padding-top: 0.35rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--tg-ink);
    overflow-wrap: anywhere;
    transition: color 0.3s var(--tg-ease);
}

.tg-contact__item a:hover,
.tg-contact__item a:focus-visible {
    color: var(--tg-accent);
}

.tg-contact__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    padding-top: 0.35rem;
}

.tg-contact__social a {
    padding-top: 0;
}

.tg-contact__card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    width: 100%;
    min-height: 100%;
    padding: clamp(1.35rem, 2.4vw, 1.9rem);
    background: #161616;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

.tg-contact__card-title {
    flex-shrink: 0;
    margin: 0 0 0.45rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.tg-contact__card-lead {
    flex-shrink: 0;
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--tg-muted);
}

.tg-contact__form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.tg-contact__form .wpcf7 {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin: 0;
}

.tg-contact__form .wpcf7 form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.tg-contact__form .wpcf7 .hidden-fields-container,
.tg-contact__form .wpcf7 .screen-reader-response {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.tg-contact .cf7-board {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 0;
}

.tg-contact .cf7-board__row,
.tg-contact .cf7-field:not(.cf7-field--msg),
.tg-contact .cf7-board__foot {
    flex-shrink: 0;
}

.tg-contact .cf7-board__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.tg-contact .cf7-field {
    position: relative;
    margin: 0;
    min-width: 0;
}

.tg-contact .cf7-field__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.tg-contact .cf7-field__legend {
    display: block;
    margin: 0.35rem 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tg-ink);
}

.tg-contact .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.tg-contact .wpcf7 input[type="text"],
.tg-contact .wpcf7 input[type="email"],
.tg-contact .wpcf7 input[type="tel"],
.tg-contact .wpcf7 textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.85rem 1.1rem;
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--tg-ink);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--tg-pill);
    outline: none;
    box-shadow: none;
    appearance: none;
    transition:
        background-color 0.3s var(--tg-ease),
        border-color 0.3s var(--tg-ease);
}

.tg-contact .cf7-field--msg {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 3.25rem;
}

.tg-contact .cf7-field--msg .wpcf7-form-control-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.tg-contact .wpcf7 textarea {
    flex: 1 1 auto;
    min-height: 3.25rem;
    height: auto;
    resize: vertical;
    border-radius: 18px;
    line-height: 1.5;
}

.tg-contact .wpcf7 input::placeholder,
.tg-contact .wpcf7 textarea::placeholder {
    color: var(--tg-faint);
    opacity: 1;
}

.tg-contact .wpcf7 input:hover,
.tg-contact .wpcf7 textarea:hover {
    background: rgba(255, 255, 255, 0.07);
}

.tg-contact .wpcf7 input:focus,
.tg-contact .wpcf7 textarea:focus,
.tg-contact .wpcf7 input:focus-visible,
.tg-contact .wpcf7 textarea:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
}

.tg-contact .wpcf7-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tg-contact .wpcf7-list-item {
    margin: 0;
}

.tg-contact .wpcf7-radio .wpcf7-list-item label {
    display: inline-flex;
    align-items: center;
    min-height: 2.15rem;
    padding: 0 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--tg-pill);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: var(--tg-ink);
    cursor: pointer;
    transition:
        background-color 0.3s var(--tg-ease),
        border-color 0.3s var(--tg-ease),
        color 0.3s var(--tg-ease);
}

.tg-contact .wpcf7-radio .wpcf7-list-item input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.tg-contact .wpcf7-radio .wpcf7-list-item label:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tg-contact .wpcf7-radio .wpcf7-list-item label:has(input:checked) {
    background: #f5f5f7;
    border-color: #f5f5f7;
    color: #070707;
}

.tg-contact .cf7-board__foot {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.tg-contact .cf7-board__foot > p {
    margin: 0;
    width: 100%;
}

.tg-contact .wpcf7 .wpcf7-acceptance {
    margin: 0;
    background: none;
    border: 0;
}

.tg-contact .wpcf7 .wpcf7-acceptance .wpcf7-list-item {
    margin: 0;
}

.tg-contact .wpcf7 .wpcf7-acceptance .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
}

.tg-contact .wpcf7 .wpcf7-acceptance input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    margin-top: 0.15rem;
    accent-color: var(--tg-accent);
    cursor: pointer;
}

.tg-contact .wpcf7 .wpcf7-acceptance .wpcf7-list-item-label {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--tg-muted);
}

.tg-contact .wpcf7 .wpcf7-acceptance .wpcf7-list-item-label a {
    color: var(--tg-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s var(--tg-ease);
}

.tg-contact .wpcf7 .wpcf7-acceptance .wpcf7-list-item-label a:hover,
.tg-contact .wpcf7 .wpcf7-acceptance .wpcf7-list-item-label a:focus-visible {
    color: var(--tg-accent);
}

.tg-contact .wpcf7 input[type="submit"],
.tg-contact .tg-contact__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.05rem;
    margin: 0;
    padding: 0.85rem 1.25rem;
    font-family: var(--wp--preset--font-family--montserrat);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    color: #070707;
    background: #f5f5f7;
    border: 1px solid #f5f5f7;
    border-radius: var(--tg-pill);
    cursor: pointer;
    transition:
        background-color 0.3s var(--tg-ease),
        border-color 0.3s var(--tg-ease),
        color 0.3s var(--tg-ease);
}

.tg-contact .wpcf7 input[type="submit"]:hover,
.tg-contact .wpcf7 input[type="submit"]:focus-visible,
.tg-contact .tg-contact__submit:hover,
.tg-contact .tg-contact__submit:focus-visible {
    background: var(--tg-accent);
    border-color: var(--tg-accent);
    color: #fff;
}

.tg-contact .wpcf7 input[type="submit"]:focus-visible,
.tg-contact .tg-contact__submit:focus-visible,
.tg-contact__item a:focus-visible {
    outline: 2px solid var(--tg-accent);
    outline-offset: 3px;
}

.tg-contact .wpcf7 .wpcf7-spinner {
    display: none;
}

.tg-contact .wpcf7 .wpcf7-not-valid-tip {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: #fca5a5;
}

.tg-contact .wpcf7 .wpcf7-not-valid {
    border-color: rgba(225, 29, 46, 0.7) !important;
}

.tg-contact .wpcf7 form.init .wpcf7-response-output,
.tg-contact .wpcf7 form.resetting .wpcf7-response-output,
.tg-contact .wpcf7 form.submitting .wpcf7-response-output,
.tg-contact .wpcf7 form.invalid .wpcf7-response-output,
.tg-contact .wpcf7 .wpcf7-response-output:empty {
    display: none !important;
}

.tg-contact .wpcf7 .wpcf7-response-output {
    margin: 0.25rem 0 0;
    padding: 0;
    border: 0 !important;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.45;
}

.tg-contact .wpcf7 .wpcf7-mail-sent-ok {
    color: #86efac;
}

.tg-contact .wpcf7 .wpcf7-mail-sent-ng,
.tg-contact .wpcf7 .wpcf7-spam-blocked {
    color: #fca5a5;
}

.tg-contact__map {
    overflow: hidden;
    margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
    border-radius: 28px;
    background: var(--tg-surface);
}

.tg-contact__map iframe {
    display: block;
    width: 100%;
    height: clamp(16rem, 38vw, 22rem);
    border: 0;
}

/* =========================================================
   Breakpointy 1450 / 1201 / 1024 / 768 / 375
   ========================================================= */

@media (max-width: 1200px) {
    .tg-contact__title {
        font-size: clamp(2rem, 3.8vw, 2.9rem);
    }

    .tg-contact__layout {
        grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
    }
}

@media (max-width: 1023px) {
    .tg-contact {
        padding-block: clamp(2.65rem, 6vh, 4.25rem);
    }

    .tg-contact__layout {
        display: flex;
        flex-direction: column;
        gap: 1.1rem;
        padding: 0;
        overflow: visible;
        background: transparent;
        border-radius: 0;
    }

    .tg-contact__stage {
        display: block;
        position: relative;
        overflow: hidden;
        border-radius: 22px;
        background-color: #101010;
    }

    .tg-contact__copy {
        gap: 1.75rem;
        min-height: 0;
        padding: 1.35rem;
    }

    .tg-contact__card {
        min-height: 0;
        box-shadow: none;
    }

    .tg-contact__form,
    .tg-contact__form .wpcf7,
    .tg-contact__form .wpcf7 form,
    .tg-contact .cf7-board {
        flex: none;
        min-height: auto;
    }

    .tg-contact .cf7-field--msg,
    .tg-contact .cf7-field--msg .wpcf7-form-control-wrap {
        flex: none;
        min-height: 0;
    }

    .tg-contact .wpcf7 textarea {
        flex: none;
        min-height: 4.5rem;
        max-height: 12rem;
    }

    .tg-contact__card,
    .tg-contact__map {
        border-radius: 22px;
    }

    .tg-contact__photo {
        object-position: 50% 60%;
    }
}

@media (max-width: 767px) {
    .tg-contact {
        padding-block: clamp(2.15rem, 5vh, 3.25rem);
    }

    .tg-contact__stage,
    .tg-contact__card,
    .tg-contact__map {
        border-radius: 16px;
    }

    .tg-contact__layout {
        gap: 0.95rem;
    }

    .tg-contact__copy {
        padding: 1.1rem;
    }

    .tg-contact__title {
        font-size: 1.85rem;
    }

    .tg-contact__lead {
        font-size: 1rem;
    }

    .tg-contact .cf7-board__row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 479px) {
    .tg-contact__title {
        font-size: 1.7rem;
    }

    .tg-contact__card {
        padding: 1.15rem;
    }

    .tg-contact .wpcf7-radio .wpcf7-list-item label {
        min-height: 2.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-contact__layout,
    .tg-contact.is-in .tg-contact__layout {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
