/**
 * KYC Internal Verification Styles v1.0.0
 * Matches existing earthlings design language
 */

/* ==========================================
   OVERLAY
   ========================================== */
.kyci-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kyci-overlay.visible {
    opacity: 1;
}

/* ==========================================
   MODAL
   ========================================== */
.kyci-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}

.kyci-overlay.visible .kyci-modal {
    transform: translateY(0) scale(1);
}

/* ==========================================
   HEADER
   ========================================== */
.kyci-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.kyci-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kyci-header-icon {
    font-size: 24px;
}

.kyci-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.kyci-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kyci-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* ==========================================
   PROGRESS STEPS
   ========================================== */
.kyci-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 24px 8px;
}

.kyci-prog-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 70px;
}

.kyci-prog-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: #e5e7eb;
    color: #94a3b8;
    transition: all 0.3s ease;
}

.kyci-prog-step.active .kyci-prog-dot {
    background: linear-gradient(135deg, #4a90e2 0%, #1abce3 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.kyci-prog-step.done .kyci-prog-dot {
    background: #22c55e;
    color: #fff;
}

.kyci-prog-step.done .kyci-prog-dot::after {
    content: '✓';
    font-size: 16px;
}

.kyci-prog-step span {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.kyci-prog-step.active span {
    color: #4a90e2;
    font-weight: 600;
}

.kyci-prog-step.done span {
    color: #22c55e;
}

.kyci-prog-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 4px;
    margin-bottom: 22px;
    max-width: 60px;
}

/* ==========================================
   CONTENT / PANELS
   ========================================== */
.kyci-content {
    padding: 8px 24px 24px;
}

.kyci-panel {
    display: none;
}

.kyci-panel.active {
    display: block;
    animation: kyci-fadeIn 0.3s ease;
}

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

.kyci-panel-header {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.kyci-panel-icon {
    font-size: 28px;
    flex-shrink: 0;
    margin-top: 2px;
}

.kyci-panel-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.kyci-hint {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

/* ==========================================
   DROPZONE
   ========================================== */
.kyci-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 32px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.kyci-dropzone:hover {
    border-color: #4a90e2;
    background: #f0f0ff;
}

.kyci-dropzone.dragover {
    border-color: #4a90e2;
    background: #eef2ff;
    border-style: solid;
}

.kyci-dropzone-content {
    text-align: center;
}

.kyci-dropzone-icon {
    color: #94a3b8;
    margin-bottom: 8px;
}

.kyci-dropzone:hover .kyci-dropzone-icon {
    color: #4a90e2;
}

.kyci-dropzone-text {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.kyci-dropzone-or {
    margin: 4px 0;
    font-size: 12px;
    color: #94a3b8;
}

.kyci-btn-select {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #1abce3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin: 8px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kyci-btn-select:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.kyci-dropzone-formats {
    margin: 4px 0 0;
    font-size: 11px;
    color: #94a3b8;
}

.kyci-dropzone-small {
    padding: 20px 16px;
    border-radius: 12px;
}

.kyci-dropzone-small p {
    margin: 0;
    font-size: 14px;
    color: #4a90e2;
    font-weight: 600;
}

/* ==========================================
   PREVIEW
   ========================================== */
.kyci-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    margin-bottom: 4px;
}

.kyci-preview img {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
    background: #f1f5f9;
}

.kyci-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.kyci-preview-remove:hover {
    background: rgba(220, 38, 38, 0.9);
}

/* ==========================================
   CAMERA
   ========================================== */
.kyci-camera {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    margin-bottom: 4px;
}

.kyci-camera video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.kyci-face-guide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.kyci-face-guide svg {
    width: 55%;
    height: 75%;
    opacity: 0.7;
}

/* ==========================================
   FALLBACK
   ========================================== */
.kyci-fallback {
    text-align: center;
    padding: 8px 0;
}

.kyci-fallback > p {
    font-size: 13px;
    color: #92400e;
    background: #fef3c7;
    padding: 10px 14px;
    border-radius: 8px;
    margin: 0 0 12px;
}

/* ==========================================
   ACTIONS / BUTTONS
   ========================================== */
.kyci-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    justify-content: flex-end;
}

.kyci-btn-next,
.kyci-btn-submit {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4a90e2 0%, #1abce3 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.kyci-btn-next:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.kyci-btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.kyci-btn-submit {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.kyci-btn-submit:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.kyci-btn-back,
.kyci-btn-cancel {
    padding: 12px 20px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.kyci-btn-back:hover,
.kyci-btn-cancel:hover {
    background: #e2e8f0;
}

.kyci-btn-capture {
    padding: 12px 24px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.kyci-btn-capture:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* ==========================================
   PROCESSING
   ========================================== */
.kyci-processing {
    text-align: center;
    padding: 32px 0 16px;
}

.kyci-processing h3 {
    margin: 16px 0 8px;
    font-size: 18px;
    color: #1e293b;
}

.kyci-spinner {
    display: flex;
    justify-content: center;
}

.kyci-spinner-ring {
    width: 56px;
    height: 56px;
    border: 4px solid #e5e7eb;
    border-top-color: #4a90e2;
    border-radius: 50%;
    animation: kyci-spin 1s linear infinite;
}

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

.kyci-progress-bar {
    margin-top: 20px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.kyci-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a90e2, #1abce3);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ==========================================
   RESULT
   ========================================== */
.kyci-result {
    text-align: center;
    padding: 24px 0 8px;
}

.kyci-result-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

.kyci-res-success { animation: kyci-bounce 0.5s ease; }
.kyci-res-review { animation: kyci-fadeIn 0.5s ease; }
.kyci-res-failed { animation: kyci-shake 0.5s ease; }

@keyframes kyci-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

.kyci-result h3 {
    margin: 8px 0;
    font-size: 20px;
    color: #1e293b;
}

.kyci-result p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
}

.kyci-result-details {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.kyci-score {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #475569;
}

.kyci-score + .kyci-score {
    border-top: 1px solid #e5e7eb;
}

.kyci-score-val {
    font-weight: 700;
}

.kyci-score-val.pass {
    color: #22c55e;
}

.kyci-score-val.fail {
    color: #ef4444;
}

/* ==========================================
   TOAST
   ========================================== */
.kyci-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.kyci-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.kyci-toast-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.kyci-toast-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 480px) {
    .kyci-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    .kyci-modal {
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
    }

    .kyci-content {
        padding: 8px 16px 24px;
    }

    .kyci-dropzone {
        padding: 24px 12px;
    }

    .kyci-actions {
        flex-direction: column;
    }

    .kyci-actions button {
        width: 100%;
        justify-content: center;
    }

    .kyci-camera {
        border-radius: 12px;
    }
}
