/* =====================================================
   ISEE PRO 2026 - Stylesheet
   Versione: 4.1 (UX Enhanced)
   File: isee-simulator-styles.css
   ===================================================== */

/* VARIABILI & RESET */
:root {
    --wse-indigo: #6366F1;
    --wse-indigo-dark: #4F46E5;
    --wse-indigo-light: #EEF2FF;
    --wse-text: #1E293B;
    --wse-bg-gray: #F8FAFC;
    --wse-tooltip-bg: #1E1B4B;
    --wse-success: #10B981;
    --wse-warning: #F59E0B;
}

/* CONTAINER PRINCIPALE */
.wse-sim-pro { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: #FFFFFF; 
    border-radius: 16px; 
    border: 1px solid #E2E8F0; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03); 
    overflow: visible; 
    margin: 20px auto 30px; 
    color: var(--wse-text);
    max-width: 900px;
    position: relative;
}

/* ===================================================== 
   HEADER SECTION
   ===================================================== */
.wse-sim-header { 
    padding: 28px 32px; 
    border-bottom: 1px solid #F1F5F9; 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    flex-wrap: wrap; 
    gap: 20px;
    background: linear-gradient(to bottom, #FAFBFC 0%, #FFFFFF 100%);
    border-radius: 16px 16px 0 0;
}

.wse-sim-title h3 { 
    margin: 0; 
    font-family: 'Titillium Web', sans-serif; 
    font-size: 24px; 
    font-weight: 700; 
    background: linear-gradient(135deg, #1E1B4B 0%, #4F46E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase; 
    letter-spacing: 0.5px; 
    line-height: 1.2; 
}

.wse-sim-subtitle { 
    margin: 6px 0 0; 
    font-size: 13px; 
    color: #64748B; 
    font-weight: 500; 
}

/* DISCLAIMER BADGE */
.wse-disclaimer-compact { 
    display: flex; 
    gap: 12px; 
    align-items: center; 
    background: var(--wse-indigo-light); 
    padding: 10px 16px; 
    border-radius: 10px; 
    border: 1px solid #E0E7FF; 
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.08);
}

.wse-disc-icon { 
    width: 26px; 
    height: 26px; 
    background: var(--wse-indigo); 
    color: #fff; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 800; 
    font-size: 13px; 
    font-style: italic; 
    flex-shrink: 0;
}

.wse-disc-text-wrap strong { 
    display: block; 
    font-size: 11px; 
    color: #1E1B4B; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.3px; 
}

.wse-disc-text-wrap p { 
    margin: 0; 
    font-size: 11px; 
    color: #6366F1; 
    line-height: 1.3; 
}

/* ===================================================== 
   BODY SECTION
   ===================================================== */
.wse-sim-body { 
    padding: 32px; 
    background: #fff; 
    border-radius: 0 0 16px 16px; 
}

/* ===================================================== 
   TABS NAVIGATOR
   ===================================================== */
.wse-tabs-wrapper { 
    margin-bottom: 32px; 
}

.wse-tabs-label { 
    display: block; 
    font-size: 11px; 
    font-weight: 700; 
    color: #94A3B8; 
    margin-bottom: 10px; 
    text-transform: uppercase; 
    letter-spacing: 0.8px; 
}

.wse-tabs-bar { 
    display: flex; 
    gap: 10px; 
    position: relative; 
}

/* Linea di connessione tra gli step */
.wse-tabs-bar::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 16.6%;
    right: 16.6%;
    height: 2px;
    background: #E2E8F0;
    z-index: 0;
}

.wd-step-indicator { 
    flex: 1; 
    border: 2px solid #E2E8F0; 
    background: #FFFFFF; 
    padding: 12px 10px; 
    border-radius: 10px; 
    cursor: pointer; 
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    position: relative;
    z-index: 1;
}

.wd-step-indicator:hover { 
    background: #F8FAFC; 
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.wd-step-indicator.active { 
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%); 
    border-color: var(--wse-indigo); 
    color: var(--wse-indigo-dark); 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15); 
    transform: translateY(-3px);
}

.wd-step-indicator.active::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--wse-indigo);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.wd-step-indicator.completed {
    border-color: var(--wse-success);
    background: #F0FDF4;
}

.wse-tab-main { 
    font-size: 13px; 
    font-weight: 700; 
    display: block; 
    letter-spacing: -0.2px; 
}

.wse-tab-sub { 
    font-size: 10px; 
    font-weight: 600; 
    opacity: 0.7; 
    margin-top: 3px; 
    text-transform: uppercase; 
}

/* ===================================================== 
   FORM ELEMENTS
   ===================================================== */
.wse-form-row { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 22px; 
}

.wse-form-group { 
    flex: 1; 
    position: relative; 
}

.wse-label-wrap { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 8px; 
}

.wse-label { 
    display: block; 
    font-size: 13px; 
    font-weight: 700; 
    color: #334155; 
}

.wse-input, .wse-select { 
    width: 100%; 
    padding: 13px 16px; 
    border: 2px solid #E2E8F0; 
    border-radius: 10px; 
    font-size: 15px; 
    font-weight: 500; 
    color: #0F172A; 
    font-family: 'Inter', sans-serif; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    box-sizing: border-box;
    background: #FFFFFF; 
    -webkit-appearance: none;
}

.wse-input:hover, .wse-select:hover {
    border-color: #CBD5E1;
}

.wse-input:focus, .wse-select:focus { 
    border-color: var(--wse-indigo); 
    outline: none; 
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); 
    transform: translateY(-1px);
}

.wse-input::placeholder { 
    color: #94A3B8; 
    font-weight: 400; 
}

/* ===================================================== 
   TOOLTIP
   ===================================================== */
/* ===================================================== 
    TOOLTIP - FIX SAFARI & MOBILE
   ===================================================== */
.wse-tooltip-icon {
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    width: 20px; 
    height: 20px; 
    background: #E2E8F0; 
    color: #64748B;
    border-radius: 50%; 
    font-size: 11px; 
    font-weight: 800; 
    /* FIX SAFARI: Deve essere pointer per sentire il tocco */
    cursor: pointer; 
    margin-left: 6px; 
    transition: all 0.2s;
    position: relative;
    /* Impedisce selezioni fastidiose su iPhone */
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
}

/* FIX SAFARI: Aggiungiamo :active per farlo apparire al tocco */
.wse-tooltip-icon:hover, 
.wse-tooltip-icon:active, 
.wse-tooltip-icon.active { 
    background: var(--wse-indigo); 
    color: #fff; 
    transform: scale(1.1);
}

.wse-tooltip-icon:hover::after,
.wse-tooltip-icon:active::after,
.wse-tooltip-icon.active::after {
    content: attr(data-tooltip);
    position: absolute; 
    bottom: calc(100% + 10px); 
    right: 0; 
    background: var(--wse-tooltip-bg); 
    color: #fff;
    padding: 10px 14px; 
    border-radius: 8px;
    font-size: 11px; 
    line-height: 1.5; 
    font-weight: 500;
    width: 240px; 
    white-space: normal; 
    text-align: left;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25); 
    /* Aumentiamo lo z-index per Safari */
    z-index: 999;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease-out;
}

.wse-tooltip-icon:hover::before,
.wse-tooltip-icon:active::before,
.wse-tooltip-icon.active::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    right: 5px;
    border: 8px solid transparent;
    border-top-color: var(--wse-tooltip-bg);
    z-index: 1000;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===================================================== 
   BOX EVIDENZIATI
   ===================================================== */
.wse-box-highlight { 
    background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%); 
    border: 2px solid #BBF7D0; 
    padding: 18px; 
    border-radius: 10px; 
    margin-bottom: 25px; 
    position: relative;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.wse-box-highlight label { 
    color: #15803D; 
    font-weight: 700; 
    font-size: 13px; 
    margin-bottom: 8px; 
    display: block; 
}

.wse-input-highlight { 
    border-color: #86EFAC !important; 
    background: #fff; 
    color: #14532D; 
    font-weight: 600; 
}

.wse-input-highlight:focus { 
    border-color: var(--wse-success) !important; 
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important; 
}

/* ===================================================== 
   CHECKBOX STYLED
   ===================================================== */
.wse-checkbox-wrapper {
    display: flex; 
    align-items: flex-start; 
    gap: 12px; 
    background: #F8FAFC; 
    padding: 14px; 
    border: 2px solid #E2E8F0; 
    border-radius: 10px;
    cursor: pointer; 
    transition: all 0.2s;
    margin-bottom: 15px;
}

.wse-checkbox-wrapper:hover { 
    border-color: var(--wse-indigo); 
    background: #F1F5F9; 
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.wse-checkbox { 
    width: 20px; 
    height: 20px; 
    accent-color: var(--wse-indigo); 
    margin-top: 2px; 
    cursor: pointer; 
}

.wse-cb-label { 
    font-size: 13px; 
    font-weight: 600; 
    color: #475569; 
    line-height: 1.5; 
}

.wse-cb-desc { 
    display: block; 
    font-size: 11px; 
    color: #94A3B8; 
    margin-top: 3px; 
    font-weight: 400; 
}

/* ===================================================== 
   BUTTONS
   ===================================================== */
.wse-action-bar { 
    margin-top: 32px; 
    padding-top: 24px; 
    border-top: 2px solid #F1F5F9; 
}

.wd-next-step { 
    width: 100%; 
    padding: 16px 24px; 
    background: linear-gradient(135deg, var(--wse-indigo) 0%, var(--wse-indigo-dark) 100%); 
    color: #fff; 
    border: none; 
    border-radius: 10px; 
    font-weight: 700; 
    font-size: 15px; 
    letter-spacing: 0.5px; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); 
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.wd-next-step::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;
}

.wd-next-step:hover::before {
    width: 300px;
    height: 300px;
}

.wd-next-step:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35); 
}

.wd-next-step:active {
    transform: translateY(0);
}

.wd-prev-step { 
    background: transparent; 
    border: none; 
    color: #64748B; 
    font-size: 13px; 
    font-weight: 600; 
    text-decoration: none; 
    cursor: pointer; 
    margin-top: 15px; 
    display: block; 
    width: 100%; 
    text-align: center;
    transition: color 0.2s;
}

.wd-prev-step:hover {
    color: var(--wse-indigo);
}

/* ===================================================== 
   ANIMAZIONI RISULTATI
   ===================================================== */
#step-risultato { 
    display: none; 
    animation: wseSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1); 
}

.wd-step-content { 
    animation: fadeIn 0.3s ease-out; 
}

@keyframes wseSlideUp { 
    from { opacity: 0; transform: translateY(30px); } 
    to { opacity: 1; transform: translateY(0); } 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ===================================================== 
   HERO RISULTATO
   ===================================================== */
.wse-hero-total { 
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%); 
    padding: 44px 32px; 
    border-radius: 16px; 
    border: 2px solid #E0E7FF; 
    text-align: center; 
    margin-bottom: 32px; 
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.1);
}

.wse-hero-label { 
    display: block; 
    font-size: 12px; 
    font-weight: 800; 
    color: #6366F1; 
    text-transform: uppercase; 
    letter-spacing: 2.5px; 
    margin-bottom: 16px; 
}

.wse-hero-value { 
    display: block; 
    font-size: 56px; 
    font-weight: 900; 
    background: linear-gradient(135deg, #1E1B4B 0%, #6366F1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Titillium Web'; 
    line-height: 1; 
    letter-spacing: -2px; 
}

.wse-hero-breakdown { 
    display: flex; 
    justify-content: center; 
    gap: 24px; 
    margin-top: 20px; 
    font-size: 13px; 
    color: #64748B; 
    font-weight: 500; 
}

.wse-hero-breakdown span b { 
    color: #1E293B; 
    font-weight: 700; 
    font-size: 16px; 
}

/* ===================================================== 
   CARDS SERVIZI
   ===================================================== */
.wse-service-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 24px; 
}

.wse-service-card { 
    background: #fff; 
    border: 2px solid #E2E8F0; 
    border-radius: 14px; 
    padding: 28px 24px; 
    position: relative; 
    text-align: center; 
    display: flex; 
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wse-service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
}

.wse-card-badge { 
    position: absolute; 
    top: -14px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: #F1F5F9; 
    border: 2px solid #E2E8F0; 
    padding: 6px 16px; 
    border-radius: 20px; 
    font-size: 10px; 
    font-weight: 800; 
    color: #64748B; 
    text-transform: uppercase; 
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wse-card-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: #0F172A; 
    margin: 18px 0 12px; 
}

.wse-card-desc { 
    font-size: 13px; 
    color: #64748B; 
    line-height: 1.6; 
    margin-bottom: 24px; 
    flex-grow: 1; 
}

.card-premium { 
    border: 2px solid var(--wse-indigo); 
    background: linear-gradient(135deg, #FAFBFC 0%, #F8FAFC 100%); 
    box-shadow: 0 12px 28px -8px rgba(99, 102, 241, 0.2); 
    transform: scale(1.02); 
    z-index: 5; 
}

.badge-gold { 
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%); 
    color: #4F46E5; 
    border-color: #C7D2FE; 
}

.wse-btn-primary {
    display: inline-block; 
    text-decoration: none; 
    padding: 14px 24px; 
    background: var(--wse-indigo-dark); 
    color: #fff; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 13px; 
    margin-top: 8px; 
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wse-btn-primary:hover {
    background: var(--wse-indigo);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.3);
}

.wse-btn-text {
    margin: 0; 
    font-size: 12px; 
    text-transform: uppercase; 
    font-weight: 700; 
    color: #64748B; 
    border: none; 
    background: none; 
    cursor: pointer; 
    transition: color 0.2s;
}

.wse-btn-text:hover {
    color: var(--wse-indigo);
}

/* ===================================================== 
   UTILITY CLASSES
   ===================================================== */
.wse-divider {
    border: 0;
    border-top: 2px solid #F1F5F9;
    margin: 24px 0;
}

/* ===================================================== 
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) { 
    .wse-form-row, 
    .wse-service-grid { 
        flex-direction: column; 
        grid-template-columns: 1fr; 
    } 
    
    .wse-sim-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 16px; 
        padding: 24px; 
    }
    
    .wse-sim-body { 
        padding: 24px; 
    }
    
    .card-premium { 
        transform: none; 
        margin-top: 20px; 
    }
    
    .wse-hero-value { 
        font-size: 44px; 
    }
    
    .wse-tooltip-icon:hover::after { 
        width: 200px; 
        right: auto; 
        left: 50%; 
        transform: translateX(-50%) translateY(-8px); 
    }
    
    .wse-tabs-bar::before { 
        display: none; 
    }
    
    .wd-step-indicator.active::after { 
        top: -10px; 
        right: 50%; 
        transform: translateX(50%); 
    }
}