:root {
    --whatsapp-green: #25d366;
    --popup-bg: #111318;
    --popup-header-bg: #ff1628;
    --popup-close-bg: #a40d19;
    --popup-close-hover-bg: #86101a;
    --popup-text: #ffffff;
    --popup-border: #d7dbe2;
    --popup-input-bg: #ffffff;
}

#ark-whatsapp-popup,
#ark-whatsapp-popup input,
#ark-whatsapp-popup select,
#ark-whatsapp-popup button {
    font-family: inherit;
}

#ark-contact-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    outline: none;
    background: var(--whatsapp-green);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 250ms ease,
        transform 250ms ease,
        visibility 250ms ease,
        box-shadow 200ms ease;
}

#ark-contact-launcher.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

#ark-contact-launcher:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .27);
}

#ark-contact-launcher:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px #ff1628, 0 7px 20px rgba(0, 0, 0, .24);
}

#ark-contact-launcher img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

.ark-contact-tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    padding: 10px 14px;
    border-radius: 999px;
    background: #ffffff;
    color: #30343b;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(6px, -50%);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
}

.ark-contact-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -5px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    transform: translateY(-50%) rotate(45deg);
}

#ark-contact-launcher:hover .ark-contact-tooltip,
#ark-contact-launcher:focus-visible .ark-contact-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

body.ark-wa-popup-open #ark-contact-launcher {
    display: none !important;
}

body.ark-form-input-active #ark-contact-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#ark-whatsapp-popup {
    position: fixed;
    right: 20px;
    bottom: 86px;
    z-index: 9999;
    display: none;
    width: min(440px, calc(100vw - 24px));
}

.ark-popup-content {
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 18px;
    background: var(--popup-bg);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .34);
}

.ark-popup-header {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px 12px 22px;
    background: var(--popup-header-bg);
}

.ark-popup-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.ark-popup-close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--popup-close-bg);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 200ms ease;
}

.ark-popup-close:hover {
    background: var(--popup-close-hover-bg);
}

.ark-popup-close:focus-visible,
#ark-whatsapp-form input:focus-visible,
#ark-whatsapp-form select:focus-visible,
#ark-wa-submit:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

#ark-whatsapp-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    background: var(--popup-bg);
}

.ark-wa-field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.ark-wa-field > span {
    color: var(--popup-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.ark-wa-phone-row {
    display: grid;
    grid-template-columns: minmax(108px, .82fr) minmax(0, 1.45fr);
    gap: 12px;
}

.ark-wa-phone-row .ark-wa-field > span {
    min-height: 24px;
    display: flex;
    align-items: flex-start;
    white-space: nowrap;
}

.ark-wa-phone-row select,
.ark-wa-phone-row input {
    height: 62px;
}

#ark-whatsapp-form input,
#ark-whatsapp-form select {
    width: 100%;
    min-height: 50px;
    padding: 11px 12px;
    border: 1px solid var(--popup-border);
    border-radius: 9px;
    background: var(--popup-input-bg);
    color: #151820;
    font-size: 16px;
    line-height: 1.3;
}

#ark-whatsapp-form input::placeholder {
    color: #858b96;
    opacity: 1;
}

#ark-wa-submit {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 16px;
    border: none;
    border-radius: 9px;
    background: #ff1628;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 200ms ease, opacity 200ms ease;
}

#ark-wa-submit:hover {
    background: #dc0f20;
}

#ark-wa-submit span:last-child {
    font-size: 20px;
    line-height: 1;
}

.ark-form-message {
    min-height: 18px;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.35;
}

@media (max-width: 767px) {
    #ark-contact-launcher {
        position: fixed !important;
        inset: auto 16px calc(18px + env(safe-area-inset-bottom)) auto !important;
        width: 62px !important;
        height: 62px !important;
        display: flex;
        z-index: 9999 !important;
        margin: 0 !important;
        filter: none;
    }

    #ark-contact-launcher img {
        width: 52px;
        height: 52px;
    }

    #ark-whatsapp-popup {
        right: auto;
        left: 50%;
        bottom: calc(84px + env(safe-area-inset-bottom));
        width: min(440px, calc(100vw - 24px));
        transform: translateX(-50%);
    }

    .ark-popup-content {
        max-height: calc(100dvh - 108px - env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    #ark-whatsapp-form {
        padding: 20px;
    }
}

@media (hover: none) {
    .ark-contact-tooltip {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    #ark-contact-launcher,
    .ark-contact-tooltip,
    .ark-popup-close,
    #ark-wa-submit {
        transition: none;
    }
}

#ark-whatsapp-form .ark-wa-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--popup-text);
    font-size: 14px;
    line-height: 1.5;
}
#ark-whatsapp-form .ark-wa-acceptance input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: var(--whatsapp-green);
}
