/* ============================================================
   PREVENTIVO - COMMON
   Stili condivisi tra tutti gli step
   ============================================================ */


/* ============================================================
   STEPPER
   ============================================================ */

.preventivo-stepper {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-bottom: 35px;
    padding: 20px 25px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.90);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.step-number {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e9ecef;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 800;
    transition: all 0.25s ease;
}

.step-item.active .step-number {
    background: #1e4f82;
    color: #fff;
    box-shadow: 0 5px 15px rgba(30, 79, 130, 0.25);
}

.step-label {
    display: flex;
    flex-direction: column;
}

.step-label span {
    font-size: 0.82rem;
    font-weight: 800;
    color: #374151;
}

.step-label small {
    margin-top: 2px;
    color: #9ca3af;
    font-size: 0.68rem;
}

.step-item.active .step-label span {
    color: #1e4f82;
}

.step-line {
    flex: 1;
    height: 2px;
    min-width: 20px;
    margin: 0 15px;
    background: #e5e7eb;
    transition: background 0.25s ease;
}

.step-line.active {
    background: #1e4f82;
}


/* ============================================================
   MAIN
   ============================================================ */

.preventivo-page {
    min-height: 100vh;
    padding-bottom: 80px;
    background:
        radial-gradient(circle at 15% 10%,
            rgba(30, 79, 130, 0.08),
            transparent 30%),
        radial-gradient(circle at 85% 25%,
            rgba(0, 0, 0, 0.05),
            transparent 30%),
        #f6f7f9;
    color: #1b1f24;
}


/* ============================================================
   HEADER
   ============================================================ */

.preventivo-header {
    padding-top: 55px;
    padding-bottom: 35px;
}

.preventivo-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    border-radius: 50px;
    background: rgba(30, 79, 130, 0.08);
    color: #1e4f82;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.preventivo-title {
    margin-top: 18px;
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    color: #111827;
}

.preventivo-subtitle {
    max-width: 720px;
    margin: 0 auto;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.7;
}


/* ============================================================
   CARD PRINCIPALE
   ============================================================ */

.preventivo-card {
    position: relative;
    padding: 30px;
    margin-bottom: 25px;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.055);
}


/* ============================================================
   CARD HEADER
   ============================================================ */

.card-header-custom {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 30px;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 14px;
    background: #1e4f82;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 8px 20px rgba(30, 79, 130, 0.18);
}

.card-header-custom h2 {
    margin: 0;
    color: #111827;
    font-size: 1.45rem;
    font-weight: 800;
}

.card-header-custom p {
    margin: 5px 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}


/* ============================================================
   FORM
   ============================================================ */

.form-label-custom {
    display: block;
    margin-bottom: 9px;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 750;
}

.form-control-custom,
.form-select-custom {
    width: 100%;
    min-height: 50px;
    padding: 12px 15px;
    border: 1px solid #dfe3e8;
    border-radius: 11px;
    background: #fff;
    color: #1f2937;
    font-size: 0.92rem;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-control-custom:focus,
.form-select-custom:focus {
    border-color: #1e4f82;
    box-shadow: 0 0 0 4px rgba(30, 79, 130, 0.09);
}

.form-control-custom::placeholder {
    color: #a1a8b0;
}

.textarea-custom {
    min-height: 130px;
    resize: vertical;
    line-height: 1.6;
}

.form-help {
    display: block;
    margin-top: 6px;
    color: #8a929d;
    font-size: 0.72rem;
}


/* ============================================================
   INPUT CON ICONA
   ============================================================ */

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 2;
    transform: translateY(-50%);
    color: #8b95a1;
    pointer-events: none;
}

.input-icon .form-control-custom {
    padding-left: 43px;
}


/* ============================================================
   SELECT
   ============================================================ */

.select-wrapper {
    position: relative;
}

.select-wrapper i {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    color: #7b8490;
    pointer-events: none;
}

.select-wrapper .form-select-custom {
    appearance: none;
    padding-right: 45px;
}


/* ============================================================
   COLORI
   ============================================================ */

.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.color-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #555e69;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    background: #f4f6f8;
}

.color-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.color-circle {
    display: inline-block;
    width: 25px;
    height: 25px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.color-option input:checked ~ .color-circle {
    outline: 3px solid rgba(30, 79, 130, 0.22);
    outline-offset: 2px;
}

.color-option:has(input:checked) {
    border-color: rgba(30, 79, 130, 0.25);
    background: rgba(30, 79, 130, 0.05);
}


/* ============================================================
   COLORI COPERTINA
   ============================================================ */

.color-nero {
    background: #171717;
}

.color-bianco {
    background: #fff;
}

.color-blu {
    background: #174a78;
}

.color-rosso {
    background: #a62929;
}

.color-verde {
    background: #315f43;
}

.color-bordeaux {
    background: #651f32;
}


/* ============================================================
   UPLOAD
   ============================================================ */

.upload-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 25px;
    border: 2px dashed #d5dce4;
    border-radius: 17px;
    background: #fafbfc;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.upload-box:hover,
.upload-box.dragover {
    border-color: #1e4f82;
    background: rgba(30, 79, 130, 0.035);
    transform: translateY(-1px);
}

.upload-content {
    text-align: center;
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 17px;
    background: rgba(30, 79, 130, 0.09);
    color: #1e4f82;
    font-size: 1.6rem;
}

.upload-content h5 {
    margin: 0;
    color: #343a40;
    font-size: 0.95rem;
    font-weight: 800;
}

.upload-content p {
    margin: 6px 0;
    color: #9aa1aa;
    font-size: 0.78rem;
}

.upload-content small {
    display: block;
    margin-top: 12px;
    color: #9aa1aa;
    font-size: 0.7rem;
}

.btn-upload {
    padding: 9px 16px;
    border: none;
    border-radius: 9px;
    background: #1e4f82;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload:hover {
    background: #163c63;
    transform: translateY(-1px);
}


/* ============================================================
   FILE PREVIEW
   ============================================================ */

.file-preview-container {
    margin-top: 15px;
    overflow: hidden;
    border: 1px solid #e1e5ea;
    border-radius: 14px;
    background: #fff;
}

.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid #e7eaee;
    background: #f8f9fa;
}

.file-preview-header > div {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.file-preview-header i {
    color: #1e4f82;
}

#nomeFile {
    overflow: hidden;
    color: #414952;
    font-size: 0.78rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-remove-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: none;
    border-radius: 8px;
    background: #f1f3f5;
    color: #737b84;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-file:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.file-preview-body {
    padding: 10px;
    background: #f4f5f7;
}

.image-preview {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 9px;
}

.pdf-preview {
    display: block;
    width: 100%;
    height: 350px;
    border: none;
    border-radius: 8px;
    background: #fff;
}


/* ============================================================
   BOTTONI COMUNI
   ============================================================ */

.step-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #edf0f2;
}

.btn-primary-custom,
.btn-secondary-custom,
.btn-outline-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-custom {
    border: 1px solid #1e4f82;
    background: #1e4f82;
    color: #fff;
}

.btn-primary-custom:hover {
    transform: translateY(-1px);
    background: #163c63;
    color: #fff;
    box-shadow: 0 8px 18px rgba(30, 79, 130, 0.18);
}

.btn-secondary-custom {
    border: 1px solid #dfe3e7;
    background: #fff;
    color: #59636e;
}

.btn-secondary-custom:hover {
    border-color: #c8cfd7;
    background: #f7f8f9;
    color: #343a40;
}

.btn-outline-custom {
    border: 1px solid #1e4f82;
    background: #fff;
    color: #1e4f82;
}

.btn-outline-custom:hover {
    background: #1e4f82;
    color: #fff;
}

/* ============================================================
   RIEPILOGO COSTI
   ============================================================ */

.riepilogo-sticky {
    position: sticky;
    top: 25px;
    align-self: flex-start;
    height: fit-content;
    z-index: 10;
}

.price-card {
    overflow: hidden;
    border: 1px solid #e0e4e8;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.07);
}

.price-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px;
    background: #111827;
    color: #fff;
}

.price-card-header > div:first-child span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.price-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.price-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
}

.price-card-body {
    padding: 22px;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f3;
}

.price-row span {
    color: #66707b;
    font-size: 0.78rem;
}

.price-row strong {
    color: #303840;
    font-size: 0.8rem;
    white-space: nowrap;
}

.price-card-body hr {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
    opacity: 1;
}

.price-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.price-total span {
    color: #333a42;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.price-total strong {
    color: #1e4f82;
    font-size: 1.45rem;
    font-weight: 900;
}

.price-note {
    margin-top: 18px;
    padding: 12px;
    border-radius: 10px;
    background: #f6f8fa;
    color: #7b848e;
    font-size: 0.68rem;
    line-height: 1.55;
}


/* ============================================================
   HELP CARD
   ============================================================ */

.help-card {
    display: flex;
    gap: 13px;
    margin-top: 15px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 17px;
    background: #fff;
}

.help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 11px;
    background: #eef4f9;
    color: #1e4f82;
}

.help-card h5 {
    margin: 0;
    color: #343a40;
    font-size: 0.82rem;
    font-weight: 800;
}

.help-card p {
    margin: 5px 0 9px;
    color: #858e98;
    font-size: 0.7rem;
    line-height: 1.5;
}

.help-card a {
    color: #1e4f82;
    font-size: 0.75rem;
    font-weight: 800;
    text-decoration: none;
}


/* ============================================================
   UTILITIES
   ============================================================ */

.d-none {
    display: none !important;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {

    .riepilogo-sticky {
        position: static;
        top: auto;
        width: 100%;
    }

    .preventivo-stepper {
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        padding: 15px 18px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .preventivo-stepper .step-item {
        flex: 0 0 auto;
    }

    .preventivo-stepper .step-line {
        flex: 0 0 25px;
        min-width: 25px;
        margin-left: 10px;
        margin-right: 10px;
    }

    .preventivo-stepper .step-label {
        flex-shrink: 0;
    }

    .preventivo-stepper .step-label span,
    .preventivo-stepper .step-label small {
        white-space: nowrap;
    }
}

@media (max-width: 767px) {

    .preventivo-page {
        padding-bottom: 40px;
    }

    .preventivo-header {
        padding-top: 25px;
        padding-bottom: 25px;
    }

    .preventivo-title {
        font-size: 2rem;
    }

    .preventivo-subtitle {
        font-size: 0.85rem;
    }

    .preventivo-card {
        padding: 20px;
        border-radius: 17px;
    }

    .card-header-custom {
        margin-bottom: 22px;
    }

    .card-header-custom h2 {
        font-size: 1.2rem;
    }

    .color-grid {
        gap: 5px;
    }

    .color-option {
        padding: 6px 8px;
    }

    .step-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .btn-primary-custom,
    .btn-secondary-custom {
        width: 100%;
    }
}

@media (max-width: 480px) {

    .preventivo-header {
        padding-left: 10px;
        padding-right: 10px;
    }

    .preventivo-card {
        padding: 15px;
    }

    .price-card-header {
        padding: 18px;
    }

    .price-card-body {
        padding: 18px;
    }
}