/* ==========================================================================
   ConektC SaaS Helper - Estilos Globais e Design System Premium
   ========================================================================== */

/* Importar Fonte Moderna */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

#conektc-saas-app {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #f8fafc;
    background: linear-gradient(135deg, #002b4d 0%, #00A1B3 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 650px;
    margin: 40px auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Elementos Ocultos e Controle de Fluxo */
.form-step {
    display: none;
    animation: fadeInStep 0.4s ease-in-out forwards;
}

.form-step.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Cabeçalho do Mascote (Linko) */
.mascote-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mascote-avatar-img, .linko-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.4s ease-in-out;
    border: 4px solid transparent;
    flex-shrink: 0;
}

/* Efeitos Neon no Mascote baseado nos estados */
.mascote-avatar-img.state-idle, .linko-avatar.state-idle {
    border-color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
    animation: pulse-idle 2.5s infinite alternate;
}

.mascote-avatar-img.state-thinking, .linko-avatar.state-thinking {
    border-color: #00d2ff;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
    animation: pulse-thinking 1.5s infinite alternate;
}

.mascote-avatar-img.state-warning, .linko-avatar.state-warning {
    border-color: #ff3366;
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
    animation: pulse-warning 1s infinite alternate;
}

.mascote-avatar-img.state-success, .linko-avatar.state-success {
    border-color: #ffcc00;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    animation: pulse-success 2s infinite alternate;
}

/* Balao de Fala do Mascote */
.mascote-balao {
    background: rgba(255, 255, 255, 0.07);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    flex-grow: 1;
}

.mascote-balao::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: #242424;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mascote-balao p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #e2e8f0;
}

/* Alertas de Erro */
.alert-box {
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: #ff8093;
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s ease-in-out;
}

/* Estilização de Formulários */
#conektc-form label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#conektc-form input[type="text"],
#conektc-form input[type="email"],
#conektc-form textarea,
#conektc-form select,
.billing-fields input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#conektc-form input:focus,
#conektc-form textarea:focus,
#conektc-form select:focus,
.billing-fields input:focus {
    outline: none;
    border-color: #00d2ff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
    background: rgba(0, 0, 0, 0.5);
}

#conektc-form textarea {
    height: 100px;
    resize: vertical;
}

#conektc-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    cursor: pointer;
}

/* Seção de Verificação de Código */
.code-verify-section {
    background: rgba(0, 255, 136, 0.03);
    border: 1px dashed rgba(0, 255, 136, 0.2);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    animation: zoomIn 0.3s ease-out;
}

.code-verify-section label {
    text-align: center;
    margin-bottom: 15px !important;
}

#conektc-codigo-validacao {
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 6px;
    max-width: 200px;
    margin: 0 auto 20px !important;
    display: block;
    font-weight: 700;
}

/* Botões */
.btn-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
}

button, .btn-next, .btn-prev, .btn-pago {
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-next, #btn-enviar-codigo, #btn-confirmar-codigo, #btn-submit, #btn-pay, .btn-pago {
    background: linear-gradient(90deg, #00ff88 0%, #00d2ff 100%);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.btn-next:hover, #btn-enviar-codigo:hover, #btn-confirmar-codigo:hover, #btn-submit:hover, #btn-pay:hover, .btn-pago:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
}

.btn-prev {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.btn-prev:hover {
    background: rgba(255, 255, 255, 0.15);
}

button:disabled, .btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Spinner de Carregamento */
#conektc-loading {
    text-align: center;
    padding: 40px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #00d2ff;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

/* Resultado da IA e Funil de Vendas */
.resultado-box {
    background: rgba(255, 255, 255, 0.04);
    border-left: 5px solid #00ff88;
    padding: 25px;
    border-radius: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.resultado-box h3 {
    margin-top: 0;
    font-size: 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.funnel-container {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.funnel-stage {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
}

.stage-topo {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.2) 0%, rgba(0, 210, 255, 0.05) 100%);
    border-left: 4px solid #00d2ff;
    width: 100%;
}

.stage-meio {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-left: 4px solid #8b5cf6;
    width: 85%;
}

.stage-fundo {
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 255, 136, 0.05) 100%);
    border-left: 4px solid #00ff88;
    width: 70%;
}

.funnel-label {
    color: #e2e8f0;
}

.funnel-qty {
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.projection-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    margin-bottom: 30px;
}

.projection-card h4 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.projection-card .revenue {
    font-size: 32px;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-ir-pagamento, .btn-pago {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    text-decoration: none;
}

/* Seção de Checkout */
.checkout-container {
    animation: fadeInStep 0.4s ease-in-out;
}

.checkout-summary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.summary-item strong {
    color: #00ff88;
    font-size: 20px;
}

.summary-item small {
    color: #cbd5e1;
    font-size: 12px;
}

.payment-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.btn-method {
    flex: 1;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-size: 14px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: none;
}

.btn-method.active {
    background: rgba(0, 210, 255, 0.1);
    border-color: #00d2ff;
    color: #00d2ff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.15);
}

#pix-copia-cola {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 14px !important;
    padding: 12px !important;
    font-family: monospace !important;
    border-radius: 8px !important;
    margin-bottom: 15px !important;
}

#btn-copiar-pix {
    width: 100%;
    margin-bottom: 20px;
}

/* ==========================================================================
   Animações e Keyframes
   ========================================================================== */
@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Keyframes das Bordas Pulsantes */
@keyframes pulse-idle {
    0% { box-shadow: 0 0 10px rgba(0, 255, 136, 0.3); }
    100% { box-shadow: 0 0 25px rgba(0, 255, 136, 0.7); }
}

@keyframes pulse-thinking {
    0% { box-shadow: 0 0 10px rgba(0, 210, 255, 0.3); transform: scale(1); }
    100% { box-shadow: 0 0 25px rgba(0, 210, 255, 0.7); transform: scale(1.03); }
}

@keyframes pulse-warning {
    0% { box-shadow: 0 0 10px rgba(255, 51, 102, 0.3); }
    100% { box-shadow: 0 0 25px rgba(255, 51, 102, 0.8); }
}

@keyframes pulse-success {
    0% { box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 30px rgba(255, 204, 0, 0.8); transform: scale(1.05); }
    100% { box-shadow: 0 0 10px rgba(255, 204, 0, 0.3); transform: scale(1); }
}

/* Responsividade Básica */
@media (max-width: 600px) {
    #conektc-saas-app {
        padding: 20px;
        margin: 15px auto;
        border-radius: 12px;
    }
    
    .mascote-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .mascote-balao::before {
        display: none; /* remove seta lateral em mobile */
    }
    
    .payment-methods {
        flex-direction: column;
    }
}