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

body {
    margin: 0;
    min-height: 100vh;
    padding: 30px;
    background: linear-gradient(135deg, #4C1D95, #6D28D9);
}

/* ========================
   CONTAINER PRINCIPAL
======================== */
.container {
    max-width: 1100px;
    margin: auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

/* ========================
   TÍTULOS
======================== */
h1 {
    margin: 20px 0;
    color: #4C1D95;
    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;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

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

.app-slogan {
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    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: #52525B;
    font-weight: 600;
}

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

.table tbody tr:hover {
    background: #F3E8FF;
}

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

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

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

.client-section h3 {
    margin: 0 0 16px;
    color: #4C1D95;
    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: #6D28D9;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15);
}

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

/* ===== PDF ===== */
#pdf-layout {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
    color: #000;
}

.pdf-page {
    padding: 30px;
}

.pdf-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    text-align: center;
}


.pdf-header h1 {
    font-size: 18px;          /* antes estava grande demais */
    font-weight: 500;
    color: #333;              /* menos roxo = mais profissional */
    margin: 0;
    letter-spacing: 0.3px;
}

.pdf-divider {
    width: 100%;
    height: 1px;
    background: #e5e5e5;
    margin-top: 22px;  /* mais espaço */
    padding-bottom: 10px;

}



.pdf-logo {
    max-height: 70px;
    max-width: 220px;
    object-fit: contain;
    margin-bottom: 18px; /* 🔥 AUMENTA O RESPIRO */
}


.pdf-section {
    margin-bottom: 25px;
}

.pdf-section h3 {
    margin-bottom: 10px;
    color: #6a2bd9;
}

.pdf-card {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px;
    background: #fafafa;
}

.pdf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.total-card {
    background: linear-gradient(135deg, #6D28D9, #7C3AED);
    color: #fff;
    text-align: center;
    font-size: 18px;
    border-radius: 12px;
    padding: 16px;
}



.pdf-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.pdf-logo {
    max-height: 60px;
    max-width: 200px;
    padding: 50px;
    object-fit: contain;
}

.pdf-header h1 {
    font-size: 26px;
    color: #6D28D9;
}



/* ========================
   BOTÕES
======================== */
.btn {
    background: #6D28D9;
    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: #4C1D95;
    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: #4C1D95;
}

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

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

.validade-section h3 {
    margin: 0 0 16px;
    color: #4C1D95;
    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: #6D28D9;
    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: #facc15; /* 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: #E5E7EB;
}

.app-footer .author {
    color: #FACC15; /* 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: #4C1D95;
  }
}


/* ========================
   SPLASH SCREEN (PONTOS)
======================== */
#splash {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #4C1D95, #6D28D9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    animation: fadeInScale 0.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: #fff;
    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: #eee;
    letter-spacing: 0.5px;
}

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