/**
    Tiquettes - Générateur d'étiquettes pour tableaux et armoires électriques
    Copyright (C) 2024-2026 Christophe LEMOINE

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

:root {
    --primary-color: darkcyan;
    --secondary-color: lightcyan;
    --secondary-color-light: rgb(240, 255, 255);
    --secondary-color-light-light: rgb(247, 255, 255);
    /* 24 modules */
        /* --content-size: 1800px; */
        /* 18 modules */
        /* --content-size: 1400px; */
        /* 13 modules */
        --content-size: 1152px;
}

:focus {
    outline: 0 !important;
}

::selection {
    background-color: var(--primary-color);
    color: white;
    /* border-color: #26a0da; */
}

@page {
    size: landscape;
    margin: 7mm;
    -ms-zoom: 100%;
    zoom: 100%;
    transform: scale(0);
    bleed: overlay;
    marks: cross;

    /*border: 1px solid #000;*/
}

@page :blank {
    visibility: hidden;
    display: none;
    height: 0;
}

@page :left {
    @top-center {
        content: "tiquettes.fr";
        font-family: sans-serif;
        font-size: 8pt;
        color: darkgray;
    }

    @bottom-center {
        content: "Page " counter(page) " / " counter(pages);
        font-family: sans-serif;
        font-size: 8pt;
        color: darkgray;
    }
}

@page :right {
    @top-center {
        content: "tiquettes.fr";
        font-family: sans-serif;
        font-size: 8pt;
        color: darkgray;
    }

    @bottom-center {
        content: "Page " counter(page) " / " counter(pages);
        font-family: sans-serif;
        font-size: 8pt;
        color: darkgray;
    }
}

body {


    font-family: sans-serif;
    position: relative;
    padding: 0;
    margin: 0;
    overflow-y: scroll;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

#content {
    margin-inline: auto;
    padding-inline: 1em;
    width: var(--content-size);
    max-width: calc(100% - 2em);
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 2em;
    justify-content: start;
    align-items: start;
    margin-bottom: 2em;
}

#root {
    width: 100%;
    margin-bottom: 1em;
}

img.disabled {
    pointer-events: none;
    filter: invert(95%) sepia(12%) saturate(0%) hue-rotate(167deg) brightness(83%) contrast(98%);
}

nav.header {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    margin-bottom: 1em;
}

nav.header ul {
    max-width: var(--content-size);
    margin-inline: auto;
    margin-block: 0;
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    padding-inline: 1.25em;
    padding-block: 0.5em;
}

nav.header ul li a {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: center;
    column-gap: 0.5em;
    padding-inline: 1em;
    padding-block: 0.75em;
    text-decoration: none;
    background-color: var(--primary-color);
    color: white;
    font-size: smaller;
    font-weight: 500;
    transition: all 200ms ease-out;
    border-radius: 7px;
}

nav.header ul li a img {
    filter: invert();
    transition: all 200ms ease-out;
}

nav.header ul li a:first-of-type {
    margin-left: -1em;
    margin-right: 1em;
}

nav.header ul li a:hover {
    background-color: var(--secondary-color);
    color: black;
}

nav.header ul li a:hover img {
    filter: initial;
}

.box {
    width: calc(100% - 2em);
    padding: 1em;
    border: 1px solid darkgray;
    border-radius: 7px;
}

.box h4 {
    margin-top: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 1em;
    padding: 0;
}

.box .box_list {
    list-style: none;
    margin: 0;
    padding: 0em;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1em;
}

.box .box_list li {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: stretch;
    gap: 0.75em;
    padding: 1em;
    width: calc(350px - 2em);
    max-width: calc(100% - 2em);
    background-color: #fbfbfb;
    border-top: 2px solid #f0f0f0;
    border-radius: 7px;
}

.box .box_list li:hover {
    background-color: #f0f0f0;
}

.box .box_list .box_list_title {
    font-size: normal;
    font-weight: bold;
}

.box .box_list .box_list_description {
    font-size: small;
    line-height: 1.3;
}

.box .box_list .box_list_link,
.box .box_list .box_list_link:visited {
    color: var(--primary-color);
    font-size: smaller;
    font-weight: bold;
    margin-block: 0.25em;
}

main {
    width: 100%;
}

h1 {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: center;
    gap: 0.25em;
    margin-bottom: 0;
    padding: 0;
}

h1 a {
    color: inherit;
    text-decoration: none;
}

h1 .version {
    font-size: small;
}

h1 sup {
    margin-top: -10px;
}

.by {
    margin-top: 0;
    margin-bottom: 3em;
    margin-left: 48px;
    color: var(--primary-color);
    font-size: 0.7em;
    font-weight: bold;
}

.description {
    margin-block-start: 0;
    margin-block-end: 2em;
    font-size: 1.1em;
    font-weight: bold;
    color: darkgray;
}

button,
.fakeButton {
    background-color: #f5f5f5;
    border: 1px solid darkgray;
    border-radius: 5px;
    min-height: 34px;
    min-width: 32px;
    font-weight: 500;
    padding-block: 0.4em;
    padding-inline: 0.8em;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    column-gap: 0.25em;
    transition: all 0.2s ease;
}

.fakeButton {
    width: calc(100% - 1.6em) !important;
    min-height: max-content !important;
    padding-block: 0.6em !important;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    column-gap: 0.5em;
}

button:not(:disabled):hover,
.fakeButton:not(:disabled):hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

button:disabled,
.fakeButton:disabled {
    cursor: default;
}

button:disabled img,
.fakeButton:disabled img {
    filter: opacity(0.4);
}

input[type="file"] {
    min-height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="file"]::-webkit-file-upload-button {
    min-height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select {
    background-color: #fff;
    border: 1px solid darkgray;
    border-radius: 5px;
    min-height: 28px;
    min-width: 28px;
    padding-inline: 0.5em;
    font-weight: 500;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
    min-height: 19px;
    min-width: 19px;
}

select {
    min-height: 34px;
    min-width: 19px;
}

select[multiple] {
    padding-block: 0.5em;
}

select[multiple] option {
    min-height: calc(23px - 0.30em);
    padding-top: 0.30em;
}

input[type="number"] {
    min-height: 30px !important;
    min-width: 19px !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
}

input[type="checkbox"],
input[type="radio"],
input[type="checkbox"]+label,
input[type="radio"]+label,
input[type="range"] {
    cursor: pointer;
}

label.disabled {
    opacity: 0.4;
}

.file_button .file_label {
    display: inline-block;
    background-color: #f5f5f5;
    border: 1px solid darkgray;
    border-radius: 5px;
    line-height: 19px;
    min-width: 19px;
    font-weight: 500;
    padding-block: 0.4em;
    padding-inline: 0.8em;
    cursor: pointer;
    font-size: smaller;
}

.file_button .file_label:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.file_button input[type="file"] {
    display: none;
}

.radio_group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
    align-items: center;
    gap: 0.5em;
    margin-block: 1em;
    transition: all 200ms ease-out;
}

.radio_group .radio {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: start;
    align-items: center;
    gap: 0.1em;
}

.radio_group .radio,
.radio_group .radio input,
.radio_group .radio label {
    cursor: pointer;
}

.radio_group .radio input {
    display: none;
}

.radio_group .radio label {
    border: 1px solid transparent;
    border-radius: 5px;
    height: 36px;
    min-width: 24px;
    padding-inline: 0.5em;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 200ms ease-out;
}

.radio_group .radio label:has(img) {
    width: 36px;
    padding-inline: 0;
}

.radio_group .radio label:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-color);
}

.radio_group .radio input:checked+label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.radio_group .radio input:checked+label img {
    filter: invert();
}

.pageLoader {
    width: 50px;
    aspect-ratio: 1;
    display: grid;
    border: 4px solid #0000;
    border-radius: 50%;
    border-right-color: var(--primary-color);
    animation: l15 1s infinite linear;
    margin-inline: auto;
    margin-block: 10em;
}

.pageLoader::before,
.pageLoader::after {
    content: "";
    grid-area: 1/1;
    margin: 2px;
    border: inherit;
    border-radius: 50%;
    animation: l15 2s infinite;
}

.pageLoader::after {
    margin: 8px;
    animation-duration: 3s;
}

@keyframes l15 {
    100% {
        transform: rotate(1turn)
    }
}

@media print {
    @page :blank {
        display: none;
    }

    #content,
    #root {
        width: 100%;
        margin: 0;
        padding: 0;
        max-width: initial;
        display: block;
    }

    main {
        margin: 0;
        padding: 0;
        max-width: initial;
        width: 100%;
        padding-inline: 0;
        padding-block: 10mm;
    }

    .printable {
        margin-inline: 10mm;
    }

    nav,
    h1,
    .by,
    .description {
        display: none;
    }

    .box {
        display: none;
    }
}

input[type="range"] {
    -webkit-appearance: none !important;
    ;
    appearance: none !important;
    ;
    background: transparent !important;
    ;
    cursor: pointer !important;
    ;
    border: none !important;
    height: 15px !important;
    padding-inline: 0 !important;
}

/***** Chrome, Safari, Opera, and Edge Chromium *****/
input[type="range"]::-webkit-slider-runnable-track {
    background: darkgray;
    height: 2px;
}

/******** Firefox ********/
input[type="range"]::-moz-range-track {
    background: darkgray;
    height: 2px;
}

/***** Chrome, Safari, Opera, and Edge Chromium *****/
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    /* Override default look */
    appearance: none;
    margin-top: -7px;
    /* Centers thumb on the track */
    background-color: var(--primary-color);
    height: 17px;
    width: 17px;
    border-radius: 50%;
    border: 2px solid #f5f5f5;
}

/***** Firefox *****/
input[type="range"]::-moz-range-thumb {
    background-color: var(--primary-color);
    height: 17px;
    width: 17px;
    border-radius: 50%;
    border: 2px solid #f5f5f5;
}

/* Removes default focus */
input[type="range"]:focus {
    outline: none;
}

.stepper {
    font-size: 80%;
    font-weight: bold;
    position: relative;
    counter-reset: step 0;
    width: 100%;
    margin: 2rem 0;
    display: flex;
    flex-flow: row nowrap;
    gap: 0;
    justify-content: space-around;
    align-items: flex-start;
}

.stepper>.step {
    position: relative;
    counter-increment: step;
    width: 100%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: flex-start;
    align-items: center;
}

.stepper>.step::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 2px;
    background: #f0f0f0;
    left: 0;
    top: 1.1rem;
}

.stepper>.step>.step-label {
    position: relative;
    width: 2.2rem;
    height: 2.2rem;
    line-height: 2.2rem;
    background: white;
    color: #555;
    text-align: center;
    border-radius: 50%;
    margin: 0 auto;
    border: 2px solid #f0f0f0;
}

.stepper>.step>.step-label::before {
    content: counter(step);
}

.stepper>.step.active::before {
    background: linear-gradient(to right, var(--primary-color), #f0f0f0);
}

.stepper>.step.active>.step-label {
    background: white;
    color: var(--primary-color);
    font-weight: bold;
    border-color: var(--primary-color);
}

.stepper>.step.completed::before {
    background: var(--primary-color);
}

.stepper>.step.completed>.step-label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.stepper>.step>.step-description {
    font-size: x-small;
    color: #777;
    margin-top: 0.5rem;
    overflow-wrap: break-word;
    hyphens: auto;
    text-align: center;
    text-transform: uppercase;
}

.stepper>.step.active>.step-description,
.stepper>.step.completed>.step-description {
    color: #555;
}

.stepper>.step.active>.step-description {
    font-weight: bold;
}
.blink {
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}