/* CRO Budget Simulator v3.0 — cbw-style.css */
/* Usa CSS custom properties per colori personalizzabili da Elementor */

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

.cbw-wrap {
    --cbw-accent:     #1D9E75;
    --cbw-text:       #1a1a1a;
    --cbw-text-muted: #777777;
    --cbw-bg:         #ffffff;
    --cbw-bg2:        #f9f9f9;
    --cbw-border:     #e4e4e4;
    --cbw-radius:     14px;

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cbw-text);
    background: var(--cbw-bg);
    border-radius: var(--cbw-radius);
    padding: 28px 28px 24px;
    border: 1px solid var(--cbw-border);
    max-width: 800px;
    margin: 0 auto;
}

/* ── Header ── */
.cbw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cbw-border);
}
.cbw-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--cbw-text);
    margin: 0 0 4px;
    line-height: 1.3;
}
.cbw-subtitle {
    font-size: 13px;
    color: var(--cbw-text-muted);
    line-height: 1.4;
    max-width: 520px;
}
.cbw-reset {
    font-size: 12px;
    padding: 5px 13px;
    border: 1px solid var(--cbw-border);
    border-radius: 8px;
    background: var(--cbw-bg2);
    color: var(--cbw-text-muted);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity .12s;
}
.cbw-reset:hover { opacity: .7; }

/* ── Params card ── */
.cbw-params-card {
    background: var(--cbw-bg2);
    border: 1px solid var(--cbw-border);
    border-radius: calc(var(--cbw-radius) - 2px);
    padding: 16px 18px;
    margin-bottom: 18px;
}
.cbw-params-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cbw-text-muted);
    margin-bottom: 14px;
}
.cbw-params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
@media (max-width: 600px) { .cbw-params-grid { grid-template-columns: repeat(2, 1fr); } }
.cbw-param-item label {
    display: block;
    font-size: 11px;
    color: var(--cbw-text-muted);
    margin-bottom: 5px;
    font-weight: 500;
}
.cbw-param-input {
    width: 100%;
    padding: 7px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--cbw-text);
    background: var(--cbw-bg);
    border: 1px solid var(--cbw-border);
    border-radius: 7px;
    transition: border-color .15s;
    -moz-appearance: textfield;
}
.cbw-param-input::-webkit-inner-spin-button,
.cbw-param-input::-webkit-outer-spin-button { opacity: .5; }
.cbw-param-input:focus { outline: none; border-color: var(--cbw-accent); }
.cbw-params-note {
    font-size: 11px;
    color: var(--cbw-text-muted);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.cbw-note-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #BA7517;
    background: #FAEEDA;
    border: 1px solid #f0d5a0;
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Phase blocks ── */
.cbw-phase-block { margin-bottom: 4px; }
.cbw-phase-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--cbw-border);
    border-radius: 10px;
    cursor: pointer;
    background: var(--cbw-bg);
    transition: background .12s;
    user-select: none;
}
.cbw-phase-head:hover { background: var(--cbw-bg2); }
.cbw-phase-head.is-open { border-radius: 10px 10px 0 0; border-bottom-color: transparent; background: var(--cbw-bg2); }
.cbw-phase-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.cbw-phase-label { font-size: 13px; font-weight: 600; color: var(--cbw-text); flex: 1; }
.cbw-phase-badge {
    font-size: 11px; padding: 3px 10px;
    border-radius: 99px;
    border: 1px solid var(--cbw-border);
    background: var(--cbw-bg2);
    color: var(--cbw-text-muted);
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.cbw-chev { font-size: 20px; color: var(--cbw-border); transition: transform .2s; line-height: 1; }
.cbw-phase-head.is-open .cbw-chev { transform: rotate(90deg); }

/* ── Phase body ── */
.cbw-phase-body {
    border: 1px solid var(--cbw-border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}
.cbw-phase-body-note {
    font-size: 11px; color: var(--cbw-text-muted);
    padding: 6px 14px;
    background: var(--cbw-bg2);
    border-bottom: 1px solid var(--cbw-border);
    opacity: .7;
}

/* ── Module rows ── */
.cbw-module-row {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--cbw-border);
    background: var(--cbw-bg);
    transition: background .1s;
}
.cbw-module-row:last-child { border-bottom: none; }
.cbw-module-row:hover { background: var(--cbw-bg2); }
.cbw-module-row.is-selected { background: color-mix(in srgb, var(--cbw-accent) 4%, var(--cbw-bg)); }
.cbw-mod-chk { width:16px; height:16px; flex-shrink:0; margin-top:2px; cursor:pointer; accent-color: var(--cbw-accent); }
.cbw-mod-label { flex:1; cursor:pointer; display:block; min-width:0; }
.cbw-mod-name { display:block; font-size:13px; font-weight:600; color:var(--cbw-text); line-height:1.3; }
.cbw-mod-desc { display:block; font-size:11px; color:var(--cbw-text-muted); margin-top:3px; line-height:1.45; }
.cbw-mod-price-col { display:flex; flex-direction:column; align-items:flex-end; gap:1px; flex-shrink:0; padding-top:1px; }
.cbw-mod-unit-price { font-size:13px; font-weight:700; white-space:nowrap; }
.cbw-mod-unit-tag { font-size:10px; font-weight:400; color:var(--cbw-text-muted); margin-left:2px; }
.cbw-mod-subtotal { font-size:11px; font-weight:600; white-space:nowrap; text-align:right; }
.cbw-mod-subtotal-note { font-size:10px; color:var(--cbw-text-muted); white-space:nowrap; text-align:right; }

/* ── Connector ── */
.cbw-connector { display:flex; justify-content:center; height:14px; }
.cbw-connector-line { width:2px; background:var(--cbw-border); height:100%; }

/* ── Summary ── */
.cbw-summary {
    background: var(--cbw-bg2);
    border: 1px solid var(--cbw-border);
    border-radius: calc(var(--cbw-radius) - 2px);
    padding: 18px 20px;
    margin-top: 18px;
}
.cbw-sum-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--cbw-text-muted);
    margin-bottom: 12px;
}
.cbw-sum-empty { font-size: 12px; color: var(--cbw-text-muted); font-style: italic; }
.cbw-sum-group-title {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    color: var(--cbw-border);
    margin: 12px 0 5px;
}
.cbw-sum-line {
    display: flex; justify-content: space-between; gap: 12px;
    font-size: 12px; font-weight: 600;
    color: var(--cbw-text); padding: 2px 0;
}
.cbw-sum-line-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cbw-sum-line-val  { white-space:nowrap; }
.cbw-sum-breakdown { font-size:10px; color:var(--cbw-text-muted); padding:0 0 4px; opacity:.7; }
.cbw-sum-total-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--cbw-border);
}
.cbw-sum-total-label { font-size:14px; font-weight:600; color:var(--cbw-text); }
.cbw-sum-range      { font-size:11px; color:var(--cbw-text-muted); margin-top:3px; }
.cbw-sum-total-val  { font-size:26px; font-weight:700; color:var(--cbw-accent); white-space:nowrap; }
.cbw-sum-note       { font-size:11px; color:var(--cbw-text-muted); line-height:1.6; margin-top:10px; }

/* ── Actions ── */
.cbw-actions { display:flex; gap:10px; margin-top:14px; }
@media (max-width:500px) { .cbw-actions { flex-direction:column; } }

.cbw-cta {
    flex: 1;
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    border-radius: 9px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .18s ease, color .18s ease, border-color .18s ease,
                box-shadow .18s ease, transform .12s ease, opacity .15s ease;
    border: 2px solid transparent;
    outline: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}
.cbw-cta:focus-visible {
    outline: 3px solid var(--cbw-accent);
    outline-offset: 2px;
}

/* Primary — filled */
.cbw-cta-primary {
    color: #fff !important;
    background: var(--cbw-accent);
    border-color: var(--cbw-accent);
}
.cbw-cta-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.cbw-cta-primary:active { transform: translateY(0); filter: brightness(.96); box-shadow: none; }

/* PDF — outline */
.cbw-cta-pdf {
    color: var(--cbw-accent) !important;
    background: transparent;
    border-color: var(--cbw-accent);
}
.cbw-cta-pdf:hover {
    background: var(--cbw-accent);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.cbw-cta-pdf:active { transform: translateY(0); box-shadow: none; }

/* ── PDF Loading ── */
.cbw-pdf-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--cbw-text-muted);
    margin-top: 10px;
    justify-content: center;
}
.cbw-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid var(--cbw-border);
    border-top-color: var(--cbw-accent);
    border-radius: 50%;
    animation: cbw-spin .7s linear infinite;
}
@keyframes cbw-spin { to { transform: rotate(360deg); } }
