/* ====== GERAL ====== */
:root {
    --purple-main: #5c0b5c;
    /* roxo da logo */
    --purple-accent: #a713cc;
    /* roxo vivo */
    --gold-accent: #ff9f0a;
    /* dourado da logo */

    --bg-main: #f2f2f2;
    --bg-card: #ffffff;
    --bg-input: #f7f7f7;

    --text-main: #1f1f1f;
    --text-muted: #6b6b6b;
}


/* ====== BASE ====== */
body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(180deg, #ececec, #f7f7f7);
    color: var(--text-main);
    min-height: 100vh;
}

.form-container {
    display: none;
    max-width: 460px;
    margin: 40px auto;
    gap: 5px;
    background: var(--bg-card);
    padding: 28px;
    border-radius: 18px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, .08);
}


h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--purple-main);
}

h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 20px;
}

h2 {
    margin-top: 25px;
    font-size: 16px;
    color: var(--purple-main);
}

label {
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--text-muted);
}

input,
textarea,
select {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 12px;
    margin-top: 6px;
    background: var(--bg-input);
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 14px;
    transition: .25s;

}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--purple-accent);
    box-shadow: 0 0 0 3px rgba(167, 19, 204, .15);
    margin-bottom: 10px;
}

button {
    margin-top: 28px;
    padding: 14px;
    width: 100%;
    background: linear-gradient(135deg,
            var(--purple-main),
            var(--purple-accent));
    border-radius: 14px;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .3s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(92, 11, 92, .25);
}

.fake-btn {
    margin-top: 28px;
    padding: 14px;
    width: fit-content;
    text-decoration: none;
    background: linear-gradient(135deg,
            var(--purple-main),
            var(--purple-accent));
    border-radius: 14px;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: .3s;
}

.fake-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(92, 11, 92, .25);
}

.btn_ico {
    width: fit-content;
    margin: 0;
}

.horizontal-div {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.horizontal-div * {
    margin: 0;
}

/* == VISUALIZAÇÃO PDF == */
.form-container.show {
    display: block;
}


/* ====== TOGGLE ====== */
.toggle {
    display: flex;
    background: #e6e6e6;
    border-radius: 999px;
    padding: 4px;
    margin: 20px 0;
    position: relative;
}

.toggle a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    z-index: 1;
}

.toggle a.active {
    color: #fff;
}

.toggle::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg,
            var(--purple-main),
            var(--purple-accent));
    border-radius: 999px;
    transition: .35s cubic-bezier(.4, 0, .2, 1);
}

.toggle.second-active::before {
    transform: translateX(100%);
}

/* ====== EXEMPLO ====== */
.font_exe {
    font-size: 30px;
    line-height: 60px;
    color: var(--text-muted);
    margin-top: 10px;
}



/* ====== ABAS ====== */
.tab {
    display: none;
    width: 100%;
    height: 100%;
    padding: 0;
}

.tab.active {
    display: block;
}

.close-page {
    margin-bottom: 20px;
}

/* ABA Visualizar OS */
#view-os {
    display: flex;
    flex-direction: column;
    margin-top: 15px;
    border-radius: 10px;
    color: var(--text-muted);
    overflow-x: hidden;
    gap: 5px;
}

.os-box {
    display: flex;
    border: var(--text-muted) 1px solid;
    background-color: var(--bg-input);
    border-radius: 10px;
    padding: 10px;
    justify-content: space-between;
    align-items: center;

}

.os-box select,
.os-box select:active,
.os-box select:focus {
    padding: 0;
    border: none;
    padding: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    color: var(--text-muted);
    font-size: small;
    gap: 0;
}

.os-box div {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--purple-accent);
}

.box_origem {
    width: 100px;
}

#view-os p {
    overflow: hidden;
    font-size: small;
    color: var(--text-muted);
}

#view-os a {
    overflow: hidden;
    text-wrap: nowrap;
    color: var(--purple-main);
}

.detalhe {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.os-print {
    page-break-after: always;
    font-size: 11pt;
    color: #000;
}

.os-print h2 {
    text-align: center;
    margin-bottom: 10px;
}

.os-header {
    text-align: center;
    margin-bottom: 10px;
}

.linha {
    border-bottom: 1px dashed #000;
    margin: 10px 0;
}

#printArea h1 {
    font-size: 14pt;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
}

#printArea h2 {
    font-size: 20px;
}

.nome-header {
    font-size: 14pt;
    font-weight: lighter;
    text-align: center;
    margin: 15px 0;
}

.nome-destaque {
    font-size: 24pt;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    word-wrap: break-word;
    white-space: pre-wrap;
    /* Mantém o formato exato digitado */
}

.obs-box {
    font-size: 10pt;
    margin-top: 10px;
    border: 1px solid black;
    padding: 8px;
    min-height: 40px;
    white-space: pre-wrap;
}

.rodape_print {
    font-size: 10pt;
    margin-top: 10px;
    text-align: center;
}


#printArea {
    width: 80mm;
    padding: 4mm;
    font-family: 'Courier New', Courier, monospace;
    min-height: auto;
    color: black;
    height: auto;

    * {
        color: black !important;
    }
}


/* ====== PACK SEM NOME ====== */

.inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

/* Esconde checkbox padrão */
.inline-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid #ccc;
    background: var(--bg-input);
    display: grid;
    place-content: center;
    transition: .25s;
    cursor: pointer;
}

/* Check visual */
.inline-check input[type="checkbox"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 4px;
    background: linear-gradient(135deg,
            var(--purple-main),
            var(--purple-accent));
    transform: scale(0);
    transition: .2s ease-in-out;
}

/* Checked */
.inline-check input[type="checkbox"]:checked {
    border-color: var(--purple-accent);
    box-shadow: 0 0 0 3px rgba(167, 19, 204, .15);
}

.inline-check input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Hover */
.inline-check:hover input[type="checkbox"] {
    border-color: var(--purple-accent);
}

/* Campo quantidade */
#qtdPack {
    margin-top: 6px;
}

/* Label da quantidade */
#qtdPackLabel {
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--text-muted);
}

/* Desabilitado (textarea nomes) */
#nomesPack:disabled {
    opacity: .45;
    cursor: not-allowed;
    background: repeating-linear-gradient(45deg,
            #f5f5f5,
            #f5f5f5 10px,
            #ededed 10px,
            #ededed 20px);
}

/* ====== OCULTAR NOMES QUANDO "SEM NOME" ATIVO ====== */

/* Esconde textarea de nomes */
.tab-pack:has(#packSemNome:checked) #nomesPack {
    display: none;
}

/* Opcional: remove também o label acima */
.tab-pack:has(#packSemNome:checked) label[for="nomesPack"] {
    display: none;
}




/* =========================
   PAGE LOADER
========================= */
.page_loader {
    opacity: 1;
    visibility: visible !important;
    position: fixed ! important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* Acima de tudo (inclusive modais) */
    transition: all 0.5s ease-in-out;
}

/* Quando o loader sumir */
.page_loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader_content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader_content p {
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: var(--purple);
    animation: pulse 1.5s infinite ease-in-out;
}

/* O Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--purple-main);
    border-top: 3px solid var(--purple-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

@media print {
    @page {
        margin: 0;
        size: 80mm auto;
    }

    body {
        background: white;
        margin: 0;
        padding: 0;
    }

    body * {
        visibility: hidden;
        color: #000;
    }

    #printArea,
    #printArea * {
        visibility: visible;
    }

    #printArea {
        position: absolute;
        left: 0;
        top: 0;
        display: block !important;
        font-family: 'Courier New', Courier, monospace;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .form-container {
        display: none;
    }

    .os-footer {
        margin-top: 24px;
        text-align: center;
    }

    #qrcode {
        display: block;
        margin: 0 auto 6px;
    }
}
