/* Contact Josephs form. Keep this file readable for future visual adjustments. */
.jcf-contact {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.jcf-contact .ui.form {
    margin-top: 1.5rem;
}

.jcf-contact textarea {
    line-height: 1.45;
    resize: vertical;
}

/* Full-page progress feedback while the initial contact form is submitted. */
.jcf-submit-overlay {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(2px);
}

.jcf-submit-overlay[hidden] {
    display: none !important;
}

.jcf-submit-dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 24rem);
    padding: 1.6rem 1.4rem;
    border: 1px solid #b9ddec;
    border-radius: .5rem;
    background: #fff;
    box-shadow: 0 .5rem 2rem rgba(0, 0, 0, .14);
    color: rgba(0, 0, 0, .87);
    text-align: center;
}

.jcf-submit-dialog strong {
    margin-top: 1rem;
    font-size: 1.1rem;
}

.jcf-submit-dialog span:last-child {
    margin-top: .4rem;
    color: #767676;
    line-height: 1.4;
}

.jcf-submit-spinner {
    width: 2.75rem;
    height: 2.75rem;
    border: .28rem solid #d9eef7;
    border-top-color: #00a2ff;
    border-radius: 50%;
    animation: jcf-submit-spin .8s linear infinite;
}

.jcf-is-submitting {
    overflow: hidden;
}

@keyframes jcf-submit-spin {
    to { transform: rotate(360deg); }
}

/* Conversation shown only after the original contact form is saved. */
.jcf-conversation,
.jcf-conversation * {
    box-sizing: border-box;
}

.jcf-saved.ui.message {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 1rem 0 1.75rem;
    padding: 1rem 1.15rem;
    border: 1px solid #a3d5b0;
    box-shadow: none;
}

.jcf-saved.ui.message .icon {
    margin: 0;
}

.jcf-messages {
    width: 100%;
}

.jcf-message {
    width: fit-content;
    max-width: 92%;
    margin: 0 0 .85rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(34, 36, 38, .1);
    border-radius: .285714rem;
    background: #f3f4f5;
    line-height: 1.48;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.jcf-message-user {
    max-width: 86%;
    margin-left: auto;
    border-color: transparent;
    background: #00a2ff;
    color: #fff;
}

/* Animate only messages added during the live conversation. */
.jcf-message-enter.jcf-message-user {
    animation: jcf-message-from-right .38s ease-out both;
}

.jcf-message-enter.jcf-message-assistant {
    animation: jcf-message-from-left .42s ease-out both;
}

.jcf-action-enter {
    animation: jcf-action-appear .32s .12s ease-out both;
}

@keyframes jcf-message-from-right {
    from {
        opacity: 0;
        transform: translate3d(1.25rem, .3rem, 0) scale(.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes jcf-message-from-left {
    from {
        opacity: 0;
        transform: translate3d(-1.25rem, .3rem, 0) scale(.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes jcf-action-appear {
    from {
        opacity: 0;
        transform: translateY(.35rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jcf-action {
    margin: -.4rem 0 .9rem .9rem;
}

.jcf-action a {
    color: #008bd6;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.jcf-chat-form.ui.form {
    margin-top: 1rem;
}

.jcf-compose {
    display: flex;
    align-items: stretch;
    gap: .5rem;
}

.jcf-chat-form.ui.form .jcf-compose textarea {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 3.4rem;
    max-height: 9rem;
    padding: .75rem;
    font-size: 16px;
    resize: none;
    overflow-y: auto;
}

.jcf-send.ui.button {
    flex: 0 0 auto;
    min-width: 5rem;
    margin: 0;
}

.jcf-chat-status {
    min-height: 1.35rem;
    margin: .25rem 0 .55rem;
    color: #767676;
    font-size: .82rem;
}

.jcf-chat-status-error {
    color: #9f3a38;
}

.jcf-optional {
    color: #767676;
    font-weight: normal;
}

/* Semantic UI field rules must not override the conditional hidden state. */
.jcf-property-address-field[hidden] {
    display: none !important;
}

/* The honeypot remains available to browsers but outside the visible layout. */
.jcf-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

@media only screen and (max-width: 767px) {
    .jcf-contact {
        padding-top: .5rem;
    }

    .jcf-contact .ui.form .two.fields {
        display: block;
    }

    .jcf-message {
        max-width: 96%;
    }
}

@media only screen and (max-width: 360px) {
    .jcf-compose {
        flex-wrap: wrap;
    }

    .jcf-send.ui.button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jcf-submit-spinner {
        animation-duration: 1.8s;
    }

    .jcf-message-enter,
    .jcf-action-enter {
        animation: none !important;
    }
}
