/* CTA Popup Plugin Styles */

/* Solo Bottone - Senza Banner */
.cta-elsa-button-only {
    --cta-color: #000c49;
    text-align: center;
    margin: 30px auto;
    display: block;
    width: 100%;
}

/* CTA Container - Banner completo (deprecato, non più usato di default) */
.cta-elsa {
    --cta-color: #000c49;
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 12, 73, 0.1);
    border: 2px solid rgba(0, 12, 73, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-elsa::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--cta-color) 0%, rgba(0, 12, 73, 0.6) 100%);
}

.cta-elsa:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 12, 73, 0.15);
}

.cta-elsa-content {
    text-align: center;
}

.cta-elsa-titolo {
    color: var(--cta-color);
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.cta-elsa-testo {
    color: #555;
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 30px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-elsa-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 45px;
    background: linear-gradient(135deg, #000c49 0%, #1a237e 100%);
    color: white !important;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 6px 25px rgba(0, 12, 73, 0.35);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

/* Sovrascrive eventuali stili del tema */
.cta-elsa-button-only .cta-elsa-button {
    background: linear-gradient(135deg, #000c49 0%, #1a237e 100%) !important;
}

.cta-elsa-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-elsa-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-elsa-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 12, 73, 0.4);
}

.cta-elsa-button:active {
    transform: translateY(-1px);
}

.cta-elsa-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.cta-elsa-button:hover .cta-elsa-icon {
    transform: translateX(5px);
}

/* Stili varianti */
.cta-elsa-gradient {
    background: linear-gradient(135deg, var(--cta-color) 0%, #1a237e 100%);
    color: white;
}

.cta-elsa-gradient .cta-elsa-titolo,
.cta-elsa-gradient .cta-elsa-testo {
    color: white;
}

.cta-elsa-gradient .cta-elsa-button {
    background: white;
    color: var(--cta-color);
}

.cta-elsa-outline {
    background: transparent;
    border: 3px solid var(--cta-color);
}

.cta-elsa-outline .cta-elsa-button {
    background: transparent;
    color: var(--cta-color);
    border: 2px solid var(--cta-color);
}

.cta-elsa-outline .cta-elsa-button:hover {
    background: var(--cta-color);
    color: white;
}

.cta-elsa-minimal {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 20px;
}

.cta-elsa-minimal:hover {
    transform: none;
    box-shadow: none;
}

/* Popup Overlay */
.cta-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.cta-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Container */
.cta-popup-container {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.cta-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-popup-close:hover {
    background: #e9ecef;
    transform: rotate(90deg);
    color: #000c49;
}

/* Popup Content */
.cta-popup-content {
    padding: 50px 40px 40px;
}

/* Popup Header */
.cta-popup-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e5e9;
}

.cta-popup-header h2 {
    color: #000c49;
    font-size: 26px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.cta-popup-header p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

/* Custom Form Styling */
.cta-form {
    padding: 0;
}

.cta-form-row {
    margin-bottom: 20px;
}

.cta-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 15px;
}

.cta-form-row label .required {
    color: #dc3545;
    font-weight: bold;
}

.cta-form-row input[type="text"],
.cta-form-row input[type="email"],
.cta-form-row input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
    box-sizing: border-box;
}

.cta-form-row input:focus {
    outline: none;
    border-color: #000c49;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 12, 73, 0.1);
}

.cta-form-row input.invalid {
    border-color: #dc3545;
    background: #fff5f5;
}

/* Checkbox Privacy */
.cta-form-row.cta-checkbox {
    margin: 25px 0;
}

.cta-form-row.cta-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: normal;
    cursor: pointer;
}

.cta-form-row.cta-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #000c49;
}

.cta-form-row.cta-checkbox span {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.cta-form-row.cta-checkbox a {
    color: #000c49;
    text-decoration: underline;
}

/* Submit Button */
.cta-submit-button {
    width: 100%;
    background: linear-gradient(135deg, #000c49 0%, #1a237e 100%);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 12, 73, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cta-submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 12, 73, 0.4);
}

.cta-submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cta-submit-button.loading {
    position: relative;
}

.cta-submit-button.loading::after {
    content: '';
    position: absolute;
    right: 20px;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Messages */
.cta-form-messages {
    margin-top: 25px;
}

.cta-form-messages .success-message,
.cta-form-messages .error-message {
    border-radius: 8px;
    padding: 20px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cta-form-messages .success-message {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    line-height: 1.6;
}

.cta-form-messages .error-message {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cta-elsa {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .cta-elsa-titolo {
        font-size: 24px;
    }
    
    .cta-elsa-testo {
        font-size: 16px;
    }
    
    .cta-elsa-button {
        padding: 16px 35px;
        font-size: 16px;
    }
    
    .cta-elsa-button-only .cta-elsa-button {
        width: 100%;
        max-width: 400px;
    }
    
    .cta-popup-overlay {
        padding: 10px;
    }
    
    .cta-popup-container {
        max-height: 95vh;
    }
    
    .cta-popup-content {
        padding: 40px 20px 30px;
    }
}

@media (max-width: 480px) {
    .cta-elsa {
        margin: 15px;
        padding: 25px 15px;
    }
    
    .cta-elsa-titolo {
        font-size: 20px;
    }
    
    .cta-elsa-testo {
        font-size: 14px;
    }
    
    .cta-elsa-button {
        padding: 14px 30px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .cta-elsa-button-only .cta-elsa-button {
        font-size: 14px;
    }
    
    .cta-popup-content {
        padding: 35px 15px 25px;
    }
}

/* Loading State */
.cta-popup-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #000c49;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

