
body * {
    font-family: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
body {
    background-color: #f7f8fa !important;
}

/* Nascondi la barra interna perché ora usiamo quella di Shopify */
.sticky-progress-bar-wrapper, 
.sticky-progress-bar-container {
    display: none !important;
}

.legal-link {
    color: #2098c2;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.legal-link:hover {
    color: #166d8c;
}


.reverse_wrapper {
    width: 100%;
    max-width: 800px;
    margin-right: auto;
    margin-left: auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 32px;
    padding-bottom: 32px;
}
.sticky-progress-bar-container {
    width: 100%;
    max-width: 800px;
    margin-right: auto;
    margin-left: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.reverse_wrapper h1 {
    font-size: 35px;
    margin-bottom: 30px;
    text-align: center;
}

.head-text-muted {
    font-size: 0.9rem; 
    margin-top: -21px;
    margin-bottom: -38px;
    text-align: end;
    font-weight: 400;
}

.reverse_wrapper h2 {
    font-size: 25px;
    margin-top: 30px;
    margin-left: 15px;
}

.reverse_wrapper h2 span {
    font-weight: 900;
    margin-right: 10px;
}

.step1-hd {
    color: #2098c2;
}
.step2-hd {
    color: #fc6a0c;
}  
.step3-hd {
    color: #ff8ba6;
}

.reverse_wrapper h3 {
    font-size: 16px;
    margin-left: 0px;
    font-weight: 700;

}

.reverse_wrapper .reverse_card {
    background: #fff;
    border-radius: 20px;
    padding: 10px 20px 0;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.reverse_wrapper label {
    font-weight: bold;
    margin-bottom: 5px;
    margin-left: 5px;
}

.reverse_wrapper label .req {
    font-weight: 100;
}
.reverse_wrapper h2 .req {
    font-weight: 100;
    font-size: 22.5px;
}

.summary-mode-active .req {
    display: none !important;
}

.reverse_wrapper select {
    border-radius: 300px !important;
    transition: all 0.1s ease-in-out !important;
}

.reverse_wrapper select:disabled {
    opacity: 0.6 !important;
}

.reverse_wrapper input,
.reverse_wrapper textarea {
    border-radius: 10px !important;
    transition: all 0.1s ease-in-out !important;
    resize: none;
}

#valuation_qe .col-md-6 {
    padding: 10px 20px;
}

#valuation_qe:not(.row) {
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

#valuation_qe h3 {
    margin-bottom: 10px;
}

#valuation_qe {
    padding-left: 0;
    padding-right: 0;
    margin-left: 0 !important;
    row-gap: 30px;
    min-height: 150px;
}

#valuation_qe .question-group {
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#valuation_qe>.text-muted {
    text-align: center;
    font-weight: 300;
    padding: 2rem;
}

.question-title-wrapper {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
}

.question-title-wrapper h3 {
    margin-bottom: 0 !important;
    display: inline;
}

.info-icon {
    color: #0d6efd;
    cursor: pointer;
    font-size: 0.9em;
    margin-left: 5px;
    display: inline-block;
    vertical-align: baseline;
}

/* Stili per il popup del tooltip (Bootstrap) */
.tooltip {
    z-index: 1080 !important; 
    --bs-tooltip-opacity: 1 !important;
    --bs-tooltip-bg: #0d6efd !important;
    --bs-tooltip-color: #fff !important;
}

.tooltip-inner {
    max-width: 300px !important;
    padding: 10px 15px !important;
    text-align: center !important;
    border-radius: 13px !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
}

.buttons-flex-wrapper {
    margin-top: auto;
}

.reverse_wrapper .qe-btn {
    width: 100%;
    border: 1px solid rgb(18, 18, 18);
    color: rgb(18, 18, 18);
    border-radius: 200px;
    margin-bottom: 10px;
    background-color: white;
    padding: 6px;
    font-size: 16px;
    transition: 0.1s ease-in-out;
}

.reverse_wrapper .qe-btn:hover {
    background-color: #e5e5e9;
}

.reverse_wrapper .qe-btn-selected:hover,
.reverse_wrapper .qe-btn-selected {
    width: 100% !important;
    border: 1px solid rgb(18, 18, 18) !important;
    border-radius: 200px !important;
    margin-bottom: 10px !important;
    background-color: rgb(18, 18, 18) !important;
    color: #fff !important;
    padding: 6px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.reverse_wrapper .missing-answer h3,
.reverse_wrapper .missing-answer .question-title-wrapper h3 {
    color: #ff3c2f; 
}


.reverse_wrapper .text-end .btn-primary {
    display: block;
}

.reverse_wrapper .text-end .btn-primary {
    margin-left: auto;
    margin-right: auto;
    width: 40%;
    font-weight: 900;
    border-radius: 900px;
    padding: 10px 15px;
}

.reverse_wrapper .contact-legal-check {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
}

.reverse_wrapper .contact-legal-check label {
    font-weight: 300;
    margin: 0;
    line-height: 1;
    margin-left: 5px;
}

.reverse_wrapper .contact-legal-check input {
    width: 16px; 
    height: 16px;

}


@media (max-width: 768px) {
    .reverse_wrapper .form-select,
    .reverse_wrapper .form-input {
        width: 100% !important;
    }
}

@media screen and (min-width: 990px) {
    .reverse_wrapper {
        padding-left: 50px;
        padding-right: 50px;
    }
    .sticky-progress-bar-container {
        padding-left: 45px;
        padding-right: 45px;
    }
}
@media screen and (min-width: 750px) {
    .reverse_wrapper {
        padding-left: 32px;
        padding-right: 32px;
    }
    .sticky-progress-bar-container {
        padding-left: 27px;
        padding-right: 27px;
    }

    .reverse_wrapper h1 {
        font-size: 44px;
    }
}


/* 
STILI BLOCCO OFFERTA
*/

/* --- 1. Box Offerta (Modalità Form) --- */
#preliminary-offer-box {
    text-align: center;
    padding: 2rem 3rem;
    border: 2px solid #0d6efd; 
    background: linear-gradient(145deg, #f7faff, #ffffff);
    border-radius: 25px;
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

#preliminary-offer-box.active-form {
    border-color: #0d6efd;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.15);
}

#preliminary-offer-box.active-result {
    border-color: #198754;
    background: linear-gradient(145deg, #f6fffb, #ffffff);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.1);
}

#preliminary-offer-box h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #121212;
}

#preliminary-offer-box h4 .fas {
    color: #0d6efd;
    margin-right: 8px;
    font-size: 0.9em;
}

#preliminary-offer-box.active-result h4 .fas {
    color: #198754;
}

#preliminary-offer-box p.text-muted {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.small-text {
    font-size: 0.85rem;
}

#preliminary-offer-box .contact-legal-check {
    text-align: left;
    margin-bottom: 10px;
    width: 100%;
    align-items: center;
    display: flex;
}

#preliminary-offer-submit {
    font-weight: 700;
    padding: 10px;
    border-radius: 100px !important;
}

#preliminary-offer-box .alert {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
}

.offer-device-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    display: block;
    min-height: 1.2rem;
}

.offer-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: #198754;;
    margin-top: 5px;
    min-height: 2.6rem;
    line-height: 1.2;
}

/* --- 2. Box Riepilogo (Modalità Summary) --- */
.offer-summary-box {
    padding: 2rem 3rem;
    border: 2px solid #0d6efd;
    background: linear-gradient(145deg, #f7faff, #ffffff);
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.15);
    margin-bottom: 45px;
}

.offer-summary-box hr {
    margin: 20px 0;
}

/* Griglia Header (Titolo a sx, Dettagli a dx) */
.summary-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.summary-main-header h2 {
    margin: 0; 
    font-size: 28px; 
    font-weight: 700; 
}

.summary-header-details {
    text-align: right;
    margin-top: 5px;
}

/* Stile ID (come era prima) */
.summary-uuid {
    font-size: 12.5px;
    font-weight: 300;
    color: #6c757d;
    margin-bottom: 0;
    text-align: right;
}

.summary-creation-date {
    font-size: 0.95rem;
    color: #555;
    text-align: right;
    margin-bottom: 0;
}
.summary-creation-date span {
    font-weight: 600;
}

/* Wrapper per centrare il badge dello stato */
.summary-status-box-wrapper {
    text-align: center;
    margin-left: -5px;
}

.summary-status-box {
    text-align: left;
    display: inline-block;
}

.summary-status-box .status-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    background-color: #e0e0e0;
    color: #333;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 90px;
    text-align: center;
}

/* Stili specifici per stato */
/* 1. In Attesa / Azione Richiesta (Giallo) */
.status-badge.status-pending,
.status-badge.status-awaiting_response {
    background-color: #fff1d6;
    color: #8a6000;
}

/* 2. In Lavorazione / Processo Positivo (Blu) */
.status-badge.status-payment_processing,
.status-badge.status-evaluating,
.status-badge.status-received {
    background-color: #e0edff;
    color: #004cb5;
}

/* 3. Errore (Rosso Scuro) */
.status-badge.status-error {
    background-color: #ffe0e0;
    color: #b50000;
}

/* 4. Bozza (Grigio) */
.status-badge.status-draft {
    background-color: #e0e0e0;
    color: #333;
}

/* 5. Successo Finale (Verde) */
.status-badge.status-closed_completed {
    background-color: #d6f5d6;
    color: #004d00;
}

/* 6. Chiuso Negativo / Restituzione (Rosso Chiaro) */
.status-badge.status-return_processing, 
.status-badge.status-closed_returned,
.status-badge.status-closed_cancelled {
    background-color: #f5d6d6;
    color: #4d0000;
}


/* Griglia Contenuto (Dispositivo e Offerta) */
.summary-content-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.summary-device-info {
    flex: 2;
    text-align: left;
}

.summary-device-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    color: #121212;
}

.summary-device-info p {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.summary-offer-info {
    flex: 1;
    text-align: right;
}

.summary-offer-info .offer-group {
    border: 1px solid #e0e0e0;
    padding: 15px 25px;
    border-radius: 12px;
    background-color: #fff;
    display: inline-block;
    width: 250px;
    text-align: center;
}

.summary-offer-info .offer-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.summary-offer-info .offer-price {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    color: #007bff;
}


/* Sezione Azioni (Accetta/Rifiuta) */
.summary-actions-container {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #e0edff;
    border-radius: 12px;
}

.summary-actions-container p {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.summary-actions-container .btn-icon-round {
    font-weight: 700;
    border-radius: 500px !important; 
    padding: 10px 25px;
    margin: 0 10px;
    font-size: 1rem;
    min-width: 140px; 
}

.summary-actions-container .btn-icon-round .fas {
    margin-right: 8px;
}

/* Banner Istruzioni */
.summary-instructions-banner {
    padding: 15px;
    border-radius: 12px;
    background-color: #f7f8fa;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.summary-instructions-banner h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.summary-instructions-banner p {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0;
    text-align: center;
}

.summary-instructions-banner strong {
    font-weight: 600;
}

#summary-banner-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 15px;
    border: 1px solid #e0e0e0;
}

/* Bottone Download */
#summary-download-action {
    text-align: center;
    margin-top: 20px;
}

.download-btn {
    width: 100% !important;
    max-width: 400px !important;
    font-weight: 700 !important;
    border-radius: 500px !important;
    padding: 12px 25px !important;
    font-size: 1.1rem !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.download-btn .fas {
    margin-right: 8px;
}


/* ==================================================
   STILI PROGRESS BAR STICKY
================================================== */
.sticky-progress-bar-wrapper {
    position: sticky !important;
    bottom: 0 !important;
    background-color: #ffffff !important;
    border-top: 2px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
    z-index: 1000;
    padding: 10px 0;
    padding-bottom: 15px;
    width: 100%;
    margin-top: 20px;
}

.progress-bar-steps {
    font-size: 0.95rem;
    font-weight: 400;
    color: #333;
    text-align: center;
    margin-bottom: 5px;
}

.progress-bar-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar-track {
    flex-grow: 1;
    background-color: #e9ecef;
    border-radius: 50px;
    height: 10px;
    overflow: hidden;
}

.progress-step-counter {
    flex-shrink: 0;
    font-weight: 900;
    font-size: 0.95rem;
    color: #555;
    min-width: 60px;
    text-align: right;
}

.progress-bar-inner {
    height: 100%;
    background-color: #2098c2;
    border-radius: 50px;
    transition: width 0.4s ease-in-out;
    width: 33.3%;
}

.sticky-progress-bar-container.step-2 .progress-bar-inner {
    width: 66.6%;
    background-color: #fc6a0c;
}

.sticky-progress-bar-container.step-3 .progress-bar-inner {
    width: 100%;
    background-color: #ff8ba6;
}


/* ==================================================
   STILI MOBILE
=====================================================
*/
@media (max-width: 767px) {
    .offer-summary-box {
        padding: 2rem;
    }

    .summary-header-details, 
    .summary-uuid, 
    .summary-creation-date {
        text-align: center;
    }
    
    .summary-status-box-wrapper {
        margin-left: 0;
    }

    .summary-status-box .status-badge {
        font-size: 1rem;
        padding: 6px 12px;
    }

    .summary-content-grid {
        flex-direction: column;
        gap: 25px;
    }
    
    .summary-device-info {
        text-align: center;
    }
    
    .summary-offer-info {
        text-align: center;
    }

    .summary-offer-info .offer-group {
        width: auto;
        min-width: 250px; 
        max-width: 100%;
    }

    .summary-actions-container .btn-icon-round {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 10px auto;
    }
}


/* =====================================================
   STILI DOMANDE IN SUMMARY (Layout + Bottoni Riutilizzati)
=====================================================
*/

.summary-question-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 !important;
    border-top: 1px solid #e9ecef;
    align-items: start;
    padding-top: 10px !important;
}

.summary-question-row:first-of-type {
    border-top: 0 !important;
}

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

.read-only .qe-btn,
.summary-question-left .qe-btn {
    cursor: default;
    opacity: 0.8 !important;
    background-color: var(--bs-secondary-bg);
}

.read-only .qe-btn,
.summary-question-left .qe-btn:hover {
    background-color: var(--bs-secondary-bg) !important;
}

.summary-question-left .qe-btn.customer-selected,
.summary-question-left .qe-btn.customer-selected:hover,
.reverse_wrapper .qe-btn-selected:hover,
.reverse_wrapper .qe-btn-selected {
    width: 100% !important;
    border: 1px solid rgb(18, 18, 18) !important;
    border-radius: 200px !important;    
    margin-bottom: 10px !important;
    background-color: rgb(2, 2, 2) !important;
    color: #fff !important;
    padding: 6px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.reverse_wrapper .qe-btn.operator-confirmed {
    border: 1px solid rgb(18, 18, 18) !important;
    background-color: rgb(18, 18, 18) !important;
    color: #fff !important;
    outline: 3px solid #0d6efd;
    outline-offset: 3px;
    font-weight: 700;
}

/* --- Stili Risposte Operatore (Migliorativo / Peggiorativo) --- */
.reverse_wrapper .qe-btn.operator-upgrade {
    outline: 3px solid #198754;
    outline-offset: 3px;
    font-weight: 700;
    opacity: 1 !important;
}

/* PEGGIORATIVA (Rosso) - Risposta più in alto */
.reverse_wrapper .qe-btn.operator-downgrade {
    outline: 3px solid #dc3545;
    outline-offset: 3px;
    font-weight: 700;
    opacity: 1 !important;
}

.custom-tooltip-success {
    --bs-tooltip-bg: #198754 !important;
    --bs-tooltip-color: #fff !important;
    --bs-tooltip-opacity: 1 !important;
}

.custom-tooltip-danger {
    --bs-tooltip-bg: #dc3545 !important;
    --bs-tooltip-color: #fff !important;
    --bs-tooltip-opacity: 1 !important;
}

.tooltip-inner {
    text-align: center !important;
}

/* Colonna Destra: Feedback */
.summary-question-right {
    padding: 10px 20px;
    font-size: 0.95rem;
    padding-left: 0px;
}

.feedback-content-wrapper {
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px dashed #ccc;
    padding: 10px;
}

.summary-question-right.empty {
    display: none;
}

.feedback-label {
    font-weight: 700;
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.feedback-text {
    font-style: italic;
    margin-bottom: 10px;
}

.feedback-image-box {
    display: block;
    width: 100%;
    height: 200px;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden; 
    margin-top: 5px;
    text-decoration: none;
    cursor: zoom-in;
    border: 1px solid #ddd;
}

.feedback-image-box img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    display: block; 
    border-radius: 0px;
}

.feedback-image-box:hover {
    border-color: #0d6efd; 
    opacity: 0.9;
}

/* Mobile: Stack Verticale */
@media (max-width: 767px) {
    .summary-question-row {
        grid-template-columns: 1fr;
    }
    .summary-question-right {
        margin-top: 0;
    }

    .summary-question-right {
        padding-left: 20px;
    }
}
