/* BioCare Ocupacional - Estilos Principais */

:root {
    --biocare-blue: #008B8B;
    --biocare-blue-light: #20B2AA;
    --biocare-green: #7CB342;
    --biocare-green-light: #9CCC65;
    --biocare-gray: #6b7280;
    --biocare-gray-light: #f3f4f6;
    --biocare-white: #ffffff;
    --biocare-dark: #424242;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #008B8B 0%, #7CB342 100%);
    min-height: 100vh;
    color: var(--biocare-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-fluid {
    width: 100%;
    padding: 20px;
}

/* Telas */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px 0;
}

.screen.active {
    display: block;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.header h2 {
    color: var(--biocare-white);
    font-size: 28px;
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Logo */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Cards */
.welcome-card {
    background: var(--biocare-white);
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 600px;
    margin: 50px auto;
}

.welcome-card h2 {
    color: var(--biocare-blue);
    font-size: 32px;
    margin-bottom: 15px;
}

.welcome-description {
    color: var(--biocare-gray);
    font-size: 18px;
    margin-bottom: 40px;
}

.form-card {
    background: var(--biocare-white);
    border-radius: 15px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

/* Formulários */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: var(--biocare-dark);
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--biocare-blue-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
}

/* Botões */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--biocare-blue);
    color: var(--biocare-white);
}

.btn-primary:hover {
    background: var(--biocare-blue-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--biocare-gray);
    color: var(--biocare-white);
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--biocare-green);
    color: var(--biocare-white);
}

.btn-success:hover {
    background: var(--biocare-green-light);
    transform: translateY(-2px);
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: var(--biocare-white);
    backdrop-filter: blur(10px);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    margin: 10px;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

/* Seleção de Formulários */
.selection-info {
    font-size: 18px;
    color: var(--biocare-gray);
    margin-bottom: 30px;
    text-align: center;
}

.form-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.form-checkbox-card {
    position: relative;
    cursor: pointer;
}

.form-checkbox-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
}

.form-checkbox-card .card-content {
    background: var(--biocare-gray-light);
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.form-checkbox-card .card-content i {
    font-size: 48px;
    color: var(--biocare-blue);
    margin-bottom: 15px;
}

.form-checkbox-card .card-content h3 {
    color: var(--biocare-dark);
    font-size: 18px;
    margin-bottom: 10px;
}

.form-checkbox-card .card-content p {
    color: var(--biocare-gray);
    font-size: 14px;
}

.form-checkbox-card input:checked + .card-content {
    background: var(--biocare-white);
    border-color: var(--biocare-blue);
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.form-checkbox-card input:checked + .card-content i {
    color: var(--biocare-green);
}

/* Formulários Específicos */
#specificFormsContainer {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.specific-form {
    background: var(--biocare-white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.specific-form h3 {
    color: var(--biocare-blue);
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-blank {
    margin-bottom: 8px;
    padding: 6px;
    background: var(--biocare-gray-light);
    border-radius: 4px;
    line-height: 1.2;
}

.question-blank p {
    margin-bottom: 3px;
    line-height: 1.2;
    font-size: 11px;
}

.question-blank strong {
    line-height: 1.2;
    font-size: 11px;
}

.blank-form td {
    min-height: 40px;
}

/* Documento Compacto (1 página) */
.document-compact {
    padding: 10px !important;
    line-height: 1.2;
}

.document-header-compact {
    margin-bottom: 5px;
}

/* Documento de 2 Páginas */
.document-2pages {
    padding: 15px !important;
    line-height: 1.2;
}

.document-2pages .question-blank {
    page-break-inside: avoid;
    line-height: 1.2;
    margin-bottom: 6px;
    padding: 5px;
}

/* Tabela de Acuidade Visual */
.acuidade-header {
    width: 100%;
    border-collapse: collapse;
    margin: 5px 0;
}

.acuidade-header td {
    padding: 2px 4px;
    font-size: 10px;
    line-height: 1.2;
}

.acuidade-header td:nth-child(odd) {
    width: 18%;
}

.vision-table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0;
    font-size: 8px;
}

.vision-table td {
    border: 1px solid #ddd;
    padding: 2px 1px;
    text-align: center;
    vertical-align: middle;
    line-height: 1;
}

.vision-table td:first-child {
    text-align: left;
    padding-left: 5px;
    background: var(--biocare-gray-light);
    font-size: 9px;
}

.vision-circle {
    width: 12px;
    height: 12px;
    border: 1.5px solid #333;
    border-radius: 50%;
    margin: 2px auto;
    background: white;
}

.vision-label {
    font-size: 7px;
    font-weight: bold;
    margin-top: 1px;
    color: #333;
    line-height: 1;
}

/* Impressão Otimizada */
@media print {
    .document-compact {
        padding: 10px !important;
        page-break-after: always;
    }
    
    .vision-table {
        font-size: 8px;
    }
    
    .vision-circle {
        width: 14px;
        height: 14px;
        border: 1.5px solid #333;
    }
    
    .vision-label {
        font-size: 7px;
    }
    
    .acuidade-header td {
        padding: 3px 5px;
        font-size: 10px;
    }
}

/* Documentos */
.documents-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.document {
    background: var(--biocare-white);
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow);
    page-break-after: always;
    line-height: 1.3;
}

.document-header {
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--biocare-blue);
    padding-bottom: 8px;
}

.document-header img {
    max-width: 80px;
    height: auto;
    display: block;
    margin: 0 auto 5px auto;
}

.document-header h2 {
    color: var(--biocare-blue);
    font-size: 16px;
    margin-bottom: 3px;
    line-height: 1.2;
}

.document-header .company-name {
    color: var(--biocare-gray);
    font-size: 12px;
}

.document-header-compact img {
    max-width: 60px;
    height: auto;
    display: block;
    margin: 0 auto 3px auto;
}

.document-body {
    line-height: 1.3;
}

.document-body p,
.document-body td,
.document-body label {
    line-height: 1.3;
    margin: 0;
    padding: 2px 0;
}

.document-section {
    margin-bottom: 8px;
}

.document-section h3 {
    color: var(--biocare-blue);
    font-size: 14px;
    margin-bottom: 5px;
    border-bottom: 1px solid var(--biocare-gray-light);
    padding-bottom: 3px;
    line-height: 1.2;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
    line-height: 1.2;
}

.info-table td {
    padding: 4px 6px;
    border: 1px solid #e5e7eb;
    line-height: 1.2;
    font-size: 11px;
}

.info-table td:first-child {
    font-weight: 600;
    background: var(--biocare-gray-light);
    width: 30%;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--biocare-gray-light);
    border-radius: 5px;
}

.checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--biocare-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.checkbox-box.checked::after {
    content: '✓';
    color: var(--biocare-green);
    font-weight: bold;
    font-size: 16px;
}

/* Histórico */
.history-search {
    position: relative;
    margin-bottom: 30px;
}

.history-search input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
}

.history-search i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--biocare-gray);
}

.history-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--biocare-gray-light);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: var(--biocare-white);
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.history-info {
    flex: 1;
}

.history-info h4 {
    color: var(--biocare-blue);
    font-size: 18px;
    margin-bottom: 5px;
}

.history-info p {
    color: var(--biocare-gray);
    font-size: 14px;
    margin-bottom: 3px;
}

.history-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag {
    background: var(--biocare-blue);
    color: var(--biocare-white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-actions button {
    padding: 8px 16px;
    font-size: 14px;
}

/* Impressão */
@media print {
    body {
        background: white;
    }

    .screen {
        display: none !important;
    }

    #documentViewScreen {
        display: block !important;
    }

    .header,
    .btn {
        display: none !important;
    }

    .document {
        box-shadow: none;
        page-break-after: always;
        padding: 10px;
        line-height: 1.2;
    }

    .document p,
    .document td,
    .document label,
    .document strong {
        line-height: 1.2;
        margin: 0;
        padding: 1px 0;
        font-size: 10px;
    }

    .info-table td {
        padding: 3px 5px;
        line-height: 1.2;
        font-size: 10px;
    }

    .question-blank {
        line-height: 1.2;
        margin-bottom: 5px;
        padding: 4px;
    }

    .question-blank p {
        line-height: 1.2;
        margin-bottom: 2px;
        font-size: 10px;
    }

    .document-header {
        margin-bottom: 8px;
        padding-bottom: 5px;
    }

    .document-header h2 {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .document-header img {
        max-width: 60px;
        margin-bottom: 3px;
    }

    .document-section {
        margin-bottom: 6px;
    }

    .document-section h3 {
        font-size: 12px;
        margin-bottom: 4px;
        padding-bottom: 2px;
    }

    .documents-container {
        gap: 0;
    }

    .document-header img,
    .document-header-compact img {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }

    .document-compact {
        padding: 8px !important;
    }

    .document-2pages {
        padding: 10px !important;
    }

    .vision-table {
        font-size: 7px;
    }

    .vision-circle {
        width: 10px;
        height: 10px;
        border: 1px solid #333;
    }

    .vision-label {
        font-size: 6px;
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .welcome-card {
        padding: 40px 20px;
    }

    .form-card {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-selection-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header h2 {
        font-size: 24px;
    }

    .logo-text {
        font-size: 48px;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .history-actions {
        width: 100%;
    }

    .history-actions button {
        flex: 1;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    animation: fadeIn 0.4s ease;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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