/* ==========================================================
   RP CONTACT FORM
   ========================================================== */

.rp-contact-form {
    background: var(--rp-color-white);
    padding: 0 0 88px;
}

.rp-contact-form__form {
    width: min(100% - 40px, 760px);
    margin-inline: auto;
    display: grid;
    gap: 22px;
}

.rp-contact-form__field {
    display: grid;
    gap: 9px;
}

.rp-contact-form__label {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--rp-color-text);
}

.rp-contact-form__label span {
    color: var(--rp-color-primary);
}

.rp-contact-form__input,
.rp-contact-form__textarea {
    width: 100%;
    border: 1px solid #d7e0e6;
    border-radius: 8px;
    background: var(--rp-color-white);
    color: var(--rp-color-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

.rp-contact-form__input {
    min-height: 54px;
    padding: 13px 16px;
}

.rp-contact-form__textarea {
    min-height: 180px;
    padding: 15px 16px;
    resize: vertical;
}

.rp-contact-form__input:hover,
.rp-contact-form__textarea:hover {
    border-color: #aebdc7;
}

.rp-contact-form__input:focus,
.rp-contact-form__textarea:focus {
    border-color: var(--rp-color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 145, 82, 0.12);
}

.rp-contact-form__input::placeholder,
.rp-contact-form__textarea::placeholder {
    color: #8b98a1;
    opacity: 1;
}


/* ==========================================================
   FILE UPLOAD
   ========================================================== */

.rp-contact-form__field--files {
    gap: 8px;
}

.rp-contact-form__hint {
    margin: -2px 0 3px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--rp-color-text-muted);
}

.rp-contact-form__dropzone {
    display: flex;
    min-height: 184px;
    padding: 28px 24px;
    border: 1px dashed #b7c4cd;
    border-radius: 8px;
    background: #f8faf9;
    color: var(--rp-color-text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.rp-contact-form__dropzone:hover {
    border-color: var(--rp-color-primary);
    background: #f4faf6;
}

.rp-contact-form__dropzone:focus-within {
    border-color: var(--rp-color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 145, 82, 0.12);
}

.rp-contact-form__field--drag-active
.rp-contact-form__dropzone {
    border-color: var(--rp-color-primary);
    background: #edf8f1;
    box-shadow: 0 0 0 3px rgba(39, 145, 82, 0.1);
}

.rp-contact-form__dropzone-icon {
    display: inline-flex;
    width: 46px;
    height: 46px;
    margin-bottom: 13px;
    border: 1px solid #c9ded1;
    border-radius: 50%;
    background: var(--rp-color-white);
    color: var(--rp-color-primary);
    align-items: center;
    justify-content: center;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background-color 160ms ease;
}

.rp-contact-form__dropzone:hover
.rp-contact-form__dropzone-icon {
    border-color: #add1bb;
}

.rp-contact-form__field--drag-active
.rp-contact-form__dropzone-icon {
    border-color: var(--rp-color-primary);
    background: #f7fcf9;
    transform: scale(1.08);
}

.rp-contact-form__dropzone-title {
    display: block;
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--rp-color-text);
}

.rp-contact-form__dropzone-text {
    display: block;
    font-size: 15px;
    line-height: 1.5;
    color: var(--rp-color-primary);
}

.rp-contact-form__dropzone-note {
    display: block;
    max-width: 560px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--rp-color-text-muted);
}

.rp-contact-form__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}


/* ==========================================================
   SELECTED FILES
   ========================================================== */

.rp-contact-form__file-list {
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.rp-contact-form__file-list:empty {
    display: none;
}

.rp-contact-form__file-item {
    display: grid;
    min-height: 58px;
    padding: 9px 10px 9px 11px;
    border: 1px solid #dfe6ea;
    border-radius: 8px;
    background: #f8faf9;
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;
    animation: rp-contact-file-in 180ms ease both;
}

.rp-contact-form__file-type {
    display: inline-flex;
    width: 42px;
    min-height: 32px;
    padding: 5px 6px;
    border: 1px solid #c9ded1;
    border-radius: 6px;
    background: var(--rp-color-white);
    color: var(--rp-color-primary);
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.03em;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.rp-contact-form__file-info {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.rp-contact-form__file-name {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--rp-color-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rp-contact-form__file-size {
    font-size: 12px;
    line-height: 1.4;
    color: var(--rp-color-text-muted);
}

.rp-contact-form__file-remove {
    display: inline-flex;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--rp-color-text-muted);
    font: inherit;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.rp-contact-form__file-remove:hover,
.rp-contact-form__file-remove:focus-visible {
    background: #eaf0ed;
    color: var(--rp-color-text);
    outline: none;
}

@keyframes rp-contact-file-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================
   STATUS
   ========================================================== */

.rp-contact-form__status {
    display: none;
    margin: 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.55;
}

.rp-contact-form__status:not(:empty) {
    display: block;
    animation: rp-contact-status-in 180ms ease both;
}

.rp-contact-form__status--success {
    border: 1px solid #b9d9c5;
    background: #f0f8f3;
    color: #245f3a;
}

.rp-contact-form__status--error {
    border: 1px solid #e4c4c4;
    background: #fff5f5;
    color: #8a2f2f;
}

@keyframes rp-contact-status-in {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================
   SUBMIT BUTTON
   ========================================================== */

.rp-contact-form__submit {
    min-width: 230px;
    margin-top: 2px;
    justify-self: start;
}

.rp-contact-form__submit:disabled {
    cursor: wait;
}

.rp-contact-form__submit--success,
.rp-contact-form__submit--success:hover,
.rp-contact-form__submit--success:disabled {
    border-color: #237d48;
    background: #237d48;
    color: var(--rp-color-white);
    cursor: default;
    opacity: 1;
    transform: none;
}


/* ==========================================================
   PRIVACY
   ========================================================== */

.rp-contact-form__privacy {
    margin: -7px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--rp-color-text-muted);
}

.rp-contact-form__privacy a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.rp-contact-form__privacy a:hover {
    color: var(--rp-color-primary);
}


/* ==========================================================
   HONEYPOT
   ========================================================== */

.rp-contact-form__honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}


/* ==========================================================
   REDUCED MOTION
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .rp-contact-form__input,
    .rp-contact-form__textarea,
    .rp-contact-form__dropzone,
    .rp-contact-form__dropzone-icon,
    .rp-contact-form__file-remove {
        transition: none;
    }

    .rp-contact-form__file-item,
    .rp-contact-form__status:not(:empty) {
        animation: none;
    }
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 767px) {
    .rp-contact-form {
        padding: 0 0 72px;
    }

    .rp-contact-form__form {
        width: min(100% - 32px, 760px);
        gap: 20px;
    }

    .rp-contact-form__input {
        min-height: 52px;
    }

    .rp-contact-form__textarea {
        min-height: 160px;
    }

    .rp-contact-form__dropzone {
        min-height: 168px;
        padding: 24px 18px;
    }

    .rp-contact-form__dropzone-title {
        font-size: 16px;
    }

    .rp-contact-form__dropzone-note {
        font-size: 12px;
    }

    .rp-contact-form__file-item {
        grid-template-columns: 38px minmax(0, 1fr) 34px;
        gap: 10px;
    }

    .rp-contact-form__file-type {
        width: 38px;
        min-height: 30px;
        font-size: 10px;
    }

    .rp-contact-form__submit {
        width: 100%;
        min-width: 0;
    }

    .rp-contact-form__privacy {
        margin-top: -5px;
    }
}