*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, Helvetica, sans-serif;
}

body{
    background:#f3f6fb;
    color:#1f2937;
}

.topbar{
    background:#123d73;
    color:white;
    padding:18px 6%;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
}

.brand strong{
    display:block;
    font-size:26px;
}

.brand span{
    font-size:13px;
    opacity:.85;
}

nav{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
}

nav a{
    color:white;
    text-decoration:none;
    font-weight:bold;
}

nav .sair{
    color:#ffd6d6;
}

.container{
    width:90%;
    max-width:1100px;
    margin:35px auto;
}

.auth-card{
    max-width:420px;
    margin:60px auto;
    background:white;
    padding:35px;
    border-radius:18px;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
    text-align:center;
}

.auth-card h1{
    color:#123d73;
    margin-bottom:10px;
}

form{
    display:flex;
    flex-direction:column;
    gap:15px;
    margin-top:25px;
}

input, select, textarea{
    width:100%;
    padding:14px;
    border:1px solid #d1d5db;
    border-radius:10px;
    font-size:15px;
}

button, .btn{
    background:#123d73;
    color:white;
    padding:14px 20px;
    border:none;
    border-radius:10px;
    text-decoration:none;
    font-weight:bold;
    cursor:pointer;
    display:inline-block;
}

.btn.secundario{
    background:#198754;
}

.alerta{
    background:#fee2e2;
    color:#991b1b;
    padding:12px;
    border-radius:10px;
    margin-top:15px;
}

.hero{
    background:white;
    padding:40px;
    border-radius:20px;
    box-shadow:0 5px 20px rgba(0,0,0,.08);
    margin-bottom:30px;
}

.hero h1{
    color:#123d73;
    font-size:34px;
}

.hero p{
    margin:12px 0 25px;
    color:#6b7280;
}

.actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:20px;
}

.card{
    background:white;
    padding:25px;
    border-radius:16px;
    text-decoration:none;
    color:#1f2937;
    box-shadow:0 5px 20px rgba(0,0,0,.08);
}

.card h3{
    color:#123d73;
    margin-bottom:8px;
}

.card span{
    display:inline-block;
    margin-top:15px;
    color:#198754;
    font-weight:bold;
}

.logo-area{
    display:flex;
    align-items:center;
    gap:12px;
}

.logo-area img,
.logo-img{
    width:70px;
    height:70px;
    object-fit:contain;
    background:transparent;
}

.home-logo{
    display:flex;
    justify-content:center;
    align-items:center;
}

.logo-home-img{
    width:280px;
    max-width:100%;
    height:auto;
    object-fit:contain;
    background:transparent;
    border:none;
    box-shadow:none;
}

/* HOME */

body{
    background:#fbf7ef;
}

.topbar{
    background:linear-gradient(180deg, #0f3b22, #143f2b);
}

.home-hero{
    background:#fffaf2;
    border-radius:24px;
    padding:50px;
    box-shadow:0 18px 45px rgba(35,55,35,.13);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:40px;
}

/* ==========================================
   BOTÃO VOLTAR
========================================== */

.area-voltar{
    margin-top:25px;
}

.btn-voltar{
    display:inline-flex;
    align-items:center;
    gap:8px;

    background:#4f6f45;
    color:white;

    padding:12px 22px;

    border-radius:12px;

    text-decoration:none;

    font-weight:600;

    font-size:15px;

    transition:.3s;

    box-shadow:
    0 4px 12px rgba(79,111,69,.25);
}

.btn-voltar:hover{
    background:#3f5a38;
    transform:translateY(-2px);
}

.btn-voltar:active{
    transform:translateY(0);
}
:root{
    --verde-principal:#556f47;
    --verde-escuro:#3f5a38;
    --bege:#f8f4ec;
    --azul:#123d73;
}
.btn-voltar{
    background:var(--verde-principal);
}

.btn-voltar:hover{
    background:var(--verde-escuro);
}
.acoes-paciente{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
    margin:25px 0;
}

.btn-nova{
    background:#123d73;
}

.btn-historico{
    background:#4f6f45;
}

.btn-nova:hover{
    background:#0f325f;
}

.btn-historico:hover{
    background:#3f5a38;
}

.sem-consultas{
    background:#fff8e1;
    color:#8a6d3b;

    padding:12px 18px;

    border-radius:12px;

    border-left:5px solid #ffc107;

    font-weight:500;
}
.autocomplete-resultados{
    margin-top:10px;
    display:flex;
    flex-direction:column;
    gap:10px;
}

.autocomplete-item{
    display:block;
    width:100%;

    background:white;

    padding:14px 18px;

    border-radius:12px;

    text-decoration:none;

    color:#1f2937;

    box-shadow:0 3px 10px rgba(0,0,0,.08);

    transition:.2s;
}

.autocomplete-item:hover{
    transform:translateX(4px);
    background:#f7faf7;
}

.autocomplete-item strong{
    display:block;
    color:#123d73;
    font-size:16px;
}

.autocomplete-item span{
    display:block;
    color:#6b7280;
    margin-top:4px;
}
/* ==========================================
   RESULTADO DA BUSCA DE PACIENTES
========================================== */

.autocomplete-resultados{
    margin-top:15px;
    display:flex;
    flex-direction:column;
    gap:12px;
    width:100%;
}

.autocomplete-item{
    display:block;
    width:100%;
    background:#ffffff;
    padding:16px 18px;
    border-radius:14px;
    text-decoration:none;
    color:#1f2937;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
    border-left:5px solid #4f6f45;
    transition:.2s;
}

.autocomplete-item:hover{
    background:#f8fbf7;
    transform:translateX(4px);
}

.autocomplete-item strong{
    display:block;
    color:#2f3f28;
    font-size:17px;
    margin-bottom:5px;
}

.autocomplete-item span{
    display:block;
    color:#6b7280;
    font-size:14px;
}

.autocomplete-vazio{
    background:#fff8e1;
    color:#8a6d3b;
    padding:15px;
    border-radius:12px;
    border-left:5px solid #b8872f;
}
.marcadores-consulta{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:15px 0;
}

.marcadores-consulta span{
    background:#e8efe2;
    color:#2f3f28;
    padding:7px 12px;
    border-radius:20px;
    font-size:13px;
    font-weight:bold;
}

.btn-editar{
    background:#b8872f;
}

.btn-editar:hover{
    background:#9d7428;
}
.fotos-consulta{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin:15px 0;
}

.fotos-consulta img{
    width:160px;
    height:120px;
    object-fit:cover;
    border-radius:12px;
    border:2px solid #e8efe2;
}
.btn-visualizar{
    background:#2563eb;
    color:#fff;
    padding:10px 18px;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
}

.btn-visualizar:hover{
    background:#1d4ed8;
}
.btn-visualizar{
    background:#4f6f45;
    color:white;
    padding:10px 18px;
    border-radius:10px;
    text-decoration:none;
    font-weight:bold;
    display:inline-block;
    margin-top:8px;
    box-shadow:0 4px 12px rgba(79,111,69,.25);
}

.btn-visualizar:hover{
    background:#3f5a38;
}
.preview-fotos-consulta{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
    gap:14px;
    margin-top:12px;
    margin-bottom:20px;
}

.preview-foto-card{
    background:white;
    border:1px solid #d8e2d2;
    border-radius:14px;
    padding:10px;
    box-shadow:0 4px 12px rgba(0,0,0,.08);
}

.preview-foto-card img{
    width:100%;
    height:120px;
    object-fit:cover;
    border-radius:10px;
    display:block;
}

.preview-foto-card small{
    display:block;
    margin-top:8px;
    font-size:12px;
    color:#4f6f45;
    word-break:break-all;
}
.preview-fotos-consulta{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
    gap:14px;
    margin-top:12px;
    margin-bottom:20px;
}

.preview-foto-card{
    background:white;
    border:1px solid #d8e2d2;
    border-radius:14px;
    padding:10px;
    box-shadow:0 4px 12px rgba(0,0,0,.08);
}

.preview-foto-card img{
    width:100%;
    height:120px;
    object-fit:cover;
    border-radius:10px;
    display:block;
}

.preview-foto-card small{
    display:block;
    margin-top:8px;
    font-size:12px;
    color:#4f6f45;
    word-break:break-all;
}
.btn-imprimir{
    background:#315c35;
}
.fotos img{
    width:100%;
    height:250px;
    object-fit:cover;
    border:3px solid #4f6842;
    border-radius:14px;
}
.btn-imprimir{
    background:#315c35;
    margin-top:15px;
}
.preview-foto-card{
    position:relative;
}

.remover-foto{
    position:absolute;
    top:6px;
    right:6px;
    width:28px;
    height:28px;
    border-radius:50%;
    border:none;
    background:#b91c1c;
    color:white;
    font-size:20px;
    cursor:pointer;
    line-height:1;
}
.form-impressao{
    margin-top:20px;
}

.fotos-selecao-pdf{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));
    gap:12px;
    margin:15px 0;
}

.foto-check-card{
    border:1px solid #d8e2d2;
    border-radius:12px;
    padding:8px;
    background:white;
    cursor:pointer;
}

.foto-check-card input{
    margin-bottom:6px;
}

.foto-check-card img{
    width:100%;
    height:100px;
    object-fit:cover;
    border-radius:8px;
}
.topo-pdf{
    position:relative;
    padding-top:45px;
    margin-bottom:25px;
}

.folhas-topo{
    position:absolute;
    top:0;
    left:0;
    width:230px;
    opacity:.75;
}

.titulo{
    margin-left:65px;
}

.titulo h1{
    color:#4f6842;
    font-size:26px;
    letter-spacing:3px;
    margin:0;
}

.titulo h2{
    color:#4f6842;
    font-size:18px;
    letter-spacing:4px;
    margin:4px 0 20px;
}

.data{
    position:absolute;
    top:45px;
    right:0;
    color:#111;
    font-size:20px;
    font-weight:bold;
    letter-spacing:3px;
}

.rodape-pdf{
    margin-top:30px;
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
}

.assinatura-area{
    width:260px;
    margin:30px auto 0 auto;
    text-align:center;
}

.assinatura-img{
    width:100px !important;
    max-width:100px !important;
    height:auto !important;
    display:block;
    margin:0 auto -4px auto;
}

.linha-assinatura{
    width:220px;
    border-top:1px solid #555;
    margin:0 auto 6px auto;
}

.dados-profissional{
    width:220px;
    margin:0 auto;
    text-align:center;
    font-size:12px;
    line-height:1.3;
}
.faixa-superior{
    background:linear-gradient(
        90deg,
        #07331c,
        #0d4f2d,
        #07331c
    );
    color:white;
    padding:12px 20px;
    margin:-18mm -18mm 25px -18mm;

    display:flex;
    justify-content:space-between;
    align-items:center;
}

.faixa-logo{
    display:flex;
    align-items:center;
    gap:10px;

    font-size:18px;
    font-weight:bold;
}

.faixa-logo img{
    height:45px;
    width:auto;
}

.faixa-contato{
    text-align:right;
    font-size:13px;
    line-height:1.4;
    font-weight:bold;
}

.assinatura-area{
    text-align:center;
    width:360px;
    margin:0 auto;
}

.obs-legal{
    width:220px;
    font-size:10px;
    line-height:1.3;
}

.linha-assinatura{
    width:260px;
    border-top:1px solid #666;
    margin:0 auto 8px auto;
}
.btn-prescrever{
    background:#315c35;
}
.autocomplete-resultados{
    background:white;
    border:1px solid #ddd;
    border-radius:8px;
    margin-top:4px;
}

.autocomplete-item{
    padding:10px;
    cursor:pointer;
}

.autocomplete-item:hover{
    background:#e7eee2;
}

.horarios-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(90px, 1fr));
    gap:10px;
    margin-top:10px;
}

.horario-livre{
    background:#315c35;
    color:white;
    border:none;
    border-radius:8px;
    padding:10px;
    cursor:pointer;
}

.horario-livre.selecionado{
    background:#174987;
}

.horario-bloqueado{
    background:#ccc;
    color:#777;
    border:none;
    border-radius:8px;
    padding:10px;
}
.linha-agendamento-dia{
    padding:6px 0;
    font-size:14px;
}

.linha-livre{
    color:#315c35;
}

.linha-bloqueada{
    color:#9b1c1c;
    font-weight:bold;
}
.btn-voltar{
    display:inline-block;
    background:#58784a;
    color:white;
    text-decoration:none;
    padding:12px 22px;
    border-radius:12px;
    font-weight:600;
    margin-top:15px;

    box-shadow:0 4px 10px rgba(0,0,0,.15);
    transition:.2s;
}

.btn-voltar:hover{
    background:#47653c;
    transform:translateY(-2px);
    color:white;
}
