/**
 * FisiomanagerPro SOLO - Widget Embeddabile CSS
 * CSS isolato con prefisso .solo- per evitare conflitti
 * Personalizzabile via CSS Variables
 * Brand FisiomanagerPro - Versione 2.0
 */

/* =============================================
   CSS Variables (Brand FisiomanagerPro)
   ============================================= */
.solo-widget {
    --solo-primary: #0066cc;
    --solo-primary-dark: #004d99;
    --solo-primary-light: #e6f0ff;
    --solo-primary-gradient: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
    --solo-success: #28a745;
    --solo-success-light: #d4edda;
    --solo-error: #dc3545;
    --solo-error-light: #f8d7da;
    --solo-warning: #ffc107;
    --solo-warning-light: #fff3cd;
    --solo-text: #333333;
    --solo-text-light: #666666;
    --solo-border: #dee2e6;
    --solo-background: #f8f9fa;
    --solo-white: #ffffff;
    --solo-shadow: rgba(0, 0, 0, 0.1);
    --solo-shadow-lg: rgba(0, 102, 204, 0.2);
    --solo-radius: 8px;
    --solo-radius-lg: 16px;
    --solo-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --solo-transition: all 0.3s ease;
    --solo-transition-fast: all 0.15s ease;
}

/* =============================================
   Widget Container
   ============================================= */
.solo-widget {
    font-family: var(--solo-font);
    max-width: 700px;
    margin: 0 auto;
    color: var(--solo-text);
    line-height: 1.6;
    box-sizing: border-box;
}

.solo-widget *,
.solo-widget *::before,
.solo-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =============================================
   Card principale
   ============================================= */
.solo-card {
    background: var(--solo-white);
    border-radius: var(--solo-radius-lg);
    box-shadow: 0 8px 32px var(--solo-shadow-lg);
    overflow: hidden;
    border: 1px solid rgba(0, 102, 204, 0.1);
}

/* =============================================
   Header con Branding
   ============================================= */
.solo-header {
    background: var(--solo-primary-gradient);
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.solo-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.solo-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.solo-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.solo-brand-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.solo-brand-text {
    color: var(--solo-white);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.solo-brand-text span {
    font-weight: 400;
    opacity: 0.9;
}

.solo-trial-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--solo-white);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
    animation: solo-pulse 2s ease-in-out infinite;
}

@keyframes solo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.solo-trial-badge::before {
    content: '\2713';
    margin-right: 6px;
    font-size: 12px;
}

/* =============================================
   Progress Steps (Enhanced)
   ============================================= */
.solo-progress {
    padding: 24px 30px;
    background: linear-gradient(180deg, var(--solo-background) 0%, var(--solo-white) 100%);
    border-bottom: 1px solid var(--solo-border);
    position: relative;
}

.solo-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--solo-primary-gradient);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 3px 3px 0;
}

.solo-progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.solo-progress-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--solo-border);
    z-index: 1;
}

.solo-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.solo-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--solo-white);
    border: 2px solid var(--solo-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--solo-text-light);
    transition: var(--solo-transition);
}

.solo-step-label {
    margin-top: 8px;
    font-size: 12px;
    color: var(--solo-text-light);
    text-align: center;
    transition: var(--solo-transition);
}

.solo-step.active .solo-step-number {
    background: var(--solo-primary);
    border-color: var(--solo-primary);
    color: var(--solo-white);
}

.solo-step.active .solo-step-label {
    color: var(--solo-primary);
    font-weight: 600;
}

.solo-step.completed .solo-step-number {
    background: var(--solo-success);
    border-color: var(--solo-success);
    color: var(--solo-white);
}

.solo-step.completed .solo-step-number::after {
    content: '\2713';
    position: absolute;
    font-size: 14px;
}

/* =============================================
   Pricing Preview (Step 4)
   ============================================= */
.solo-pricing-preview {
    background: linear-gradient(135deg, var(--solo-primary-light) 0%, #f0f7ff 100%);
    border: 2px solid var(--solo-primary);
    border-radius: var(--solo-radius-lg);
    padding: 24px;
    text-align: center;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.solo-pricing-preview::before {
    content: 'DOPO IL TRIAL';
    position: absolute;
    top: 0;
    right: 0;
    background: var(--solo-primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 0 0 0 8px;
}

.solo-price {
    font-size: 48px;
    font-weight: 800;
    color: var(--solo-primary);
    line-height: 1;
}

.solo-price span {
    font-size: 18px;
    font-weight: 500;
    color: var(--solo-text-light);
}

.solo-price-note {
    font-size: 14px;
    color: var(--solo-text-light);
    margin-top: 8px;
}

.solo-price-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--solo-border);
}

.solo-price-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--solo-text);
}

.solo-price-feature::before {
    content: '\2713';
    color: var(--solo-success);
    font-weight: bold;
}

/* =============================================
   Trust Badges
   ============================================= */
.solo-trust-badges {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--solo-border);
}

.solo-trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--solo-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.solo-trust-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--solo-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.solo-trust-badge-icon.gdpr {
    background: #e8f5e9;
}

.solo-trust-badge-icon.secure {
    background: #fff3e0;
}

.solo-trust-badge-icon.italy {
    background: #e3f2fd;
}

/* =============================================
   Form Content
   ============================================= */
.solo-content {
    padding: 30px;
}

.solo-step-content {
    display: none;
    animation: solo-fadeIn 0.3s ease;
}

.solo-step-content.active {
    display: block;
}

@keyframes solo-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.solo-title {
    font-size: 20px;
    color: var(--solo-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--solo-primary-light);
}

/* =============================================
   Form Groups
   ============================================= */
.solo-form-group {
    margin-bottom: 20px;
}

.solo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.solo-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--solo-text);
    font-size: 14px;
}

.solo-required {
    color: var(--solo-error);
    margin-left: 2px;
}

.solo-input,
.solo-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--solo-border);
    border-radius: var(--solo-radius);
    font-size: 15px;
    font-family: var(--solo-font);
    transition: var(--solo-transition);
    background: var(--solo-white);
}

.solo-input:focus,
.solo-select:focus {
    outline: none;
    border-color: var(--solo-primary);
    box-shadow: 0 0 0 3px var(--solo-primary-light);
}

.solo-input.valid {
    border-color: var(--solo-success);
}

.solo-input.invalid {
    border-color: var(--solo-error);
}

.solo-input-wrapper {
    position: relative;
}

.solo-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.solo-input-icon.valid {
    color: var(--solo-success);
}

.solo-input-icon.invalid {
    color: var(--solo-error);
}

.solo-input-icon.loading {
    color: var(--solo-primary);
    animation: solo-spin 1s linear infinite;
}

@keyframes solo-spin {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.solo-helper {
    font-size: 12px;
    color: var(--solo-text-light);
    margin-top: 4px;
}

.solo-error-text {
    font-size: 12px;
    color: var(--solo-error);
    margin-top: 4px;
    display: none;
}

.solo-form-group.has-error .solo-error-text {
    display: block;
}

/* =============================================
   Username Preview
   ============================================= */
.solo-username-preview {
    background: var(--solo-primary-light);
    padding: 10px 14px;
    border-radius: var(--solo-radius);
    margin-top: 8px;
    font-size: 14px;
}

.solo-username-preview strong {
    color: var(--solo-primary);
}

/* =============================================
   Password Strength
   ============================================= */
.solo-password-strength {
    margin-top: 8px;
}

.solo-strength-bar {
    height: 4px;
    background: var(--solo-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.solo-strength-fill {
    height: 100%;
    width: 0;
    transition: var(--solo-transition);
}

.solo-strength-fill.weak { width: 33%; background: var(--solo-error); }
.solo-strength-fill.medium { width: 66%; background: var(--solo-warning); }
.solo-strength-fill.strong { width: 100%; background: var(--solo-success); }

.solo-strength-text {
    font-size: 12px;
    color: var(--solo-text-light);
}

/* =============================================
   Logo Upload
   ============================================= */
.solo-logo-upload {
    border: 2px dashed var(--solo-border);
    border-radius: var(--solo-radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--solo-transition);
    background: var(--solo-background);
}

.solo-logo-upload:hover {
    border-color: var(--solo-primary);
    background: var(--solo-primary-light);
}

.solo-logo-upload.has-file {
    border-style: solid;
    border-color: var(--solo-success);
}

.solo-logo-upload input[type="file"] {
    display: none;
}

.solo-upload-icon {
    font-size: 40px;
    color: var(--solo-primary);
    margin-bottom: 10px;
}

.solo-upload-text {
    color: var(--solo-text-light);
    font-size: 14px;
}

.solo-upload-text strong {
    color: var(--solo-primary);
}

.solo-logo-preview {
    max-width: 200px;
    max-height: 100px;
    margin-top: 10px;
    border-radius: 4px;
}

/* =============================================
   Summary Section
   ============================================= */
.solo-summary-section {
    background: var(--solo-background);
    border-radius: var(--solo-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.solo-summary-section h4 {
    color: var(--solo-primary);
    margin-bottom: 12px;
    font-size: 16px;
}

.solo-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--solo-border);
}

.solo-summary-row:last-child {
    border-bottom: none;
}

.solo-summary-label {
    color: var(--solo-text-light);
    font-size: 14px;
}

.solo-summary-value {
    font-weight: 500;
    font-size: 14px;
}

/* =============================================
   Checkbox
   ============================================= */
.solo-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 0;
}

.solo-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.solo-checkbox-group label {
    font-size: 14px;
    cursor: pointer;
}

.solo-checkbox-group a {
    color: var(--solo-primary);
    text-decoration: none;
}

.solo-checkbox-group a:hover {
    text-decoration: underline;
}

/* =============================================
   Navigation Buttons
   ============================================= */
.solo-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    background: var(--solo-background);
    border-top: 1px solid var(--solo-border);
}

.solo-btn {
    padding: 12px 28px;
    border-radius: var(--solo-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--solo-transition);
    border: none;
    font-family: var(--solo-font);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.solo-btn-secondary {
    background: var(--solo-white);
    color: var(--solo-text);
    border: 1px solid var(--solo-border);
}

.solo-btn-secondary:hover {
    background: var(--solo-background);
}

.solo-btn-primary {
    background: var(--solo-primary);
    color: var(--solo-white);
}

.solo-btn-primary:hover {
    background: var(--solo-primary-dark);
}

.solo-btn-primary:disabled {
    background: var(--solo-border);
    cursor: not-allowed;
}

.solo-btn-success {
    background: var(--solo-success);
    color: var(--solo-white);
}

.solo-btn-success:hover {
    background: #218838;
}

/* =============================================
   Loading Overlay
   ============================================= */
.solo-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    flex-direction: column;
    border-radius: calc(var(--solo-radius) * 1.5);
}

.solo-loading.active {
    display: flex;
}

.solo-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--solo-border);
    border-top-color: var(--solo-primary);
    border-radius: 50%;
    animation: solo-spin 1s linear infinite;
    margin-bottom: 20px;
}

.solo-loading-text {
    font-size: 18px;
    color: var(--solo-primary);
    font-weight: 500;
}

/* =============================================
   Alert Messages
   ============================================= */
.solo-alert {
    padding: 15px 20px;
    border-radius: var(--solo-radius);
    margin-bottom: 20px;
    display: none;
}

.solo-alert.show {
    display: block;
    animation: solo-fadeIn 0.3s ease;
}

.solo-alert-error {
    background: var(--solo-error-light);
    border: 1px solid var(--solo-error);
    color: #721c24;
}

.solo-alert-success {
    background: var(--solo-success-light);
    border: 1px solid var(--solo-success);
    color: #155724;
}

/* =============================================
   Province Select (Italy)
   ============================================= */
.solo-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .solo-widget {
        padding: 0 15px;
    }

    .solo-form-row {
        grid-template-columns: 1fr;
    }

    .solo-step-label {
        font-size: 10px;
    }

    .solo-content {
        padding: 20px;
    }

    .solo-navigation {
        padding: 15px 20px;
    }

    .solo-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .solo-step-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .solo-step-label {
        display: none;
    }

    .solo-title {
        font-size: 18px;
    }

    .solo-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .solo-trial-badge {
        font-size: 11px;
        padding: 8px 14px;
    }

    .solo-trust-badges {
        gap: 16px;
    }

    .solo-trust-badge {
        font-size: 10px;
    }

    .solo-pricing-preview {
        padding: 20px 16px;
    }

    .solo-price {
        font-size: 36px;
    }
}

/* =============================================
   Contract Container (Terms Step)
   ============================================= */
.solo-contract-intro {
    font-size: 14px;
    color: var(--solo-text-light);
    margin-bottom: 16px;
    line-height: 1.5;
}

.solo-contract-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--solo-border);
    border-radius: var(--solo-radius);
    padding: 20px;
    background: var(--solo-background);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.solo-contract-container h4 {
    color: var(--solo-primary);
    font-size: 15px;
    margin: 20px 0 8px 0;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--solo-border);
}

.solo-contract-container h4:first-child {
    margin-top: 0;
}

.solo-contract-container h5 {
    color: var(--solo-text);
    font-size: 13px;
    margin: 16px 0 6px 0;
}

.solo-contract-container p {
    margin: 6px 0;
    text-align: justify;
}

.solo-contract-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 12px;
}

.solo-contract-container table th,
.solo-contract-container table td {
    border: 1px solid var(--solo-border);
    padding: 6px 8px;
    text-align: left;
}

.solo-contract-container table th {
    background: var(--solo-primary-light);
    font-weight: 600;
}

.solo-contract-acceptance {
    background: #fffbea;
    border: 2px solid var(--solo-warning);
    border-radius: var(--solo-radius);
    padding: 16px;
    margin-top: 16px;
}

.solo-checkbox-vessatorie {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--solo-border);
}

.solo-contract-container::-webkit-scrollbar {
    width: 6px;
}

.solo-contract-container::-webkit-scrollbar-track {
    background: var(--solo-background);
}

.solo-contract-container::-webkit-scrollbar-thumb {
    background: var(--solo-border);
    border-radius: 3px;
}

.solo-contract-container::-webkit-scrollbar-thumb:hover {
    background: var(--solo-text-light);
}
