/* ============================================================
   Marta Widget - badge flottante globale + modal
   Colore principale: #e44c4c | gradiente 135deg #e44c4c -> #c0392b
   ============================================================ */

#marta-widget,
#marta-widget * {
    box-sizing: border-box;
}

#marta-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.marta-no-scroll {
    overflow: hidden;
}

/* ------------------------------------------------------------
   BADGE FLOTTANTE
   ------------------------------------------------------------ */
.marta-badge {
    position: fixed;
    bottom: 100px;
    right: 18px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    animation: marta-bounce 2.4s ease-in-out infinite;
}

.marta-badge:hover,
.marta-badge:focus {
    animation-play-state: paused;
    outline: none;
}

.marta-badge-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 4px solid #e44c4c;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
    animation: marta-glow 1.8s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease;
}

.marta-badge:hover .marta-badge-circle {
    transform: scale(1.06);
}

.marta-badge-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.marta-badge-placeholder {
    font-size: 34px;
    font-weight: 800;
    color: #e44c4c;
}

.marta-badge-pill {
    margin-top: -6px;
    background: linear-gradient(135deg, #e44c4c, #c0392b);
    color: #fff;
    padding: 7px 14px;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
    text-align: center;
    line-height: 1.15;
    display: flex;
    flex-direction: column;
}

.marta-badge-line1,
.marta-badge-line2 {
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   OVERLAY
   ------------------------------------------------------------ */
.marta-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.marta-overlay.marta-open {
    display: flex;
}

/* ------------------------------------------------------------
   MODAL
   ------------------------------------------------------------ */
.marta-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    padding: 26px 24px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    animation: marta-slide-up .35s cubic-bezier(.16, 1, .3, 1);
}

/* Scrollbar personalizzata rossa */
.marta-modal::-webkit-scrollbar {
    width: 8px;
}

.marta-modal::-webkit-scrollbar-track {
    background: #f3f3f3;
    border-radius: 8px;
}

.marta-modal::-webkit-scrollbar-thumb {
    background: #e44c4c;
    border-radius: 8px;
}

.marta-modal {
    scrollbar-width: thin;
    scrollbar-color: #e44c4c #f3f3f3;
}

.marta-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    background: #f1f1f1;
    color: #555;
    font-size: 22px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.marta-close:hover {
    background: #e44c4c;
    color: #fff;
    transform: rotate(90deg);
}

.marta-modal-photo {
    text-align: center;
    margin-bottom: 14px;
}

.marta-modal-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e44c4c;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}

.marta-modal-title {
    margin: 0 0 12px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #2c2c2c;
}

.marta-modal-text {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 18px;
    text-align: center;
}

/* ------------------------------------------------------------
   FORM
   ------------------------------------------------------------ */
.marta-cta {
    text-align: center;
    margin-bottom: 14px;
}

.marta-cta-text {
    display: block;
    font-weight: 700;
    color: #2c2c2c;
    font-size: 15px;
}

.marta-cta-price {
    display: inline-block;
    margin-top: 4px;
    background: linear-gradient(135deg, #e44c4c, #c0392b);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    padding: 4px 14px;
    border-radius: 14px;
}

.marta-input {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px 14px;
    border: 2px solid #e3e3e3;
    border-radius: 12px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.marta-input:focus {
    outline: none;
    border-color: #e44c4c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(228, 76, 76, .18);
}

/* Honeypot: nascosto a utenti reali, visibile ai bot */
.marta-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.marta-submit {
    width: 100%;
    margin-top: 4px;
    padding: 13px 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #e44c4c, #c0392b);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(228, 76, 76, .4);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.marta-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(228, 76, 76, .55);
}

.marta-submit:active:not(:disabled) {
    transform: translateY(0);
}

.marta-submit:disabled {
    opacity: .65;
    cursor: default;
}

.marta-submit.marta-loading {
    opacity: .8;
    cursor: wait;
}

.marta-result {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border-radius: 10px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease, padding .25s ease;
}

.marta-result.marta-result-ok,
.marta-result.marta-result-error {
    padding: 10px 12px;
    max-height: 200px;
}

.marta-result-ok {
    background: #e7f7ec;
    color: #1e7d3c;
    border: 1px solid #b6e3c4;
}

.marta-result-error {
    background: #fdeaea;
    color: #c0392b;
    border: 1px solid #f3c2c2;
}

/* ------------------------------------------------------------
   BOTTONE PAGAMENTO (link esterno, sotto il form)
   ------------------------------------------------------------ */
.marta-pay-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 13px 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #e44c4c, #c0392b);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(228, 76, 76, .4);
    transition: transform .18s ease, box-shadow .18s ease;
}

.marta-pay-btn:hover,
.marta-pay-btn:focus,
.marta-pay-btn:visited {
    color: #fff;
    text-decoration: none;
}

.marta-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(228, 76, 76, .55);
}

.marta-pay-btn:active {
    transform: translateY(0);
}

/* ------------------------------------------------------------
   ANIMAZIONI
   ------------------------------------------------------------ */
@keyframes marta-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-9px); }
}

@keyframes marta-glow {
    0%, 100% { box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 0 0 rgba(228, 76, 76, .55); }
    50%      { box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 0 14px rgba(228, 76, 76, 0); }
}

@keyframes marta-slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   RESPONSIVE - breakpoint 480px
   ------------------------------------------------------------ */
@media (max-width: 480px) {
    .marta-badge {
        bottom: 170px;
        right: 14px;
    }

    .marta-badge-circle {
        width: 68px;
        height: 68px;
        border-width: 3px;
    }

    .marta-badge-placeholder {
        font-size: 28px;
    }

    .marta-badge-line1,
    .marta-badge-line2 {
        font-size: 12px;
    }

    .marta-modal {
        padding: 22px 18px 20px;
        border-radius: 18px;
    }

    .marta-modal-title {
        font-size: 20px;
    }
}

/* Riduzione movimento per accessibilita */
@media (prefers-reduced-motion: reduce) {
    .marta-badge,
    .marta-badge-circle {
        animation: none;
    }

    .marta-modal {
        animation: none;
    }
}
