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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 15px;
}

.header {
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.btn-header {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-consultar {
    background-color: #81D4FA;
    color: white;
}

.btn-consultar:hover {
    background-color: #4FC3F7;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(129, 212, 250, 0.3);
}

.btn-gerar {
    background-color: #2196F3;
    color: white;
}

.btn-gerar:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .barcode-text {
        font-size: 14px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-copy, .btn-pdf, .btn-b23 {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .card {
        padding: 12px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    input, select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn-primary {
        padding: 12px 20px;
        font-size: 14px;
    }
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #2196F3;
    font-weight: 600;
}

.loading.active {
    display: block;
}

.resultado {
    display: none;
    margin-top: 30px;
}

.resultado.active {
    display: block;
}

.resultado-card {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.resultado-card h3 {
    color: #16a34a;
    margin-bottom: 15px;
    font-size: 22px;
}

.barcode-container {
    background: white;
    border: 2px dashed #333;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    position: relative;
}

.barcode-text {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    word-break: break-all;
    color: #333;
    text-align: center;
    letter-spacing: 2px;
    line-height: 1.8;
}

.barcode-label {
    position: absolute;
    top: -12px;
    left: 15px;
    background: white;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-copy {
    background: #22c55e;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.btn-copy:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.btn-b23 {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.btn-b23:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.btn-pdf {
    background: #3b82f6;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
}

.btn-pdf:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    color: #92400e;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.info-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}

.info-box p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
}

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

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

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Modal de Confirmação */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 22px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.info-box-modal {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-box-modal p {
    margin: 0;
    color: #1e40af;
    font-size: 14px;
}

.dados-advogado {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.dados-item {
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
}

.dados-item:last-child {
    border-bottom: none;
}

.dados-item strong {
    color: #374151;
    margin-right: 8px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.btn-cancelar {
    background: #f3f4f6;
    color: #374151;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancelar:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.btn-confirmar {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-confirmar:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-confirmar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading dentro do modal */
.modal-loading {
    text-align: center;
    padding: 30px 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin: 20px 0;
}

.spinner-modal {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}

.modal-loading p {
    margin: 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        margin: 10px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .btn-cancelar,
    .btn-confirmar {
        width: 100%;
    }
}

/* Modal de Erro */
#modalErro {
    z-index: 2000; /* Acima do modal de confirmação (z-index: 1000) */
}

.modal-erro {
    max-width: 500px;
}

.modal-header-erro {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-bottom: none;
}

.modal-header-erro h3 {
    color: white;
}

.modal-header-erro .modal-close {
    color: white;
}

.modal-header-erro .modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.erro-mensagem {
    padding: 20px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 20px;
}

.erro-mensagem p {
    margin: 0;
    color: #991b1b;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
}

.modal-buttons-erro {
    justify-content: center;
}

.modal-buttons-erro .btn-primary {
    width: auto;
    min-width: 150px;
}

/* Ícone de informação com tooltip de imagem */
.info-icon {
    display: inline-block;
    margin-left: 8px;
    cursor: help;
    font-size: 18px;
    position: relative;
    vertical-align: middle;
    color: #2196F3;
    transition: transform 0.2s ease;
}

.info-icon:hover {
    transform: scale(1.2);
}

.info-icon[data-tooltip-image]::after {
    content: '';
    position: fixed;
    top: calc(50% - 200px);
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    z-index: 3001;
}

.info-icon[data-tooltip-image]:hover::after {
    opacity: 1;
    visibility: visible;
}

.info-icon[data-tooltip-image]::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 177px;
    background-image: url('/emissao-boleto/img/identidade-advogado.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #fff;
    border: 3px solid #2196F3;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    z-index: 3000;
}

.info-icon[data-tooltip-image]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Ajuste para mobile */
@media (max-width: 768px) {
    .info-icon[data-tooltip-image]::before {
        width: 240px;
        height: 152px;
    }
}

