﻿/* ============================================================
   CSS EXISTENTE DA CAPTURA BIOMÉTRICA
   ============================================================ */

.kazah-biometria {
    max-width: 480px;
    margin: 0 auto;
}

    .kazah-biometria .kb-card {
        background: #ffffff;
        border-radius: 28px;
        padding: 32px;
        text-align: center;
    }

    .kazah-biometria .kb-title {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 16px;
        color: #111827;
    }

    .kazah-biometria .kb-instruction {
        font-size: 14px;
        color: #6b7280;
        margin-bottom: 22px;
        line-height: 1.6;
    }

    .kazah-biometria .kb-camera-wrapper {
        position: relative;
        width: 100%;
        max-width: 360px;
        margin: 0 auto 20px auto;
        aspect-ratio: 1 / 1;
        border-radius: 24px;
        overflow: hidden;
        background: #f3f4f6;
    }

        .kazah-biometria .kb-camera-wrapper video {
            position: absolute;
            inset: 0;
            width: 100% !important;
            height: 100% !important;
            object-fit: cover;
            transform: scaleX(-1);
            border-radius: 24px;
        }

    .kazah-biometria video {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scaleX(-1);
    }

    .kazah-biometria .kb-scan-ring {
        position: absolute;
        width: 300px;
        height: 300px;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .kazah-biometria .kb-progress-ring circle {
        fill: none;
        stroke-width: 8;
    }

    .kazah-biometria .kb-ring-bg {
        stroke: rgba(0,0,0,0.08);
    }

    .kazah-biometria .kb-ring-fill {
        stroke: #2563eb;
        stroke-linecap: round;
        stroke-dasharray: 785;
        stroke-dashoffset: 785;
        transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.3s ease, filter 0.3s ease;
    }

    .kazah-biometria .kb-valid .kb-ring-fill {
        stroke: #22c55e;
        filter: drop-shadow(0 0 12px rgba(34,197,94,0.6));
    }

    .kazah-biometria .kb-invalid .kb-ring-fill {
        stroke: #ef4444;
    }

    .kazah-biometria .kb-progressing .kb-ring-fill {
        stroke: #2563eb;
        filter: drop-shadow(0 0 8px rgba(37,99,235,0.5));
        animation: kbRingPulse 1s ease-in-out infinite;
    }

@keyframes kbRingPulse {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(37,99,235,0.4));
    }

    50% {
        filter: drop-shadow(0 0 14px rgba(37,99,235,0.8));
    }
}

.kazah-biometria .kb-primary-btn {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    border: none;
    font-weight: 600;
    font-size: 16px;
    background: linear-gradient(135deg, #635EFF, #635EFF);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}

    .kazah-biometria .kb-primary-btn:hover {
        transform: translateY(-2px);
    }

.kazah-biometria .kb-status {
    height: 22px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    transition: opacity 0.25s ease, color 0.25s ease;
    opacity: 1;
}

    .kazah-biometria .kb-status.kb-status-fading {
        opacity: 0;
    }

    .kazah-biometria .kb-status.kb-status-error {
        color: #ef4444;
    }

    .kazah-biometria .kb-status.kb-status-ok {
        color: #22c55e;
    }

.kazah-biometria .kb-timeout-hint {
    font-size: 13px;
    color: #f59e0b;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    animation: kbFadeIn 0.4s ease;
    line-height: 1.5;
}

    .kazah-biometria .kb-timeout-hint.kb-hidden {
        display: none;
    }

.kazah-biometria .kb-success-box {
    margin-top: 20px;
    animation: kbFadeIn 0.5s ease;
}

.kazah-biometria .kb-result-avatar {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 24px auto;
    border-radius: 50%;
    overflow: visible;
}

    .kazah-biometria .kb-result-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        display: block;
    }

.kazah-biometria .kb-result-check {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 46px;
    height: 46px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 18px rgba(34,197,94,0.4);
    animation: kbPop 0.4s ease;
}

.kazah-biometria .kb-success-title {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.kazah-biometria .kb-success-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.kazah-biometria .kb-hidden {
    display: none;
}

@keyframes kbPop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes kbFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================================
   MODAL DE CONSENTIMENTO LGPD
   ============================================================ */

.kb-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: kbFadeIn 0.25s ease;
}

    .kb-consent-overlay.kb-hidden {
        display: none;
    }

.kb-consent-box {
    background: #ffffff;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header */
.kb-consent-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}

.kb-consent-badge {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 10px;
    border: 1px solid #bfdbfe;
}

.kb-consent-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin-bottom: 4px;
}

.kb-consent-subtitle {
    font-size: 13px;
    color: #9ca3af;
}

/* Body scrollável */
.kb-consent-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kb-consent-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.65;
}

.kb-consent-section {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kb-consent-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.02em;
}

.kb-consent-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

    .kb-consent-link:hover {
        text-decoration: underline;
    }

/* Checkbox customizado */
.kb-consent-check-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
    margin-top: 4px;
}

    .kb-consent-check-label:hover {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    /* Quando marcado */
    .kb-consent-check-label:has(input:checked) {
        border-color: #2563eb;
        background: #eff6ff;
    }

    .kb-consent-check-label input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

.kb-consent-check-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.kb-consent-check-label:has(input:checked) .kb-consent-check-box {
    background: #2563eb;
    border-color: #2563eb;
}

    .kb-consent-check-label:has(input:checked) .kb-consent-check-box::after {
        content: '✓';
        color: white;
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
    }

.kb-consent-check-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
}

/* Footer */
.kb-consent-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.kb-consent-accept-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #635EFF, #635EFF);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}

    .kb-consent-accept-btn:disabled {
        background: #e5e7eb;
        color: #9ca3af;
        box-shadow: none;
        cursor: not-allowed;
    }

    .kb-consent-accept-btn:not(:disabled):hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 24px rgba(37,99,235,0.4);
    }

.kb-consent-decline-btn {
    width: 100%;
    padding: 11px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .kb-consent-decline-btn:hover {
        background: #f9fafb;
        color: #374151;
    }
