/* ── Maverick CTA Popup ────────────────────────────────────────────────── */

/* Floating trigger button */
.mcta-trigger {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 14px 16px;
    background: #489046;
    color: #fff;
    border: none;
    border-radius: 12px 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: -3px 4px 18px rgba(72, 144, 70, .35);
    transition: padding-right .2s, box-shadow .2s, background .2s;
    font-family: inherit;
    white-space: nowrap;
}
.mcta-trigger:hover {
    background: #3a7a38;
    padding-right: 26px;
    box-shadow: -4px 6px 22px rgba(72, 144, 70, .45);
}
.mcta-trigger__pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #ff4d4d;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: mcta-pulse 2s infinite;
}
@keyframes mcta-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,77,77,.6); }
    70%  { box-shadow: 0 0 0 8px rgba(255,77,77,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,77,77,0); }
}

/* Overlay */
.mcta-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
}
.mcta-overlay.is-open {
    pointer-events: all;
    opacity: 1;
}
.mcta-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 40, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Modal card */
.mcta-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    padding: 36px 36px 28px;
    transform: translateY(24px) scale(.97);
    transition: transform .28s cubic-bezier(.22,1,.36,1);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.mcta-overlay.is-open .mcta-modal {
    transform: translateY(0) scale(1);
}

/* Close button */
.mcta-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    transition: background .15s, color .15s;
    padding: 0;
    flex-shrink: 0;
}
.mcta-close:hover { background: #e2e5e9; color: #111; }

/* Header */
.mcta-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.mcta-modal__icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #489046 0%, #3a7a38 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(72,144,70,.3);
}
.mcta-modal__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #111;
    line-height: 1.2;
}
.mcta-modal__subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Form layout */
.mcta-form { display: flex; flex-direction: column; gap: 14px; }

.mcta-row { display: grid; gap: 14px; }
.mcta-row--2 { grid-template-columns: 1fr 1fr; }

.mcta-field { display: flex; flex-direction: column; gap: 5px; }

.mcta-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.mcta-field label abbr {
    color: #e53e3e;
    text-decoration: none;
    margin-left: 2px;
}
.mcta-field input,
.mcta-select-wrap select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 13px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.mcta-field input:focus,
.mcta-select-wrap select:focus {
    border-color: #489046;
    box-shadow: 0 0 0 3px rgba(72,144,70,.12);
}
.mcta-field input.is-invalid,
.mcta-select-wrap select.is-invalid {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229,62,62,.1);
}
.mcta-field input::placeholder { color: #9ca3af; }

/* Select wrapper */
.mcta-select-wrap { position: relative; }
.mcta-select-wrap__arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
}

/* Error */
.mcta-error {
    font-size: 13px;
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    padding: 10px 13px;
    display: none;
}
.mcta-error.is-visible { display: block; }

/* Submit button */
.mcta-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #489046 0%, #3a7a38 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    font-family: inherit;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(72,144,70,.3);
}
.mcta-submit:hover { opacity: .92; }
.mcta-submit:active { transform: scale(.99); }
.mcta-submit:disabled { background: #9ca3af; box-shadow: none; cursor: not-allowed; }
.mcta-submit--outline {
    background: transparent;
    border: 2px solid #489046;
    color: #489046;
    box-shadow: none;
}
.mcta-submit--outline:hover { background: #f0faf0; opacity: 1; }

/* Privacy note */
.mcta-privacy {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin: 4px 0 0;
}

/* Success view */
.mcta-success[hidden] { display: none !important; }
.mcta-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 0 8px;
    gap: 12px;
}
.mcta-success__icon {
    width: 80px;
    height: 80px;
    background: #f0faf0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #489046;
}
.mcta-success h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #111;
}
.mcta-success p {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
    max-width: 340px;
}

/* ── Mobile (Samsung A35 target: ~360×780 CSS px) ── */
@media (max-width: 540px) {

    /* Trigger: middle-right, icon-only circle with small gap */
    .mcta-trigger {
        top: 50%;
        bottom: auto;
        right: 8px;
        transform: translateY(-50%);
        border-radius: 50%;
        padding: 0;
        width: 48px;
        height: 48px;
        justify-content: center;
    }
    .mcta-trigger__label { display: none; }
    .mcta-trigger:hover  { padding-right: 0; }

    /* Overlay anchored to bottom */
    .mcta-overlay {
        align-items: flex-end;
        justify-content: stretch;
    }

    /* Bottom sheet — no scroll, fits viewport */
    .mcta-modal {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 20px 20px 0 0;
        padding: 0;
        max-height: 96vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transform: translateY(100%);
        transition: transform .32s cubic-bezier(.22,1,.36,1);
    }
    .mcta-overlay.is-open .mcta-modal { transform: translateY(0); }

    /* Drag handle */
    .mcta-modal::before {
        content: '';
        display: block;
        flex-shrink: 0;
        width: 32px;
        height: 4px;
        background: #d1d5db;
        border-radius: 2px;
        margin: 10px auto 0;
    }

    /* Close button */
    .mcta-close { position: absolute; top: 6px; right: 12px; }

    /* Form view — no scroll */
    #mcta-form-view {
        padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
        flex: 1;
    }

    /* Compact header */
    .mcta-modal__header {
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        padding-right: 34px;
    }
    .mcta-modal__icon {
        width: 34px; height: 34px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    .mcta-modal__icon svg { width: 17px; height: 17px; }
    .mcta-modal__title    { font-size: 15px; margin-bottom: 2px; }
    .mcta-modal__subtitle { font-size: 11px; }

    /* Form: tighter gaps, keep 2-col rows to save vertical space */
    .mcta-form    { gap: 7px; }
    .mcta-row     { gap: 8px; }
    .mcta-row--2  { grid-template-columns: 1fr 1fr; } /* keep 2 columns */

    .mcta-field      { gap: 0; }

    /* Hide labels — placeholders carry the context */
    .mcta-field label { display: none; }

    /* 16px prevents iOS auto-zoom; compact padding */
    .mcta-field input,
    .mcta-select-wrap select {
        font-size: 16px;
        padding: 9px 11px;
        border-radius: 7px;
    }

    .mcta-error   { font-size: 12px; padding: 7px 10px; }

    .mcta-submit  {
        padding: 11px;
        font-size: 14px;
        margin-top: 4px;
        border-radius: 8px;
        box-shadow: none;
    }
    .mcta-privacy { font-size: 10px; margin-top: 4px; }

    /* Success view */
    #mcta-success-view {
        padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
        flex: 1;
    }
    .mcta-success       { gap: 10px; padding: 4px 0; }
    .mcta-success__icon { width: 56px; height: 56px; }
    .mcta-success__icon svg { width: 28px; height: 28px; }
    .mcta-success h3    { font-size: 18px; }
    .mcta-success p     { font-size: 13px; }
}
