* {
    box-sizing: border-box;
}

:root {
    --cor-principal: #355c4b;
    --cor-principal-escura: #294638;
    --cor-secundaria: #d8a75b;
    --cor-fundo: #f3f5f1;
    --cor-card: #ffffff;
    --cor-texto: #26332d;
    --cor-texto-suave: #66736c;
    --cor-borda: #dfe5df;
    --sombra: 0 4px 14px rgba(30, 55, 40, 0.08);
}

body {
    font-family: Arial, sans-serif;
    background: var(--cor-fundo);
    margin: 0;
    padding: 0;
    color: var(--cor-texto);
    font-size: 14px;
}

/* TOPO */

.topo {
    background: linear-gradient(135deg, var(--cor-principal), var(--cor-principal-escura));
    color: white;
    padding: 16px 20px;
    box-shadow: var(--sombra);
}

.topo h1 {
    margin: 0 0 10px 0;
    font-size: 21px;
    font-weight: 700;
}

.topo a {
    display: inline-block;
    background: rgba(255,255,255,0.14);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-right: 6px;
    margin-top: 6px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.18);
}

.topo a:hover {
    background: rgba(255,255,255,0.24);
}

/* CONTAINERS */

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
}

.card {
    background: var(--cor-card);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--sombra);
    border: 1px solid var(--cor-borda);
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--cor-principal-escura);
}

.card h3 {
    font-size: 18px;
}

.card h2 {
    font-size: 19px;
}

.card p {
    margin: 5px 0;
    line-height: 1.4;
}

/* FORMULÁRIOS */

.login-box,
.form-box {
    width: 100%;
    max-width: 520px;
    margin: 32px auto;
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--sombra);
    border: 1px solid var(--cor-borda);
}

.form-box-largo {
    max-width: 760px;
}

.login-box h2,
.form-box h2 {
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--cor-principal-escura);
}

label {
    font-weight: 700;
    font-size: 13px;
    color: var(--cor-principal-escura);
}

input,
textarea,
button,
select {
    width: 100%;
    padding: 10px 11px;
    margin-top: 6px;
    margin-bottom: 13px;
    border-radius: 9px;
    border: 1px solid var(--cor-borda);
    font-size: 14px;
    background: white;
    color: var(--cor-texto);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--cor-principal);
    box-shadow: 0 0 0 3px rgba(53, 92, 75, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button {
    background: var(--cor-principal);
    color: white;
    cursor: pointer;
    border: none;
    font-weight: bold;
}

button:hover {
    background: var(--cor-principal-escura);
}

/* BOTÕES */

.form-box a,
.btn-card {
    display: inline-block;
    background: var(--cor-principal);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-right: 6px;
    margin-top: 8px;
    font-size: 13px;
}

.form-box a:hover,
.btn-card:hover {
    background: var(--cor-principal-escura);
}

.badge {
    display: inline-block;
    background: #edf3ee;
    color: var(--cor-principal-escura);
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #d5e2d7;
}

.erro {
    color: #b00020;
    font-weight: bold;
}

/* FOTOS */

.foto-ocorrencia {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 10px;
    margin-top: 8px;
    border: 1px solid var(--cor-borda);
}

/* FICHA DO ANIMAL */

.registro-ficha {
    border-top: 1px solid var(--cor-borda);
    padding: 10px 0;
}

.registro-ficha:first-of-type {
    border-top: none;
}

.registro-ficha p {
    margin: 5px 0;
}

/* IMPRESSÃO */

.area-impressao {
    max-width: 19cm;
    margin: 20px auto;
    background: white;
    padding: 1cm;
    font-size: 12px;
    line-height: 1.35;
    color: #000;
}

.cabecalho-impressao {
    text-align: center;
    border-bottom: 1px solid #000;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.cabecalho-impressao h1 {
    margin: 0;
    font-size: 18px;
    text-transform: uppercase;
}

.cabecalho-impressao h2 {
    margin: 4px 0;
    font-size: 14px;
}

.cabecalho-impressao p {
    margin: 2px 0;
    font-size: 12px;
}

.registro-impressao {
    border-bottom: 1px solid #ccc;
    padding: 6px 0 8px 0;
    margin-bottom: 4px;
    page-break-inside: avoid;
}

.linha-registro {
    margin-bottom: 3px;
    font-size: 12px;
}

.texto-registro,
.texto-inline {
    margin-top: 2px;
    line-height: 1.35;
    text-align: justify;
}

.foto-impressao {
    width: 10cm;
    height: 15cm;
    object-fit: contain;
    margin-top: 6px;
    border: 1px solid #999;
    padding: 2px;
    display: block;
}

.rodape-impressao {
    margin-top: 15px;
    font-size: 10px;
    text-align: center;
    color: #555;
}

.botoes-nao-imprimir {
    max-width: 900px;
    margin: 20px auto 40px auto;
    text-align: center;
}

.botoes-nao-imprimir button,
.botoes-nao-imprimir a {
    display: inline-block;
    background: var(--cor-principal);
    color: white;
    padding: 11px 15px;
    border-radius: 8px;
    text-decoration: none;
    margin: 5px;
    border: none;
    cursor: pointer;
}

/* MOBILE */

@media (max-width: 600px) {

    body {
        background: var(--cor-fundo);
        font-size: 15px;
    }

    .topo {
        padding: 14px;
    }

    .topo h1 {
        font-size: 18px;
        line-height: 1.25;
    }

    .topo a {
        width: 100%;
        text-align: center;
        margin-right: 0;
        padding: 11px;
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    .card {
        padding: 13px;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    .card h2 {
        font-size: 17px;
    }

    .card h3 {
        font-size: 17px;
    }

    .login-box,
    .form-box {
        max-width: none;
        width: calc(100% - 18px);
        margin: 9px auto;
        padding: 18px;
        border-radius: 14px;
    }

    input,
    textarea,
    button,
    select {
        font-size: 16px;
        padding: 13px;
        margin-bottom: 12px;
    }

    textarea {
        min-height: 145px;
    }

    .form-box a,
    .btn-card {
        width: 100%;
        text-align: center;
        margin-right: 0;
        padding: 11px;
    }

    .foto-ocorrencia {
        max-height: 320px;
    }
}

/* MODO IMPRESSÃO */

@media print {

    @page {
        size: A4;
        margin: 1cm;
    }

    body {
        background: white;
        font-size: 12px;
    }

    .topo,
    .botoes-nao-imprimir,
    .btn-card {
        display: none !important;
    }

    .area-impressao {
        max-width: 100%;
        margin: 0;
        padding: 0;
        font-size: 12px;
        line-height: 1.35;
    }

    .registro-impressao {
        border-bottom: 1px solid #ccc;
        padding: 5px 0;
        margin-bottom: 3px;
        page-break-inside: avoid;
    }

    .linha-registro {
        margin-bottom: 2px;
        font-size: 12px;
    }

    .foto-impressao {
        width: 10cm;
        height: 15cm;
        object-fit: contain;
    }
}