/* ============================================================
   CefaloAnalise - Implanto Odontologia Especializada
   Tema: Fendi + Laranja Hermès
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --fendi-escuro: #e8dcc8;
    --fendi-medio: #f0e6d6;
    --fendi-claro: #d4c4aa;
    --fendi-suave: #c8b898;
    --fendi-bg: #f5f0e4;
    --fendi-texto: #4a3f32;
    --hermes: #f37021;
    --hermes-hover: #ff8c42;
    --hermes-suave: rgba(243, 112, 33, 0.10);
    --texto-claro: #3d3226;
    --texto-medio: #7a6b58;
    --branco: #ffffff;
    --cinza-bg: #f5f2ee;
    --cinza-borda: #d4ccc2;
    --vermelho: #c0392b;
    --verde: #27ae60;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(74, 63, 50, 0.15);
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--fendi-bg);
    color: var(--texto-claro);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- Header --- */
.header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--branco);
    border-bottom: 3px solid var(--hermes);
    box-shadow: var(--shadow);
}

.header-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 72px;
    width: auto;
    border-radius: 4px;
}

.logo-dra {
    height: 65px;
    width: auto;
    border-radius: 4px;
}

.logo-separator {
    width: 1px;
    height: 40px;
    background: var(--fendi-claro);
    opacity: 0.5;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hermes);
    letter-spacing: 0.5px;
}

.header-text p {
    font-size: 0.82rem;
    color: var(--texto-medio);
    margin-top: -2px;
}

/* --- Container --- */
.container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* --- Secoes --- */
.secao {
    margin-bottom: 2rem;
}

.secao h2 {
    font-size: 1.3rem;
    color: var(--hermes);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--fendi-claro);
    padding-bottom: 0.4rem;
}

.secao-descricao {
    font-size: 0.9rem;
    color: var(--texto-medio);
    margin-bottom: 1.2rem;
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--hermes);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, transform 0.15s;
    background: var(--branco);
}

.drop-zone:hover,
.drop-zone.drag-over {
    background: var(--hermes-suave);
    border-color: var(--hermes-hover);
    transform: scale(1.01);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    color: var(--hermes);
    margin-bottom: 0.8rem;
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--texto-claro);
    margin-bottom: 0.3rem;
}

.drop-hint {
    font-size: 0.8rem;
    color: var(--texto-medio);
}

/* --- File Info --- */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--branco);
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    margin-top: 0.8rem;
    border: 1px solid var(--fendi-claro);
}

.file-info span {
    font-size: 0.9rem;
    color: var(--hermes);
    font-weight: 500;
}

/* --- Loading --- */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--texto-medio);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--fendi-claro);
    border-top-color: var(--hermes);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.8rem;
}

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

/* --- Cards --- */
.card {
    background: var(--branco);
    border: 1px solid var(--fendi-claro);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow);
}

.card-titulo {
    font-size: 1.05rem;
    color: var(--hermes);
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--fendi-claro);
}

/* --- Campos Paciente --- */
.campos-paciente {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.campos-paciente .campo:first-child {
    grid-column: 1 / -1;
}

.campo label {
    display: block;
    font-size: 0.8rem;
    color: var(--texto-medio);
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.campo input,
.campo select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--fendi-claro);
    border-radius: 4px;
    background: var(--fendi-bg);
    color: var(--fendi-texto);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.campo input:focus,
.campo select:focus {
    outline: none;
    border-color: var(--hermes);
    box-shadow: 0 0 0 2px var(--hermes-suave);
}

.campo-sm {
    max-width: 160px;
}

/* --- Campos Medidas --- */
.campos-medidas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.2rem;
}

.campo-medida label {
    display: block;
    font-size: 0.78rem;
    color: var(--texto-medio);
    margin-bottom: 0.15rem;
    font-weight: 500;
}

.campo-inline {
    display: flex;
    gap: 0.4rem;
}

.campo-inline input {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--fendi-claro);
    border-radius: 4px;
    background: var(--fendi-bg);
    color: var(--fendi-texto);
    font-size: 0.85rem;
    transition: border-color 0.2s;
}

.campo-inline input:first-child {
    flex: 1;
    min-width: 0;
}

.campo-inline input:focus {
    outline: none;
    border-color: var(--hermes);
    box-shadow: 0 0 0 2px var(--hermes-suave);
}

.campo-inline .norma {
    width: 90px;
    flex-shrink: 0;
    background: rgba(243, 112, 33, 0.06);
    color: var(--hermes);
    border-color: transparent;
    text-align: center;
    font-size: 0.78rem;
    cursor: default;
}

/* --- Campo vazio (nao extraido do PDF) --- */
.campo-vazio {
    border-color: var(--vermelho) !important;
    background: rgba(192, 57, 43, 0.08) !important;
}

/* --- Botoes --- */
.btn-principal {
    display: inline-block;
    padding: 0.7rem 2rem;
    background: var(--hermes);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.3px;
}

.btn-principal:hover {
    background: var(--hermes-hover);
    transform: translateY(-1px);
}

.btn-principal:active {
    transform: translateY(0);
}

.btn-secundario {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    background: transparent;
    color: var(--hermes);
    border: 1px solid var(--hermes);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-secundario:hover {
    background: var(--hermes-suave);
    color: var(--hermes-hover);
}

.acoes-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--fendi-claro);
}

.acoes-relatorio {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

/* --- Relatorio --- */
.relatorio {
    background: var(--branco);
    color: var(--fendi-texto);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    line-height: 1.7;
    font-size: 0.95rem;
}

.relatorio h3 {
    color: var(--fendi-escuro);
    margin: 1.2rem 0 0.6rem;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--hermes);
    padding-bottom: 0.3rem;
}

.relatorio table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8rem 0;
}

.relatorio th,
.relatorio td {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--cinza-borda);
    text-align: left;
    font-size: 0.85rem;
}

.relatorio th {
    background: var(--cinza-bg);
    font-weight: 600;
    color: var(--fendi-escuro);
}

.placeholder-relatorio {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 3rem 0;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: var(--texto-medio);
    border-top: 1px solid var(--fendi-claro);
    margin-top: 2rem;
}

/* --- Print Styles --- */
@media print {
    .no-print,
    .header,
    .footer,
    #secao-upload,
    #secao-verificacao,
    .acoes-relatorio {
        display: none !important;
    }

    body {
        background: white;
        color: #2c2016;
    }

    .container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    #secao-relatorio {
        display: block !important;
    }

    .relatorio {
        box-shadow: none;
        border-radius: 0;
        padding: 1rem;
    }
}

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

    .campos-paciente {
        grid-template-columns: 1fr;
    }

    .campo-sm {
        max-width: 100%;
    }

    .header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .container {
        padding: 0 1rem;
    }

    .header-logos {
        gap: 0.5rem;
    }
}
