/* ========================
   RESET & BASE
======================== */
* {
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 30px;
    background: rgb(255, 255, 255);
}

/* ========================
   CONTAINER PRINCIPAL
======================== */


.container {
    max-width: 1300px;
    margin: auto;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 32px;
}

/* ========================
   TÍTULOS
======================== */
h1 {
    margin: 20px 0;
    color: #00a756;
    font-size: 26px;
}

/* ========================
   CABEÇALHO
======================== */
.app-header {
    width: 100%;
    padding: 32px 16px 24px;
    background: transparent;
    /* mantém o fundo padrão do app */
    display: flex;
    align-items: center;
    flex-direction: column;
}

.app-logo {
    width: 430px;
    max-width: 100%;
    height: auto;
}

.app-slogan {
    font-size: 1rem;
    font-weight: 500;
    color: #000000;
    text-align: center;
    letter-spacing: 0.4px;
}

@media (max-width: 480px) {
    .app-logo {
        width: 90%;
    }

    .app-slogan {
        font-size: 0.9rem;
    }
}

/* ========================
   TABELA
======================== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px;
    border-bottom: 1px solid #E5E7EB;
    text-align: center;
    font-size: 14px;
}

.table th {
    background: #F4F4F5;
    color: #0a0432;
    font-weight: 600;
}

.table tbody tr {
    background: #FAFAFA;
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: #00f07c18;
}

/* ========================
   INPUTS
======================== */
input {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #E4E4E7;
    font-size: 14px;
}

input:focus {
    outline: none;
    border-color: #00f07c;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15);
}

/* ========================
   DADOS DO CLIENTE
======================== */
.client-section {
    background: #f5f5f5;
    max-width: 1300px;
    margin: auto;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid #E5E7EB;
}


.client-section h3 {
    margin: 0 0 16px;
    color: #00a756;
    font-size: 18px;
}

.client-section h3 span {
    font-size: 13px;
    color: #71717A;
    font-weight: 400;
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.client-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #E4E4E7;
    resize: vertical;
    font-family: 'Inter', sans-serif;
}

.client-section textarea:focus {
    outline: none;
    border-color: #00a756;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15);
}

/* Responsivo */
@media (max-width: 768px) {
    .client-grid {
        grid-template-columns: 1fr;
    }
}

/*
===========
PDF
===========
*/

#btnGerarPDF {
    background: linear-gradient(135deg, #00a756, #05c96b);
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgb(8, 134, 25);
}

/* ÁREA INVISÍVEL DO PDF */
.pdf-hidden {
  position: fixed;
  left: -9999px;
  top: 0;
  background: #fff;
}

/* PÁGINA A4 */
.pdf-page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 25mm 20mm;
  font-family: Arial, sans-serif;
  color: #000;
  background: #fff;
}

/* HEADER */
.pdf-header {
  text-align: center;
  margin-bottom: 30px;
}

.pdf-header h1 {
  color: #000000;
  font-size: 30px;
  margin-top: 10px;
}

/* LOGO */
.pdf-logo {
  max-height: 150px;
  display: block;
  margin: 0 auto 10px auto;
}

/* SEÇÕES */
.pdf-section {
  margin-bottom: 25px;
}

.pdf-section h3 {
  color: #000000;
  font-size: 18px;
  margin-bottom: 10px;
}

/* DADOS E ITENS */
#pdf-cliente p,
#pdf-produtos .pdf-item {
  border: 1px solid #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #000;
}

/* TOTAL */
.pdf-total {
  margin: 30px auto;
  background: #05c96b;
  color: #fff;
  text-align: center;
  padding: 18px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 10px;
}

/* FOOTER */
.pdf-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
  color: #000;
}



/* ========================
   BOTÕES
======================== */
.btn {
    background: #05c96b;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
}

.btn:hover {
    background: #00f07c;
    transform: translateY(-2px);
}

.btn-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.btn-danger:hover {
    background: #FECACA;
}


/* Botão remover - MOBILE */
@media (max-width: 768px) {
    .btn-danger {
        width: 36px;
        height: 36px;
        padding: 0;
        font-size: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ========================
   RODAPÉ / TOTAL
======================== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 32px;
    gap: 24px;
}

.summary {
    max-width: 320px;
    width: 100%;
    background: #F4F4F5;
    padding: 22px;
    border-radius: 16px;
}

.summary div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.summary span {
    font-size: 14px;
    color: #52525B;
}

.summary strong {
    font-size: 22px;
    color: #05c96b;
}

/* Linha divisória */
.divider {
    border: none;
    height: 1px;
    background: #E5E7EB;
    margin-bottom: 28px;
}

/* ========================
   VALIDADE & ASSINATURA
======================== */
.validade-section {
    background: #f5f5f5;
    max-width: 1300px;
    margin: auto;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid #E5E7EB;
}

.validade-section h3 {
    margin: 0 0 16px;
    color: #00a756;
    font-size: 18px;
}

.validade-section h3 span {
    font-size: 13px;
    color: #71717A;
    font-weight: 400;
}

.validade-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.validade-section label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #52525B;
}

.validade-section textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #E4E4E7;
    resize: vertical;
}

.validade-section textarea:focus {
    outline: none;
    border-color: #00a756;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15);
}


/* ========================
   CONTATO
======================== */
.contact-section {
    padding: 40px 20px;
    text-align: center;
    color: #fff;
}

.contact-section h2 {
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 18px;
}

.contact-icons a {
    width: 56px;
    height: 56px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-icons a i {
    font-size: 22px;
    color: #00a756;
    /* amarelo */
}

.contact-icons a:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 480px) {
    .contact-icons a {
        width: 52px;
        height: 52px;
    }

    .contact-icons a i {
        font-size: 20px;
    }
}


/* ========================
   FOOTER
======================== */
.app-footer {
    margin-top: 30px;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #000;
}

.app-footer .author {
    color: #00a756;
    /* amarelo */
    font-weight: 700;
}


@media (max-width: 768px) {
    .validade-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================
   RESPONSIVO
======================== */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .container {
        padding: 24px;
    }

    .footer {
        flex-direction: column;
    }

    .summary {
        max-width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .header-right {
        text-align: center;
    }
}

/* ========================
   IMPRESSÃO / PDF
======================== */
@media print {
    body {
        background: #ffffff;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    .btn {
        display: none;
    }
}




/* ===== ÁREA REAL DE RENDERIZAÇÃO DO PDF ===== */
.pdf-render-area {
    position: relative;
    width: 794px;
    /* A4 em px */
    min-height: 1123px;
    /* A4 em px */
    background: #ffffff;
    margin: 40px auto;
    padding: 30px;
    display: none;
    z-index: 9999;
}


/*
======================
REPSONSIVIDADE CELULAR
======================
*/

@media (max-width: 768px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tbody tr {
        margin-bottom: 16px;
        padding: 12px;
        border-radius: 12px;
        background: #FAFAFA;
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #000000;
    }
}


/* ========================
   SPLASH SCREEN (PONTOS)
======================== */
#splash {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    animation: fadeInScale 3.8s ease forwards;
}

.splash-logo {
    width: 440px;
    max-width: 80%;
    margin-bottom: 24px;
}

/* Loader de pontos */
.dots-loader {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.dots-loader span {
    width: 8px;
    height: 8px;
    background: #00a756;
    border-radius: 50%;
    animation: dots 1.4s infinite ease-in-out both;
}

.dots-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.dots-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dots {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.splash-text {
    font-size: 14px;
    color: #000000;
    letter-spacing: 0.5px;
}

/* Entrada suave */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   RESPONSIVO - ORÇAMENTO
========================= */
@media (max-width: 768px) {

    #productTable thead {
        display: none;
    }

    #productTable,
    #productTable tbody,
    #productTable tr,
    #productTable td {
        display: block;
        width: 100%;
    }

    #productTable tr {
        background: #fafafa;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 12px;
    }

    #productTable td {
        display: flex;
        flex-direction: column;
        margin-bottom: 10px;
    }

    #productTable td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 600;
        color: #666;
        margin-bottom: 4px;
    }

    #productTable input {
        width: 100%;
    }

    .btn-danger {
        align-self: flex-end;
    }
}
