/**
 * Floating Contact Pro frontend styles.
 * Copyright (C) 2026 Soulmapp. All rights reserved.
 */

html.fcp-dialog-open,
body.fcp-dialog-open {
    overflow: hidden;
}

.fcp-widget {
    position: fixed;
    z-index: 9999;
    right: var(--fcp-widget-offset, 1rem);
    bottom: calc(var(--fcp-widget-offset, 1rem) + env(safe-area-inset-bottom, 0));
    font-family: inherit;
}

.fcp-widget--left {
    right: auto;
    left: var(--fcp-widget-offset, 1rem);
}

.fcp-widget__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 3.25rem;
    min-height: 3.25rem;
    padding: var(--fcp-button-padding, 0.875rem 1rem);
    border: 0;
    border-radius: var(--fcp-button-radius, 999px);
    background: var(--fcp-button-bg, #1f2937);
    color: var(--fcp-button-color, #ffffff);
    box-shadow: var(--fcp-button-shadow, 0 0.75rem 1.75rem rgba(0, 0, 0, 0.22));
    cursor: pointer;
    touch-action: manipulation;
    font: inherit;
    font-size: var(--fcp-button-font-size, 1rem);
    font-weight: 700;
    line-height: 1;
}

.fcp-widget__button:hover,
.fcp-widget__button:focus-visible {
    background: var(--fcp-button-hover-bg, #111827);
}

.fcp-widget__button:focus-visible,
.fcp-panel__close:focus-visible,
.fcp-form__control:focus-visible,
.fcp-form__submit:focus-visible {
    outline: 0.1875rem solid currentColor;
    outline-offset: 0.1875rem;
}

.fcp-widget__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    line-height: 1;
}


.fcp-widget__label {
    display: inline-block;
    transform: translateY(var(--fcp-desktop-label-offset, -1px));
}

.fcp-widget__svg {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fcp-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(var(--fcp-panel-width, 24rem), calc(100vw - 2rem));
    max-height: min(46rem, calc(100vh - 2rem));
    max-height: min(46rem, calc(100dvh - 2rem));
    overflow: hidden;
    border-radius: var(--fcp-panel-radius, 1rem);
    background: var(--fcp-panel-bg, #ffffff);
    color: var(--fcp-panel-color, #111827);
    box-shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.fcp-widget--left .fcp-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.fcp-widget.is-open .fcp-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.fcp-widget.is-open .fcp-widget__button {
    display: none;
}

.fcp-panel__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--fcp-divider-color, #e5e7eb);
}

.fcp-panel__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
}

.fcp-panel__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    cursor: pointer;
    touch-action: manipulation;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
}

.fcp-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
    padding-bottom: 1.5rem;
    overflow-y: auto;
    scroll-padding-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.fcp-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.fcp-panel__footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex: 0 0 auto;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: var(--fcp-panel-bg, #ffffff);
    box-shadow: 0 -0.5rem 1rem rgba(255, 255, 255, 0.96);
}

.fcp-form__intro {
    margin: 0 0 1rem;
    color: #4b5563;
    line-height: 1.5;
}

.fcp-form__group {
    margin-bottom: 0.875rem;
}

.fcp-form__label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.fcp-form__control {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    box-sizing: border-box;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--fcp-field-border-color, #d1d5db);
    border-radius: var(--fcp-field-radius, 0.5rem);
    background: var(--fcp-field-bg, #ffffff);
    color: var(--fcp-panel-color, #111827);
    font: inherit;
    line-height: 1.4;
}

textarea.fcp-form__control {
    min-height: 7rem;
    resize: vertical;
}

.fcp-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: var(--fcp-submit-radius, 0.625rem);
    background: var(--fcp-submit-bg, #1f2937);
    color: var(--fcp-submit-color, #ffffff);
    cursor: pointer;
    touch-action: manipulation;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
}

.fcp-form__submit:hover,
.fcp-form__submit:focus-visible {
    background: var(--fcp-submit-hover-bg, #111827);
}

@media (max-width: 575.98px) {
    .fcp-widget__button {
        padding: var(--fcp-mobile-button-padding, 0.75rem 1.125rem);
        font-size: var(--fcp-mobile-button-font-size, 0.9375rem);
    }

    .fcp-widget {
        right: var(--fcp-mobile-offset, 0.75rem);
        left: auto;
        bottom: calc(var(--fcp-mobile-offset, 0.75rem) + env(safe-area-inset-bottom, 0));
    }

    .fcp-widget--left {
        right: auto;
        left: var(--fcp-mobile-offset, 0.75rem);
    }

    .fcp-widget__button {
        width: auto;
        max-width: calc(100vw - 1.5rem);
        min-height: 3.5rem;
        white-space: nowrap;
    }

    .fcp-widget__label {
        transform: none;
    }

    .fcp-panel,
    .fcp-widget--left .fcp-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: var(--fcp-panel-radius, 1rem) var(--fcp-panel-radius, 1rem) 0 0;
        transform: translateY(100%);
        transform-origin: bottom center;
    }

    .fcp-widget.is-open .fcp-panel,
    .fcp-widget--left.is-open .fcp-panel {
        transform: translateY(0);
    }

    .fcp-form {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }

    .fcp-panel__body {
        padding-bottom: 1.25rem;
    }

    .fcp-panel__footer {
        z-index: 20;
        padding-bottom: calc(var(--fcp-widget-offset, 1rem) + env(safe-area-inset-bottom, 0));
    }

    textarea.fcp-form__control {
        resize: none;
    }
}

.fcp-form__notice {
    margin: 1rem 1rem 0;
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.fcp-form__notice.is-success {
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #166534;
}

.fcp-form__notice.is-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.fcp-form.is-submitting .fcp-form__control {
    opacity: 0.75;
}

.fcp-form__submit:disabled {
    cursor: progress;
    opacity: 0.75;
}

.fcp-form__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.fcp-form__security {
    margin: 0.25rem 0 0;
    color: #6b7280;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.fcp-form__captcha {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    min-height: 4.875rem;
    overflow: visible;
}

.fcp-form--has-captcha .fcp-panel__body {
    padding-bottom: 1rem;
}


@media (prefers-reduced-motion: reduce) {
    .fcp-panel {
        transition: none;
    }
}

/* Display & Behaviour device rules */
@media (min-width: 1024px) {
    .fcp-widget--hide-desktop {
        display: none !important;
    }
}

@media (min-width: 576px) and (max-width: 1023.98px) {
    .fcp-widget--hide-tablet {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .fcp-widget--hide-mobile {
        display: none !important;
    }
}

/* Display & Behaviour animation variants */
.fcp-widget--animation-none .fcp-panel {
    transition: none;
    transform: none;
}

.fcp-widget--animation-none.is-open .fcp-panel {
    transform: none;
}

.fcp-widget--animation-fade .fcp-panel {
    transform: none;
}

.fcp-widget--animation-slide-left .fcp-panel {
    transform: translateX(0.75rem) scale(0.98);
}

.fcp-widget--left.fcp-widget--animation-slide-left .fcp-panel {
    transform: translateX(-0.75rem) scale(0.98);
}

.fcp-widget--animation-slide-right .fcp-panel {
    transform: translateX(-0.75rem) scale(0.98);
}

.fcp-widget--left.fcp-widget--animation-slide-right .fcp-panel {
    transform: translateX(0.75rem) scale(0.98);
}

.fcp-widget--animation-slide-left.is-open .fcp-panel,
.fcp-widget--animation-slide-right.is-open .fcp-panel,
.fcp-widget--left.fcp-widget--animation-slide-left.is-open .fcp-panel,
.fcp-widget--left.fcp-widget--animation-slide-right.is-open .fcp-panel {
    transform: translateX(0) scale(1);
}

@media (max-width: 575.98px) {
    .fcp-widget--animation-slide-left .fcp-panel,
    .fcp-widget--animation-slide-right .fcp-panel,
    .fcp-widget--left.fcp-widget--animation-slide-left .fcp-panel,
    .fcp-widget--left.fcp-widget--animation-slide-right .fcp-panel {
        transform: translateY(100%);
    }

    .fcp-widget--animation-slide-left.is-open .fcp-panel,
    .fcp-widget--animation-slide-right.is-open .fcp-panel,
    .fcp-widget--left.fcp-widget--animation-slide-left.is-open .fcp-panel,
    .fcp-widget--left.fcp-widget--animation-slide-right.is-open .fcp-panel {
        transform: translateY(0);
    }
}

.fcp-form__group--checkbox {
    margin-top: 0.75rem;
}

.fcp-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    color: var(--fcp-panel-text, #111827);
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

.fcp-form__checkbox {
    flex: 0 0 auto;
    width: 1rem;
    height: 1rem;
    margin-top: 0.12rem;
}

/* Strongly scoped field styling to protect the widget from template form resets. */
.fcp-widget .fcp-form .fcp-form__control,
.fcp-widget .fcp-form input.fcp-form__control,
.fcp-widget .fcp-form textarea.fcp-form__control {
    display: block !important;
    width: 100% !important;
    min-height: 2.75rem !important;
    box-sizing: border-box !important;
    padding: 0.625rem 0.75rem !important;
    border: 1px solid var(--fcp-field-border-color, #d1d5db) !important;
    border-radius: var(--fcp-field-radius, 0.5rem) !important;
    background: var(--fcp-field-bg, #ffffff) !important;
    color: var(--fcp-panel-color, #111827) !important;
    box-shadow: none !important;
    outline: 0;
    font: inherit !important;
    line-height: 1.4 !important;
    -webkit-appearance: none;
    appearance: none;
}

.fcp-widget .fcp-form textarea.fcp-form__control {
    min-height: 7rem !important;
    resize: vertical !important;
}

.fcp-widget .fcp-form .fcp-form__control:focus,
.fcp-widget .fcp-form input.fcp-form__control:focus,
.fcp-widget .fcp-form textarea.fcp-form__control:focus {
    border-color: var(--fcp-accent-color, #2563eb) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16) !important;
    outline: 0 !important;
}

.fcp-widget .fcp-form .fcp-form__control:disabled,
.fcp-widget .fcp-form input.fcp-form__control:disabled,
.fcp-widget .fcp-form textarea.fcp-form__control:disabled {
    background: #f9fafb !important;
    opacity: 1 !important;
    cursor: not-allowed !important;
}
