html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

:root {
    --tblr-primary: #90bd22 !important;
}

.card-selectable {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* permette di vedere prima l'immagine poi il titolo in fondo */
    margin-bottom: 20px; /* spazio tra le righe */
    overflow: visible;
}

.card-selectable-opt {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* permette di vedere prima l'immagine poi il titolo in fondo */
    margin-bottom: 20px; /* spazio tra le righe */
    overflow: visible;
}

.card-widget-image-vert-s {
    background-size: contain;         /* Cambiato da auto 100% a cover */
    background-position: center;
    background-repeat: no-repeat;
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;               /* Nasconde tutto ciò che esce dal box */
}
.card-widget-image-vert-m {
    background-size: contain;         /* Cambiato da auto 100% a cover */
    background-position: center;
    background-repeat: no-repeat;
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;               /* Nasconde tutto ciò che esce dal box */
}

.card-widget-image-vert-l {
    background-size: contain;         /* Cambiato da auto 100% a cover */
    background-position: center;
    background-repeat: no-repeat;
    height: 150px;
    min-height: 150px;
    max-height: 150px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;               /* Nasconde tutto ciò che esce dal box */
}

.card-widget-image-vert-xl {
    background-size: contain;         /* Cambiato da auto 100% a cover */
    background-position: center;
    background-repeat: no-repeat;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;               /* Nasconde tutto ciò che esce dal box */
}


.card-widget-title {
    width: 100%;
    background: #f5f5f5 !important;
    color: #222 !important;
    display: block;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    margin: 0;
    min-height: 44px;
    border-top: 1px solid #ececec;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: background 0.2s;
    /* Aggiungi:
       margin-bottom per separare la card dalla riga sotto
    */
    margin-bottom: 2px;
}

.card-widget-image {
    background-size:cover; 
    background-position:center; 
    height:75px; 
    min-height:75px; 
    max-height:75px;
}

.card-widget {
    height:75px;
    min-height:75px;
    max-height:75px;
}

.card-color-preview-s {
    height: 50px;
    min-height: 50px;
    max-height: 50px;
    border-radius: 8px 8px 0 0;
    width: 100%;
    /* Così come l'immagine: parte alta della card */
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.card-color-preview-m {
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    border-radius: 8px 8px 0 0;
    width: 100%;
    /* Così come l'immagine: parte alta della card */
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card-color-preview-l {
    height: 150px;
    min-height: 150px;
    max-height: 150px;
    border-radius: 8px 8px 0 0;
    width: 100%;
    /* Così come l'immagine: parte alta della card */
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.card-color-preview-xl {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    border-radius: 8px 8px 0 0;
    width: 100%;
    /* Così come l'immagine: parte alta della card */
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.optSelected{
    border: 3px solid green !important;
}

.timeline{
    position:relative;
    padding-left: 32px;
}
.timeline-step {
    position:relative;
    margin-bottom:24px;
    min-height:36px;
}
.timeline-step:last-child {
    margin-bottom:0;
}
.timeline-flag {
    position:absolute;
    left:-28px;
    top:3px;
    width:20px;
    height:20px;
    border-radius:50%;
    background:#e0e0e0;
    border:2px solid #bbb;
    display:inline-block;
    transition:background 0.2s, border 0.2s;
    text-align:center;
    font-size:14px;
    line-height:18px;
}
.timeline-step.completed{
    cursor: pointer;
}

.timeline-step.completed .timeline-flag {
    background:#28a745;
    border-color:#1e7e34;
    color:#fff;
}
.timeline-step .timeline-flag:after{
    content: '\2713';
    opacity:0;
    transition:opacity 0.2s;
    font-weight:bold;
    display:block;
}
.timeline-step.completed .timeline-flag:after{
    opacity:1;
}


/*Allargo la dimensione della pagina*/
@media (min-width: 1400px) {
    .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: 90%;
    }
}

/*Mirino*/
/* === Contenitore principale === */
.trim-stage.compact{
    position:relative;
    width:min(560px, 100%);
    margin:0 auto;
    height:240px;               /* Altezza compatta */
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    box-shadow:0 4px 12px rgba(0,0,0,.06);
}

/* === Immagine centrale === */
.trim-image{
    position:absolute;
    inset:20% 22%;              /* margini interni */
    max-width:56%;
    max-height:60%;
    object-fit:contain;
    background:#fff;
    border:1px dashed #cbd5e1;
    border-radius:12px;
}

/* === Controlli (pillole) === */
.trim-ctrl{
    position:absolute;
    display:flex;
    align-items:center;
    gap:.5rem;
    padding:.25rem .5rem;
    background:#ffffffd9;
    border:1px solid #e5e7eb;
    border-radius:999px;
    box-shadow:0 2px 6px rgba(0,0,0,.06);
}

/* Etichette "Sopra/Sotto/Sinistra/Destra" */
.trim-label{
    font-size:.75rem;
    font-weight:600;
    color:#334155;
    margin:0;
}

/* Wrapper per select + unità */
.trim-input{
    display:flex;
    align-items:center;
    gap:.25rem;
}

/* Dropdown compatto */
.trim-input .form-control{
    min-width: 120px;
}

/* Etichetta "mm" */
.unit-label{
    font-size:.75rem;
    font-weight:500;
    color:#475569;
}

/* === Posizionamenti attorno all’immagine === */
.trim-ctrl-top   { top:0; left:50%; transform:translate(-50%,-40%); }
.trim-ctrl-bottom{ bottom:0; left:50%; transform:translate(-50%,40%); }
.trim-ctrl-left  { left:0; top:50%; transform:translate(-40%,-50%); }
.trim-ctrl-right { right:0; top:50%; transform:translate(40%,-50%); }

/* === Responsività (mobile) === */
@media (max-width: 576px){
    .trim-stage.compact{
        height:auto;
        padding-bottom: 260px; /* spazio per i controlli sotto */
    }
    .trim-ctrl{
        position:static;
        transform:none;
        margin:.35rem auto 0;
        width:min(420px, 92%);
        justify-content:space-between;
    }
}

.trim-stage.compact .trim-image{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%, -50%); /* centra in entrambi gli assi */
    max-width:56%;
    max-height:60%;
    width:auto;
    height:auto;
    object-fit:contain;
    background:#fff;
    border:1px dashed #cbd5e1;
    border-radius:12px;
}

/* (facoltativo) se vuoi leggermente più grande o più piccolo */
@media (min-width: 768px){
    .trim-stage.compact .trim-image{
        max-width:60%;
        max-height:70%;
    }
}

.step-no-border{
    padding-left: 0 !important;
    border-left: 0 !important;
}

.modal-config{
    margin-left: 20px !important;
    margin-right: 20px !important;
}

@media (min-width: 576px) {
    .modal-config{
        max-width: 97% !important;
    }
}

.reset-flash {
    --flash-color: var(--tblr-info, rgb(var(--bs-info-rgb, 58,167,255)));
    outline: 2px solid var(--flash-color);
    border-radius: .6rem;

    will-change: box-shadow, transform, opacity;

    animation: resetFlashSmooth 1.6s cubic-bezier(.22,.61,.36,.50) both;
}

@keyframes resetFlashSmooth {

    0% {
        box-shadow: 0 0 0 .75rem color-mix(in srgb, var(--flash-color) 45%, transparent);
        transform: translateZ(0) scale(1.01);
        opacity: 1;
    }

    35% {
        box-shadow: 0 0 0 .55rem color-mix(in srgb, var(--flash-color) 32%, transparent);
        transform: scale(1.005);
    }

    70% {
        box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--flash-color) 18%, transparent);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--flash-color) 0%, transparent);
        opacity: 1;
    }
}

#PaeseSelect .dx-dropdowneditor-input-wrapper,
#PaeseSelectModal .dx-dropdowneditor-input-wrapper {
    display: block;
    width: 100%;
    height: 40px;
    background-color: var(--tblr-bg-forms);
    border: var(--tblr-border-width) solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    box-shadow: var(--tblr-shadow-input);
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    padding: 0;
}

/* Input visibile dentro al SelectBox */
#PaeseSelect .dx-texteditor-input,
#PaeseSelectModal .dx-texteditor-input {
    border: none;
    background: transparent;
    box-shadow: none;
    height: 100%;
    padding: .5625rem 1rem;
    font-family: var(--tblr-body-font-family);
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.25rem;
    color: var(--tblr-body-color);
}

/* Stato focus, come gli altri .form-control  */
#PaeseSelect.dx-state-focused .dx-dropdowneditor-input-wrapper,
#PaeseSelectModal.dx-state-focused .dx-dropdowneditor-input-wrapper {
    border-color: #258cfb;
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #258cfb;
}

/* Nascondo il placeholder nativo dell'input dentro al SelectBox */
#PaeseSelect .dx-texteditor-input::placeholder,
#PaeseSelectModal .dx-texteditor-input::placeholder {
    color: transparent;
}

/* Allineo il placeholder DevExtreme al padding degli altri input */
#PaeseSelect .dx-placeholder,
#PaeseSelectModal .dx-placeholder {
    left: 0.5rem; /* stesso padding-left delle .form-control */
}

/* Per sovrascrivere i css di devexpress del selectbox per il campo Paese del preventivo */
#PaeseSelect.dx-selectbox.dx-editor-outlined,
#PaeseSelectModal.dx-selectbox.dx-editor-outlined {
    background-color: var(--tblr-bg-forms) !important;
    border: none !important;
    border-radius: var(--tblr-border-radius) !important;
    box-shadow: none !important;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}
