/* ============================================================
   Sistema de Vacinação Influenza — Estilos Globais
   Paleta: #185FA5 azul | #3B6D11 verde | #E24B4A vermelho | #BA7517 âmbar
   ============================================================ */

/* ── Reset e base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1A1A1A;
    background: #F5F5F3;
}

/* ── Variáveis CSS ─────────────────────────────────────────── */
:root {
    --azul:     #185FA5;
    --azul-dk:  #124880;
    --verde:    #3B6D11;
    --vermelho: #E24B4A;
    --ambar:    #BA7517;
    --bg:       #F5F5F3;
    --branco:   #FFFFFF;
    --texto:    #1A1A1A;
    --texto-2:  #6B6B67;
    --borda:    #E5E7EB;
    --radius:   8px;
    --shadow:   0 1px 4px rgba(0,0,0,.08);
}

/* ── Tipografia ────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; color: var(--texto); }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { color: var(--texto); }
a  { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--branco);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 20px;
}

/* ── Badges de status ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.badge-vacinado  { background: #D1FAE5; color: #3B6D11; }
.badge-pendente  { background: #FEE2E2; color: #E24B4A; }
.badge-recusou   { background: #FEF3C7; color: #BA7517; }
.badge-neutro    { background: #F3F4F6; color: #6B7280; }

/* ── Botões ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, opacity .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary   { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-dk); }

.btn-success   { background: var(--verde); color: #fff; }
.btn-success:hover { background: #2d530d; }

.btn-danger    { background: var(--vermelho); color: #fff; }
.btn-danger:hover { background: #c73b3a; }

.btn-outline   { background: transparent; color: var(--azul); border: 1.5px solid var(--azul); }
.btn-outline:hover { background: #F0F6FF; }

.btn-ghost     { background: transparent; color: var(--texto-2); }
.btn-ghost:hover { background: var(--bg); }

.btn-lg { height: 48px; font-size: 15px; padding: 0 24px; }
.btn-sm { height: 32px; font-size: 12px; padding: 0 12px; }
.btn-full { width: 100%; }

/* ── Inputs ────────────────────────────────────────────────── */
.input, select.input, textarea.input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--borda);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--texto);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(24,95,165,.12); }
.input::placeholder { color: #9CA3AF; }
.input-lg { height: 48px; font-size: 15px; }
.input-error { border-color: var(--vermelho) !important; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--texto); }
.form-error { font-size: 12px; color: var(--vermelho); margin-top: 4px; }

/* ── Tabela ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; }
thead th {
    background: var(--azul);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 11px 14px;
    text-align: left;
    white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--borda); }
tbody tr:hover { background: #F8FAFB; }
tbody td { padding: 12px 14px; font-size: 13px; color: var(--texto); vertical-align: middle; }
tbody tr:last-child { border-bottom: none; }

/* ── Alertas / Toast ───────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.alert-erro    { background: #FEF2F2; border: 1px solid #FECACA; color: var(--vermelho); }
.alert-sucesso { background: #ECFDF5; border: 1px solid #A7F3D0; color: var(--verde); }
.alert-aviso   { background: #FFFBEB; border: 1px solid #FDE68A; color: var(--ambar); }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: var(--azul); }

/* ── Toast flutuante ───────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 400px;
}
.toast {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    animation: slideUp .3s ease;
    pointer-events: auto;
}
.toast-sucesso { background: var(--verde); color: #fff; }
.toast-erro    { background: var(--vermelho); color: #fff; }
.toast-aviso   { background: var(--ambar); color: #fff; }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    opacity: .5;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Skeleton loading ──────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
    opacity: 0; animation: fadeIn .2s forwards;
}
.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: scaleIn .2s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--texto-2); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); }
.modal-footer { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn  { to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Focus visível (acessibilidade) ────────────────────────── */
:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* ── Utilitários ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--texto-2); }
.text-verde  { color: var(--verde); }
.text-vermelho { color: var(--vermelho); }
.text-azul   { color: var(--azul); }
.text-ambar  { color: var(--ambar); }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.hidden { display: none !important; }
