/* SOS Leads – Custom Styles */
body.sl-landing {
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
}

.green-gradient {
    background: linear-gradient(135deg, var(--sl-primary-dark) 0%, var(--sl-primary) 100%);
}

/* ─── Step Animations ─── */
.step-content {
    display: none;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
}
.step-content.active {
    display: block;
    position: relative;
    animation: slSlideIn 0.4s ease-out;
}
.step-content.active.back {
    animation: slSlideInReverse 0.4s ease-out;
}

@keyframes slSlideIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-30px); }
}
@keyframes slSlideInReverse {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ─── Input States ─── */
.input-focus {
    border-color: var(--sl-primary-soft, #a7f3d0);
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.input-focus:focus {
    border-color: var(--sl-primary, #10b981);
    box-shadow: 0 0 0 4px var(--sl-primary-focus-shadow, #ecfdf5);
}
.input-error {
    border-color: #fca5a5;
}
.input-error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px #fef2f2;
}

/* ─── Error Messages ─── */
.error-msg {
    color: #ef4444;
    font-size: 11px;
    font-weight: 600;
    margin-top: 0.25rem;
    display: none;
}
.error-msg.visible {
    display: block;
    animation: slFadeInError 0.3s ease-out;
}

/* ─── Button Error Summary ─── */
#sl-btn-error {
    animation: slShake 0.4s ease-out;
}
@keyframes slShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
@keyframes slFadeInError {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Loader ─── */
.sl-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--sl-primary, #10b981);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: slSpin 1s linear infinite;
}
@keyframes slSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── File Upload ─── */
.file-upload-card {
    border: 2px dashed #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
    cursor: pointer;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.file-upload-card:hover {
    border-color: var(--sl-primary, #34d399);
}
.file-upload-card.uploaded {
    border-style: solid;
    border-color: var(--sl-primary, #34d399);
    background-color: var(--sl-primary-muted, #ecfdf5);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.star { color: #f59e0b; }

/* ─── Range Slider ─── */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--sl-primary, #059669);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(5,150,105,0.4);
}
input[type="range"]::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--sl-primary, #059669);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(5,150,105,0.4);
}

/* ─── Mobile: form subito dopo il titolo ─── */
@media (min-width: 1024px) {
    .sl-landing main > .container > .order-2 {
        grid-row: 1 / 3;
        grid-column: 2;
        align-self: center;
    }
    .sl-landing main > .container > .order-1 {
        grid-column: 1;
        align-self: end;
    }
    .sl-landing main > .container > .order-3 {
        grid-column: 1;
        align-self: start;
    }
}

/* ─── Confirmation Page ─── */
.sl-confirm main {
    background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 100%);
}
@keyframes slFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.sl-confirm #sl-confirm-result,
.sl-confirm #sl-confirm-success {
    animation: slFadeUp 0.5s ease-out;
}

/* AdSense: contenitore visibile, niente clipping su annunci responsive */
.sl-confirm .sl-confirm-adsense {
    overflow: visible !important;
}
.sl-confirm .sl-confirm-adsense ins.adsbygoogle {
    display: block !important;
    max-width: 100%;
}

.sl-confirm-timeline__step--done .sl-confirm-timeline__badge {
    background-color: var(--sl-primary, #059669);
    color: #fff;
}
.sl-confirm-timeline__step--active .sl-confirm-timeline__badge {
    background-color: var(--sl-primary, #059669);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}
.sl-confirm .sl-ai-whatsapp-cta:not(.hidden) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sl-confirm #sl-confirm-mobile-sticky a {
    text-decoration: none;
}

/* ─── Layout CdQ alta conversione ─── */
.sl-layout-cdq .sl-form-instance {
    scroll-margin-top: 1rem;
}
.sl-layout-cdq .sl-cta-primary {
    min-height: 3.25rem;
    letter-spacing: 0.01em;
}
@media (max-width: 768px) {
    .sl-layout-cdq .sl-form-instance {
        border-radius: 1.5rem;
        padding: 1.25rem 1rem 1.5rem;
    }
    .sl-layout-cdq .sl-cta-primary {
        position: sticky;
        bottom: 0.75rem;
        z-index: 20;
        box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
    }
}

/* ─── Mobile Sticky CTA ─── */
@media (max-width: 768px) {
    .mobile-sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 12px 16px;
        background: white;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        display: flex;
        gap: 10px;
    }
}
@media (min-width: 769px) {
    .mobile-sticky-cta { display: none; }
}

/* ─── Disclaimer submit e modal partner ─── */
.sl-submit-disclaimer {
    font-size: 0.75rem;
    line-height: 1.625;
    color: #64748b;
    margin-top: 0.75rem;
}
.sl-submit-disclaimer__email {
    color: #059669;
    text-decoration: underline;
}
.sl-submit-disclaimer__email:hover {
    color: #047857;
}
.sl-partner-info-trigger {
    display: inline;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: inherit;
    color: #059669;
    text-decoration: underline;
    cursor: pointer;
}
.sl-partner-info-trigger:hover {
    color: #047857;
}
.sl-partner-modal-card {
    max-height: min(85vh, 520px);
    overflow-y: auto;
}
.sl-partner-modal-message {
    white-space: pre-wrap;
}

/* Layout landing */
.sl-layout-form_first main {
    padding-top: 1.5rem;
}
.sl-layout-form_first .sl-how-it-works {
    margin-top: 0;
}
.sl-layout-liquidita .mobile-sticky-cta {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.sl-layout-cessione_quinto .sl-benefits-grid {
    margin-top: 1rem;
}

/* Colore primario landing: override utility Tailwind emerald → CSS variables */
.sl-landing .bg-emerald-600,
.sl-landing .mobile-sticky-cta a.bg-emerald-600 {
    background-color: var(--sl-primary, #059669) !important;
}
.sl-landing .hover\:bg-emerald-700:hover,
.sl-landing button.bg-emerald-600:hover {
    background-color: var(--sl-primary-hover, var(--sl-primary-dark, #047857)) !important;
}
.sl-landing .bg-emerald-500,
.sl-landing #progress.bg-emerald-500 {
    background-color: var(--sl-primary, #059669) !important;
}
.sl-landing .text-emerald-600,
.sl-landing .hover\:text-emerald-600:hover {
    color: var(--sl-primary, #059669) !important;
}
.sl-landing .text-emerald-500 {
    color: var(--sl-primary, #059669) !important;
}
.sl-landing .text-emerald-800 {
    color: var(--sl-primary-deep, var(--sl-primary-dark, #065f46)) !important;
}
.sl-landing .text-emerald-700,
.sl-landing .text-emerald-900 {
    color: var(--sl-primary-dark, #064e3b) !important;
}
.sl-landing .text-emerald-300,
.sl-landing .text-emerald-300 span,
.sl-landing h1 .text-emerald-300 {
    color: var(--sl-primary-highlight, #6ee7b7) !important;
}
.sl-landing .border-emerald-50 {
    border-color: var(--sl-primary-muted, #ecfdf5) !important;
}
.sl-landing .border-emerald-100 {
    border-color: var(--sl-primary-soft, #d1fae5) !important;
}
.sl-landing .bg-emerald-50 {
    background-color: var(--sl-primary-muted, #ecfdf5) !important;
}
.sl-landing .bg-emerald-100 {
    background-color: var(--sl-primary-soft, #d1fae5) !important;
}
.sl-landing .accent-emerald-600 {
    accent-color: var(--sl-primary, #059669) !important;
}
.sl-landing .shadow-emerald-100 {
    --tw-shadow-color: var(--sl-primary-ring, rgba(5, 150, 105, 0.15));
}
.sl-landing .shadow-emerald-200 {
    --tw-shadow-color: color-mix(in srgb, var(--sl-primary, #059669) 25%, transparent);
}
.sl-landing .sl-submit-disclaimer__email,
.sl-landing .sl-partner-info-trigger {
    color: var(--sl-primary, #059669) !important;
}
.sl-landing .sl-submit-disclaimer__email:hover,
.sl-landing .sl-partner-info-trigger:hover {
    color: var(--sl-primary-hover, var(--sl-primary-dark, #047857)) !important;
}

@media (max-width: 1023px) {
    .sl-layout-classic .sl-form-instance {
        order: 2;
    }
}
