/**
 * Popup / shortcode form styles.
 * Classes are all prefixed .eb-acq-* for easy Elementor overrides.
 *
 * @package EB_Acq_Survey
 */

/* ---- Wrap ---- */
.eb-acq-survey-form-wrap {
    max-width: 480px;
    margin: 0 auto;
    font-family: inherit;
    position: relative;
    /* contain the honeypot absolute positioning */
    box-sizing: border-box;
}

/* ---- Elementor popup compatibility ---- */
.elementor-popup-modal .eb-acq-survey-form-wrap {
    max-width: 100%;
    /* let Elementor control the popup width */
    width: 100%;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
    padding-top: 18px;
    padding-right: 18px;
}

.elementor-popup-modal .dialog-close-button,
.elementor-popup-modal .elementor-popup-modal__close,
.elementor-popup-modal .dialog-lightbox-close-button {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    cursor: pointer !important;
}

.elementor-popup-modal .dialog-widget-content,
.elementor-popup-modal .dialog-message {
    overflow: visible;
}

.elementor-popup-modal .dialog-close-button i,
.elementor-popup-modal .elementor-popup-modal__close i,
.elementor-popup-modal .dialog-lightbox-close-button i,
.elementor-popup-modal .dialog-close-button svg,
.elementor-popup-modal .elementor-popup-modal__close svg,
.elementor-popup-modal .dialog-lightbox-close-button svg {
    pointer-events: none !important;
}

.elementor-popup-modal .dialog-widget-content {
    position: relative;
    z-index: 1;
}

.elementor-popup-modal .dialog-message > *:not(.dialog-close-button):not(.elementor-popup-modal__close):not(.dialog-lightbox-close-button) {
    position: relative;
    z-index: 1;
}


.eb-acq-survey-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}


/* ---- Title / description ---- */
.eb-acq-survey-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    position: relative;
    z-index: 1;
    padding-right: 88px;
}

.eb-acq-survey-desc {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: #555;
}

/* ---- Fields ---- */
.eb-acq-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.eb-acq-field label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.eb-acq-field label .required {
    color: #e15759;
}

.eb-acq-field select,
.eb-acq-field input[type="text"] {
    padding: 10px 12px;
    font-size: 0.95rem;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    background: #fff;
    transition: border-color 0.2s;
}

.eb-acq-field select:focus,
.eb-acq-field input[type="text"]:focus {
    border-color: #4e79a7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(78, 121, 167, 0.15);
}

/* ---- Postcode split-digit boxes ---- */
.eb-acq-postcode-field {
    --eb-green: #2e6e3f;
    --eb-gold: #f4c64d;
}

.eb-acq-digit-boxes,
.elementor-popup-modal .eb-acq-digit-boxes,
.elementor-widget-shortcode .eb-acq-digit-boxes,
.elementor-widget-container .eb-acq-digit-boxes {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: auto !important;
}

/* Override generic .eb-acq-field input[type="text"] + Elementor input styles */
.eb-acq-postcode-field .eb-acq-digit-boxes input[type="text"].eb-acq-digit,
.eb-acq-digit-boxes .eb-acq-digit,
.elementor-popup-modal .eb-acq-digit-boxes input[type="text"].eb-acq-digit,
.elementor-widget-shortcode .eb-acq-digit-boxes input[type="text"].eb-acq-digit,
.elementor-widget-container .eb-acq-digit-boxes input[type="text"].eb-acq-digit,
.elementor-element .eb-acq-digit-boxes input[type="text"].eb-acq-digit {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 56px !important;
    flex: 0 0 48px !important;
    display: inline-block !important;
    border: 2px solid #d0d0d0 !important;
    border-radius: 10px !important;
    background: #fff !important;
    text-align: center !important;
    text-indent: 0 !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 52px !important;
    color: #222 !important;
    caret-color: var(--eb-green);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    outline: none !important;
    padding: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    -moz-appearance: textfield;
    appearance: textfield;
    box-sizing: border-box !important;
    float: none !important;
}

/* Remove spinner arrows */
.eb-acq-digit::-webkit-outer-spin-button,
.eb-acq-digit::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Focus state — Econobûches green */
.eb-acq-digit-boxes .eb-acq-digit:focus {
    border-color: var(--eb-green) !important;
    box-shadow: 0 0 0 3px rgba(46, 110, 63, 0.15) !important;
    transform: scale(1.05);
}

/* Filled state — subtle gold accent */
.eb-acq-digit-boxes .eb-acq-digit.is-filled {
    border-color: var(--eb-green) !important;
    background: rgba(244, 198, 77, 0.08) !important;
}

/* All filled — glow effect */
.eb-acq-digit-boxes.is-complete .eb-acq-digit {
    border-color: var(--eb-green) !important;
    box-shadow: 0 0 0 2px rgba(46, 110, 63, 0.10) !important;
}

/* Error shake */
@keyframes eb-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

.eb-acq-digit-boxes.has-error .eb-acq-digit {
    border-color: #e15759 !important;
    animation: eb-shake 0.4s ease;
}

/* Responsive — slightly smaller on mobile */
@media (max-width: 480px) {

    .eb-acq-postcode-field .eb-acq-digit-boxes input[type="text"].eb-acq-digit,
    .eb-acq-digit-boxes .eb-acq-digit {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 50px !important;
        flex: 0 0 42px !important;
        font-size: 1.2rem !important;
    }

    .eb-acq-digit-boxes {
        gap: 8px !important;
    }
}


/* ---- Consent ---- */
.eb-acq-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
}

.eb-acq-consent input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

/* ---- Submit ---- */
.eb-acq-submit {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #4e79a7;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.eb-acq-submit:hover {
    background: #3d6591;
}

.eb-acq-submit:active {
    transform: scale(0.98);
}

.eb-acq-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ---- Message ---- */
.eb-acq-message {
    padding: 10px 14px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.eb-acq-msg-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.eb-acq-msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ---- Honeypot ---- */
.eb-acq-hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .eb-acq-survey-form-wrap {
        padding: 0 8px;
    }
}

/* ---- Native modal (independent from Elementor Pro) ---- */
.eb-acq-native-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
}

.eb-acq-native-backdrop {
    display: none;
}

.eb-acq-native-dialog {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: min(440px, calc(100vw - 24px));
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    padding: 18px 18px 16px;
    z-index: 2;
    pointer-events: auto;
    overflow: visible;
}

.eb-acq-native-dialog .eb-acq-survey-form-wrap {
    position: relative;
    z-index: 1;
    padding-top: 40px;
    padding-right: 0;
}

.eb-acq-native-dialog .eb-acq-survey-form {
    position: relative;
    z-index: 1;
}

.eb-acq-native-close {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 88px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 0;
    background: #efc13a;
    color: #111;
    font-size: 15px;
    font-family: inherit;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 1000 !important;
    pointer-events: auto;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    transform: none;
    overflow: hidden;
}

.eb-acq-native-close:hover,
.eb-acq-native-close:focus {
    background: #e2861d;
    outline: none;
}

@media (max-width: 767px) {
    .eb-acq-native-dialog {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
        padding: 14px 12px;
    }
}
