@charset "UTF-8";

/* INPUT FIELD */
.input-field {
    flex: 1;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    /* border-radius: 4px; */
    outline: none;
    transition: border-color 0.3s ease;
    min-width: 150px;
}

input.input-field {
    /* border: 1px solid #ccc; */
}

.input-field:focus {
    /* border-color: #772707; */
    /* box-shadow: 0 0 0 2px rgba(119, 39, 7, 0.3); */
    /* outline: none; */
}

.input-help {
    display: block;
    opacity: 1;
    font-size: 0.85rem;
    color: var(--color-muted);
    transition: opacity 0.25s ease, color 0.25s ease;
}

.field-vertical>.input-help {
    margin: 0.25rem;
    margin-bottom: 0;
}

.field-horizontal>.input-help {
    margin: 0.25rem;
}



/* INPUT GROUP */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    background-color: #dbc1b7;
}

.input-group-prepend,
.input-group-append {
    display: flex;
    align-items: center;
    justify-content: center;
    /* background: #dbc1b7; */
    color: #3b2e2a;
    padding: 0;
    /* border: 1px solid #dbc1b7; */
    white-space: nowrap;
    min-width: 2.5em;
}

.input-group input,
.input-group select,
.input-group textarea {
    flex: 1 1 auto;
    /* border: 1px solid #dbc1b7; */
    border: none;
    border-radius: 3px;
    padding: 0.5rem 0.75rem;
    min-width: 0;
}


/* Solo su desktop (min-width 768px o come preferisci), mostra help solo al focus */
@media (min-width: 768px) {
    .input-help {
        opacity: 0.8;
    }

    input:focus+.input-help,
    textarea:focus+.input-help,
    select:focus+.input-help {
        opacity: 1;
        color: var(--color-body-text);
    }
}


/* INPUT VERTICAL */
.field-vertical {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.field-vertical>.input-label {
    margin: 0.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}



/* INPUT HORIZONTAL */

.field-horizontal {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.field-horizontal>.input-label {
    width: 120px;
    margin: 0.25rem;
    margin-inline-end: 1em;
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    text-align: right;
    white-space: nowrap;
}

/* FOCUS */
/* .input-group {
    border: 1px solid #dbc1b7;
} */

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid #dbc1b7;
    border-radius: 4px;
    /* overflow: hidden; */
}

.input-group:focus-within {
    border-color: #772707;
    box-shadow: 0 0 0 2px rgba(119, 39, 7, 0.3);
    outline: none;
}

.input-group>*:first-child {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.input-group>*:last-child {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}


/* SWITCH */
.input-switch {
    display: flex;
    align-items: start;
    gap: 1em;
    cursor: pointer;
    user-select: none;
}

.input-switch input[type='checkbox'] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-label {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.switch-slider {
    width: 40px;
    height: 22px;
    background-color: #ccc;
    border-radius: 34px;
    position: relative;
    flex-shrink: 0;
    transition:
        background-color 0.3s var(--ease-standard),
        box-shadow 0.3s var(--ease-standard),
        transform 0.2s ease;
}

/* hover leggero come button */
.input-switch:hover .switch-slider {
    /* transform: translateY(-1px); */
}

/* knob */
.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;

    /* ✨ animazione moderna */
    transition:
        transform 0.3s var(--ease-standard),
        box-shadow 0.2s ease;

    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* stato ON */
.input-switch input:checked+.switch-slider {
    background-color: #772707;
}

/* movimento knob */
.input-switch input:checked+.switch-slider::before {
    transform: translateX(18px);
}

/* feedback attivo */
.input-switch input:checked+.switch-slider::before {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.input-switch:active .switch-slider::before {
    transform: scale(0.90);
}


/* Mobile: switch a destra, label a sinistra */
/* @media (max-width: 600px) {
    .input-switch {
        flex-direction: row-reverse;
    }
} */

select.input-field {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    min-width: 150px;
    cursor: pointer;
}


.optional-label {
    font-weight: 400;
    font-size: 0.85em;
    color: #666666;
    margin-left: 0.3em;
    user-select: none;

    select option.opt-separator {
        font-style: italic;
        font-weight: bold;
        background-color: var(--color-bg-alt);
        color: var(--color-text-muted);
    }
}