﻿
/* ===== CONTACT DIALOG ===== */

#contact-dialog {
    width: min(560px, calc(100vw - 32px));
    max-width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    margin: auto;
    padding: 0;
    border: 1px solid #e8ebef;
    border-radius: 14px;
    background: #fff;
    color: var(--ink, #20242b);
    box-shadow: 0 24px 75px rgba(0, 0, 0, 0.18);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

    #contact-dialog *,
    #contact-dialog *::before,
    #contact-dialog *::after {
        box-sizing: border-box;
    }

    #contact-dialog::backdrop {
        background: rgba(15, 23, 42, 0.58);
        backdrop-filter: blur(4px);
    }

    /* ===== HEADER ===== */

    #contact-dialog .dialog-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 23px 28px;
        border-bottom: 1px solid #edf0f3;
    }

    #contact-dialog #contact-title {
        margin: 0;
        font-size: 22px;
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: -0.5px;
        color: var(--ink, #20242b);
    }

    #contact-dialog .dialog-close {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 1px solid #e6e9ed;
        border-radius: 8px;
        background: #f8f9fb;
        color: #64748b;
        font-size: 24px;
        font-weight: 400;
        line-height: 1;
        cursor: pointer;
        transition: background .2s, color .2s, border-color .2s;
    }

        #contact-dialog .dialog-close:hover {
            background: #f1f3f6;
            border-color: #cbd5e1;
            color: #111827;
        }

    /* ===== FORM LAYOUT ===== */

    #contact-dialog .contact-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 28px;
    }

        #contact-dialog .contact-form > label {
            display: flex;
            flex-direction: column;
            gap: 9px;
            min-width: 0;
            margin: 0;
            color: #344054;
            font-size: 13px;
            font-weight: 600;
            line-height: 1.5;
            margin:5px 0;
        }

        /* ===== FORM FIELDS ===== */

        #contact-dialog .contact-form input:not([type="submit"]),
        #contact-dialog .contact-form textarea {
            display: block;
            width: 100%;
            min-width: 0;
            margin: 0;
            padding: 12px 14px;
            border: 1px solid #dce1e7;
            border-radius: 8px;
            outline: none;
            background: #fff;
            color: #1f2937;
            font-family: inherit;
            font-size: 14px;
            font-weight: 400;
            line-height: 1.5;
            transition: border-color .2s, box-shadow .2s;
        }

        #contact-dialog .contact-form input:not([type="submit"]) {
            height: 46px;
        }

        #contact-dialog .contact-form textarea {
            min-height: 130px;
            resize: vertical;
        }

            #contact-dialog .contact-form input:hover,
            #contact-dialog .contact-form textarea:hover {
                border-color: #aab4c2;
            }

            #contact-dialog .contact-form input:focus,
            #contact-dialog .contact-form textarea:focus {
                border-color: #475569;
                box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.12);
            }

    /* ===== NOTE ===== */

    #contact-dialog .form-note {
        margin: -2px 0 0;
        color: var(--muted, #778292);
        font-size: 12px;
        font-weight: 400;
        line-height: 1.7;
    }

    /* ===== SUBMIT BUTTON ===== */

    #contact-dialog .contact-form input[type="submit"],
    #contact-dialog .contact-form .button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 48px;
        margin: 2px 0 0;
        padding: 12px 20px;
        border: 1px solid #1e293b;
        border-radius: 8px;
        background: #1e293b;
        color: #fff;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
        text-align: center;
        cursor: pointer;
        transition: background .2s, transform .2s, box-shadow .2s;
    }

        #contact-dialog .contact-form input[type="submit"]:hover,
        #contact-dialog .contact-form .button:hover {
            background: #334155;
            box-shadow: 0 5px 15px rgba(30, 41, 59, 0.16);
        }

        #contact-dialog .contact-form input[type="submit"]:active {
            transform: translateY(1px);
        }

        #contact-dialog .contact-form input[type="submit"]:focus-visible,
        #contact-dialog .dialog-close:focus-visible {
            outline: 3px solid rgba(71, 85, 105, 0.35);
            outline-offset: 3px;
        }

    /* ===== SUCCESS MESSAGE ===== */

    #contact-dialog > div:not(.dialog-head):not(.contact-form) {
        padding: 24px 28px;
        line-height: 1.7;
    }

/* ===== MOBILE ===== */

@media (max-width: 480px) {
    #contact-dialog {
        width: calc(100vw - 24px);
        border-radius: 12px;
    }

        #contact-dialog .dialog-head {
            padding: 20px;
        }

        #contact-dialog #contact-title {
            font-size: 19px;
        }

        #contact-dialog .contact-form {
            gap: 17px;
            padding: 22px 20px;
        }
}
.contact-form.contact-form-after{
    text-align:center;
}
#contact-dialog .field-error {
    display: block;
    color: #dc2626;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    margin-top: 2px;
    font-size:0;
    line-height:0;
    margin:0;
    padding:0;
}
/*Jeżeli po labelce występuje element z klaską field-error i jest display:inline to zaznacz poprzedzajacy label na czerwono */
#contact-dialog .contact-form > label:has(+.field-error[style*="display: inline"]) {
    color:red
}
    #contact-dialog .contact-form > label:has(+.field-error[style*="display: inline"]) input,
    #contact-dialog .contact-form > label:has(+.field-error[style*="display: inline"]) textarea {
        border-color: red;
        background-color: #ffe3e3;
    }
    