/**
 * Estilos do Plugin de Cadastro - Site Institucional
 * Design moderno, responsivo e acessível
 */

/* ==================== Container Principal ==================== */
.cadastro-captura-container {
    max-width: 700px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cadastro-form-wrapper {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px 35px;
    position: relative;
    overflow: hidden;
}

/* ==================== Etapas do Formulário ==================== */
.cadastro-step {
    animation: fadeIn 0.4s ease-in;
}

.cadastro-step-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

/* ==================== Campos do Formulário ==================== */
.cadastro-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.cadastro-form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.cadastro-form-group.col-half {
    flex: 1;
    min-width: calc(50% - 10px);
}

.cadastro-form-group.col-quarter {
    flex: 1;
    min-width: calc(25% - 15px);
}

.cadastro-form-group label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
}

.cadastro-form-group label .required {
    color: #e74c3c;
    font-weight: 700;
}

.cadastro-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #fafafa;
    box-sizing: border-box;
}

.cadastro-input:focus {
    outline: none;
    border-color: #3498db;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.cadastro-input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.cadastro-input:valid:not(:placeholder-shown) {
    border-color: #2ecc71;
}

/* Feedback de validação */
.cadastro-feedback {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    min-height: 18px;
}

.cadastro-feedback.error {
    color: #e74c3c;
    animation: shake 0.3s ease;
}

.cadastro-feedback.success {
    color: #2ecc71;
}

.cadastro-feedback.loading {
    color: #3498db;
}

/* ==================== Botões ==================== */
.cadastro-button-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.cadastro-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cadastro-btn-next,
.cadastro-btn-submit {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.cadastro-btn-next:hover,
.cadastro-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.cadastro-btn-prev {
    background: #95a5a6;
    color: #ffffff;
}

.cadastro-btn-prev:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.cadastro-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== Seção Expansível ==================== */
.cadastro-expandable {
    margin: 25px 0;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
}

.cadastro-expand-btn {
    background: transparent;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #3498db;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    transition: color 0.3s ease;
}

.cadastro-expand-btn:hover {
    color: #2980b9;
}

.cadastro-expand-btn .expand-icon {
    font-size: 20px;
    font-weight: 700;
    transition: transform 0.3s ease;
}

.cadastro-expand-btn.active .expand-icon {
    transform: rotate(45deg);
}

.cadastro-expandable-content {
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

/* ==================== Mensagem de Sucesso ==================== */
.cadastro-success-message {
    text-align: center;
    padding: 50px 30px;
    animation: fadeIn 0.5s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #ffffff;
    animation: scaleIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cadastro-success-message h3 {
    color: #2ecc71;
    font-size: 26px;
    margin-bottom: 15px;
}

.cadastro-success-message p {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.cadastro-btn-reset {
    background: #3498db;
    color: #ffffff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cadastro-btn-reset:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* ==================== Loader ==================== */
.cadastro-loader {
    text-align: center;
    padding: 60px 30px;
    animation: fadeIn 0.3s ease;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.cadastro-loader p {
    color: #7f8c8d;
    font-size: 16px;
}

/* ==================== Seletor de Tipo ==================== */
.cadastro-tipo-selector {
    text-align: center;
    padding: 40px 20px;
}

.cadastro-tipo-selector h3 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 30px;
}

.tipo-options {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.tipo-btn {
    flex: 0 1 220px;
    padding: 40px 30px;
    background: #ffffff;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.tipo-btn:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.2);
}

.tipo-icon {
    font-size: 50px;
}

.tipo-label {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

/* ==================== Responsividade ==================== */
@media (max-width: 768px) {
    .cadastro-form-wrapper {
        padding: 30px 20px;
    }
    
    .cadastro-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .cadastro-form-group.col-half,
    .cadastro-form-group.col-quarter {
        min-width: 100%;
    }
    
    .cadastro-button-group {
        flex-direction: column;
    }
    
    .cadastro-btn {
        width: 100%;
        min-width: 100%;
    }
    
    .tipo-options {
        flex-direction: column;
    }
    
    .tipo-btn {
        flex: 1;
        width: 100%;
    }
    
    .cadastro-step-title {
        font-size: 20px;
    }
}

/* ==================== Animações ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* ==================== Código de Acesso ==================== */
.cadastro-codigo-acesso {
    text-align: center;
    padding: 40px 20px;
}

.codigo-acesso-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.cadastro-codigo-acesso h3 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.cadastro-codigo-acesso p {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 30px;
    line-height: 1.6;
}

.cadastro-codigo-acesso .cadastro-input {
    text-align: center;
    font-size: 20px;
    letter-spacing: 4px;
    font-weight: 600;
    padding: 15px;
}

.codigo-info {
    margin-top: 25px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
}

.codigo-info small {
    color: #7f8c8d;
    font-size: 14px;
}

/* ==================== Consulta CNPJ ====================*/
.cnpj-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
    font-style: italic;
}

.step-description {
    background: #ecf0f1;
    padding: 15px;
    border-left: 4px solid #3498db;
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
    border-radius: 4px;
}

/* Animação para campos preenchidos automaticamente */
.auto-filled {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: #d5f4e6;
    }
}

/* ==================== Acessibilidade ==================== */
.cadastro-form:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 5px;
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    .cadastro-input {
        border-width: 3px;
    }
    
    .cadastro-btn {
        border: 2px solid #000000;
    }
}

/* Reduzir movimentos para quem preferir */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
