/**
 * ImportacaoLegado CSS - Interface Moderna e Segura
 */

/* Estilos Globais */
.endgc-busca-tipos-legado {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    color: #333;
}

/* Cabeçalho */
.endgc-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.endgc-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.endgc-subtitle {
    font-size: 1rem;
    color: #666;
    margin-top: 0;
}

/* Ícone de segurança */
.endgc-security-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300a32a'%3E%3Cpath d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z'/%3E%3C/svg%3E");
    background-size: contain;
    margin-right: 6px;
    vertical-align: middle;
}

/* Formulário de Busca */
.endgc-form-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.endgc-form-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2271b1, #00a32a);
    border-radius: 8px 8px 0 0;
}

#form-busca-tipos-legado {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    #form-busca-tipos-legado {
        flex-direction: row;
        align-items: center;
    }

    .endgc-input-wrapper {
        flex: 1;
    }
}

.endgc-input-wrapper {
    position: relative;
}

.endgc-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

#endgc-busca-valor {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#endgc-busca-valor:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.endgc-search-button-container {
    display: flex;
    justify-content: center;
}

button.endgc-button {
    background-color: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    position: relative;
    font-weight: 500;
}

button.endgc-button:hover {
    background-color: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button.endgc-button:active {
    background-color: #0a4b78;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button.endgc-search-button {
    height: 44px;
}

/* Indicador de carregamento */
.loading-indicator {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
}

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

button.is-loading .loading-indicator.active {
    display: inline-block;
}

/* Status e Mensagens */
.endgc-status-message {
    margin: 1rem 0;
    text-align: center;
}

.endgc-loading-message,
.endgc-error-message,
.endgc-success-message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-in-out;
    position: relative;
    padding-left: 42px;
    display: none; /* Esconder por padrão */
}

/* Só mostrar quando tiver a classe active */
.endgc-loading-message.active,
.endgc-error-message.active,
.endgc-success-message.active {
    display: block;
}

.endgc-loading-message::before,
.endgc-error-message::before,
.endgc-success-message::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
}

.endgc-loading-message::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232271b1'%3E%3Cpath d='M12 4V2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-2.76-1.12-5.26-2.93-7.07l-1.42 1.42C19.1 7.79 20 9.79 20 12c0 4.41-3.59 8-8 8s-8-3.59-8-8 3.59-8 8-8v2z'%3E%3CanimateTransform attributeName='transform' attributeType='XML' type='rotate' from='0 12 12' to='360 12 12' dur='1s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}

.endgc-error-message::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d63638'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

.endgc-success-message::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300a32a'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

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

.endgc-loading-message {
    background-color: #f0f6fc;
    border-left: 4px solid #72aee6;
    color: #2271b1;
}

.endgc-error-message {
    background-color: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #b32d2e;
}

.endgc-success-message {
    background-color: #f0faf0;
    border-left: 4px solid #00a32a;
    color: #008a20;
}

/* Container de Resultados */
.endgc-resultado-container {
    margin-top: 2rem;
    transition: opacity 0.3s ease;
}

.endgc-resultados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
    .endgc-resultados-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.endgc-resultados-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
}

.endgc-resultados-header h3::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232271b1'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.endgc-cpf-info {
    margin: 0;
    padding: 6px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.endgc-cpf-info::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* Estilo dos Cartões de Contrato */
.endgc-contrato-item {
    background-color: white;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-left: 4px solid #2271b1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.endgc-contrato-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Campos do Contrato */
.endgc-campo {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.endgc-campo-label {
    font-weight: 600;
    width: 180px;
    color: #666;
    flex-shrink: 0;
}

.endgc-campo-valor {
    flex: 1;
    color: #333;
}

/* Estilo para o Valor */
.endgc-campo-valor.valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: #008a20;
}

/* Seção para Pagar Todos os Contratos */
.endgc-pagar-todos-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    animation: highlight-section 1s ease-in-out;
}

@keyframes highlight-section {
    0% { background-color: #f0faf0; }
    50% { background-color: #e0f5e0; }
    100% { background-color: #f9f9f9; }
}

.endgc-pagar-todos-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2271b1, #00a32a);
    border-radius: 8px 8px 0 0;
}

.endgc-valor-total {
    font-size: 1.2rem;
    margin: 1rem 0;
}

.endgc-valor-total strong {
    color: #008a20;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Estilo para o botão principal de pagamento */
button.endgc-pagar-todos {
    background-color: #00a32a;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    min-width: 280px;
    margin: 1rem auto;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

button.endgc-pagar-todos:hover {
    background-color: #008a20;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

button.endgc-pagar-todos:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Efeito de destaque no botão */
button.endgc-pagar-todos::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s, transform 0.5s;
}

button.endgc-pagar-todos:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* Ícone de segurança no botão */
button.endgc-pagar-todos::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* Instruções de pagamento */
.endgc-instrucao-pagamento {
    font-size: 0.9rem;
    color: #666;
    margin-top: 1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Estilo para CPF parcialmente oculto */
.cpf-masked {
    font-family: monospace;
    font-weight: 600;
}

/* Mensagem de erro dentro dos cartões */
.endgc-error-message {
    margin-top: 1rem;
    text-align: left;
}

/* Responsividade */
@media (max-width: 768px) {
    .endgc-form-container {
        padding: 1.5rem;
    }

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

    .endgc-campo-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .endgc-search-button-container {
        margin-top: 1rem;
    }

    button.endgc-pagar-todos {
        min-width: 100%;
        padding: 0.75rem 1.5rem;
    }
}

/* Acessibilidade */
button.endgc-button:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

#endgc-busca-valor:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Estilos para tooltip */
.endgc-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 0.25rem;
}

.endgc-tooltip::after {
    content: "?";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #999;
    color: white;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.endgc-tooltip .tooltip-content {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    pointer-events: none;
}

.endgc-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}
