* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1117;
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kyc-container {
    width: 100%;
    max-width: 480px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kyc-header {
    text-align: center;
    margin-bottom: 24px;
}

.kyc-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.kyc-header p {
    font-size: 0.85rem;
    color: #8b8f9a;
}

.camera-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #1a1d28;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #2a2e3a;
}

#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.frame-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 78%;
    aspect-ratio: 1.586 / 1;
    pointer-events: none;
    transition: opacity 0.3s;
}

.frame-guide.detected {
    opacity: 0;
}

.corner {
    position: absolute;
    width: 36px;
    height: 36px;
    border: 4px solid #4a90d9;
    transition: border-color 0.3s;
}

.corner.top-left {
    top: 0; left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 8px 0 0 0;
}

.corner.top-right {
    top: 0; right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 8px 0 0;
}

.corner.bottom-left {
    bottom: 0; left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 8px;
}

.corner.bottom-right {
    bottom: 0; right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 8px 0;
}

.frame-guide.aligned .corner {
    border-color: #2ecc71;
}

.status-badge {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    padding: 8px 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: all 0.3s;
}

.status-badge.success {
    background: rgba(46, 204, 113, 0.9);
}

.progress-ring {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
}

.progress-ring.active {
    display: flex;
}

.ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.15);
    stroke-width: 6;
}

.ring-fill {
    fill: none;
    stroke: #2ecc71;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 327;
    stroke-dashoffset: 327;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.1s linear;
}

.progress-text {
    position: absolute;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.check-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 23, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.check-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.checkmark-svg {
    width: 140px;
    height: 140px;
}

.check-circle {
    fill: none;
    stroke: #2ecc71;
    stroke-width: 4;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: drawCircle 0.6s ease forwards;
}

.check-path {
    fill: none;
    stroke: #2ecc71;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: drawCheck 0.4s 0.5s ease forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.instructions {
    margin-top: 20px;
    width: 100%;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 0.82rem;
    color: #8b8f9a;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4a90d9;
    flex-shrink: 0;
}

.start-btn,
.next-btn {
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.start-btn {
    background: #4a90d9;
    color: #fff;
}

.start-btn:hover {
    background: #3a7bc8;
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.next-btn {
    background: #2ecc71;
    color: #fff;
}

.next-btn:disabled {
    background: #2a2e3a;
    color: #8b8f9a;
    cursor: not-allowed;
}

.next-btn:not(:disabled):hover {
    background: #27ae60;
}

@media (max-width: 380px) {
    .corner {
        width: 28px;
        height: 28px;
    }
}