/* Estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', Arial, sans-serif;
}

:root {
    --primary-color: #0056b3;
    --primary-dark: #003d82;
    --secondary-color: #f5f5f5;
    --accent-color: #1890ff;
    --danger-color: #f5222d;
    --warning-color: #faad14;
    --success-color: #52c41a;
    --text-color: #333;
    --text-light: #666;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    background-color: #fff;
    box-shadow: var(--shadow);
}

h1, h2, h3, h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 500;
}

/* Cabeçalho */
.cabecalho {
    text-align: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    position: relative;
    padding-top: 20px;
}

.cabecalho h1 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-top: 0;
}

.cabecalho p {
    font-size: 1em;
    color: var(--text-light);
}

/* Navegação */
.nav-tabs {
    display: flex;
    overflow-x: auto;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.nav-tab {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    background-color: #f9f9f9;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid transparent;
}

.nav-tab.active {
    background-color: #fff;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.nav-tab i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Seções de conteúdo */
.content-section {
    display: none;
    padding: 15px;
    background-color: #fff;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Formulário de dados do paciente */
.dados-paciente {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Seções de receituário */
.receituario-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
}

.formulario {
    margin-top: 15px;
}

.checkbox-container {
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1em;
    user-select: none;
    display: block;
    padding: 10px 10px 10px 35px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-container:hover {
    background-color: #eee;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 10px;
    left: 10px;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 3px;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: #f0f0f0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.btn i {
    font-size: 1.1em;
}

.btn-secondary {
    background-color: #64748b;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #d9363e;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn-group .btn {
    flex: 1 1 auto;
    min-width: 200px;
}

/* Campo de sexo específico */
#sexo_paciente {
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
}

#sexo_paciente option {
    padding: 0.5rem;
}

/* Resultados */
.resultado {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #0056b3;
}

.resultado.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dengue1, .dengue1b, .dengue2, .dengue3 {
    padding: 15px;
    margin: 10px 0;
    border-radius: 6px;
}

.resultado-variavel {
    font-weight: bold;
    color: var(--primary-color);
}

.alerta {
    color: var(--danger-color);
    font-weight: bold;
    margin-bottom: 10px;
}

/* Botões de ação */
.acoes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 20px 0;
}

.acoes .btn {
    margin: 5px;
}

/* Rodapé */
.rodape {
    text-align: center;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    color: var(--text-light);
    font-size: 0.9em;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.logo-container img {
    height: 40px;
    margin: 0 10px;
}

/* Classes de alerta e informações */
.azul {
    color: var(--accent-color);
}

.verde {
    color: var(--success-color);
}

/* Receita impressa */
.receita-impressa {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
}

.receita-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.receita-header h2 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.receita-content {
    margin-bottom: 20px;
}

.receita-footer {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.receita-assinatura {
    margin-top: 50px;
    text-align: center;
}

.receita-assinatura hr {
    width: 200px;
    margin: 10px auto;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
    }
    
    .cabecalho h1 {
        font-size: 1.5em;
    }
    
    .nav-tab {
        padding: 10px 5px;
        font-size: 0.9em;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .acoes {
        flex-direction: column;
        align-items: stretch;
    }
    
    .acoes .btn {
        margin: 5px 0;
    }
    
    .checkbox-container {
        padding: 8px 8px 8px 35px;
    }
}

/* Loader */
.loader {
    display: none;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .receita-impressa,
    .receita-impressa * {
        visibility: visible;
    }
    
    .receita-impressa {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
    }
    
    .nav-tabs,
    .btn-group,
    .rodape {
        display: none !important;
    }
}

/* Validações */
.checkbox-container[style*="display: none"] {
    display: none !important;
}

.checkbox-container.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.alerta-validacao {
    color: #dc3545;
    font-size: 0.9em;
    margin-top: 5px;
    display: none;
}

.formulario .checkbox-container {
    position: relative;
    padding-left: 35px;
    margin: 8px 0;
}

.checkbox-container input:disabled + .checkmark {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* Erro na impressão - Correção */
.receita-impressa .btn-group {
    display: none !important;
}

/* Estilos para logos e parceria */
.logo-parceria {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.logo-prefeitura,
.logo-vip {
    height: 60px;
    width: auto;
}

.parceria {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.parceria strong {
    color: var(--primary-color);
}

.rodape .logo-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

/* Estilo para o toggle de sexo */
.switch-field {
  display: flex;
  overflow: hidden;
  border-radius: 25px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin: 10px 0;
  background-color: #f0f0f0;
  position: relative;
  width: 220px;
}

.switch-field input {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  width: 1px;
  border: 0;
  overflow: hidden;
}

.switch-field label {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  transition: all 0.1s ease-in-out;
  cursor: pointer;
  font-weight: 500;
  color: #666;
  z-index: 1;
}

.switch-field label:hover {
  color: #333;
}

.switch-field input:checked + label {
  color: #fff;
  font-weight: 600;
}

.switch-field .switch-selection {
  position: absolute;
  height: 100%;
  width: 50%;
  z-index: 0;
  left: 0;
  top: 0;
  transition: all 0.2s ease-in-out;
  background-color: var(--primary-color);
  border-radius: 25px;
}

.switch-field input:nth-of-type(1):checked ~ .switch-selection {
  transform: translateX(0);
}

.switch-field input:nth-of-type(2):checked ~ .switch-selection {
  transform: translateX(100%);
}

.switch-field i {
  margin-right: 5px;
}

/* Estilos para a seção de documentos de referência */
.documentos-referencia {
    background-color: #ffffff;
    padding: 30px 20px;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.documentos-referencia h2 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 35px;
    font-size: 1.8em;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.documentos-referencia h2 i {
    margin-right: 12px;
    color: #0056b3;
}

.documentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.documento-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 30px;
    border-radius: 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.documento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,86,179,0.05), rgba(0,86,179,0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.documento-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,86,179,0.15);
}

.documento-card:hover::before {
    opacity: 1;
}

.documento-card i {
    font-size: 3em;
    color: #0056b3;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.documento-card:hover i {
    transform: scale(1.1);
}

.documento-card h3 {
    color: #0056b3;
    margin: 15px 0;
    font-size: 1.4em;
    font-weight: 600;
    transition: color 0.3s ease;
}

.documento-card p {
    color: #666;
    font-size: 1em;
    margin: 0;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.documento-card:hover h3,
.documento-card:hover p {
    color: #003d82;
}

/* Responsividade */
@media (max-width: 768px) {
    .documentos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .documento-card {
        padding: 25px;
    }

    .documentos-referencia h2 {
        font-size: 1.5em;
        margin-bottom: 25px;
    }

    .documento-card i {
        font-size: 2.5em;
    }

    .documento-card h3 {
        font-size: 1.2em;
    }
} 