    <style>
        :root { --primary: #5d5fef; --bg: #f5f5f7; --text: #1d1d1f; --success: #34c759; }
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { margin: 0; background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow: hidden; color: var(--text); }

        .app-layout { display: flex; flex-direction: column; height: 100vh; position: relative; }

        /* --- Header & Stepper --- */
        .top-bar {
            padding: 50px 24px 15px;
            background: white; z-index: 10; border-radius: 0 0 24px 24px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.03);
        }
        .stepper-wrapper { display: flex; align-items: center; justify-content: space-between; position: relative; margin-bottom: 5px; }
        .stepper-line { position: absolute; top: 50%; left: 0; right: 0; height: 2px; background: #e0e0e0; z-index: 0; transform: translateY(-50%); }
        .stepper-fill { position: absolute; top: 50%; left: 0; height: 2px; background: var(--primary); z-index: 0; transform: translateY(-50%); width: 0%; transition: width 0.4s ease; }

        .step-item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; background: white; padding: 0 8px; }
        .step-circle {
            width: 30px; height: 30px; border-radius: 50%; background: white; border: 2px solid #e0e0e0;
            display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 13px; color: #aaa;
            transition: all 0.3s;
        }
        .step-item.active .step-circle { border-color: var(--primary); background: var(--primary); color: white; box-shadow: 0 0 0 4px rgba(93, 95, 239, 0.2); }
        .step-item.completed .step-circle { border-color: var(--success); background: var(--success); color: white; }
        .step-label { font-size: 11px; margin-top: 5px; color: #888; font-weight: 500; }
        .step-item.active .step-label { color: var(--primary); font-weight: 700; }
        .step-item.hidden { display: none; }

        /* --- Camera Section --- */
        .camera-container {
            flex: 1; margin: 16px; border-radius: 28px; overflow: hidden; position: relative; background: black;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1); transform: translateZ(0);
        }
        video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
        video.mirrored { transform: scaleX(-1); }

        .overlay-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.45); z-index: 2; pointer-events: none; }

        .viewfinder {
            position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
            z-index: 3; transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 0 0 5000px rgba(0,0,0,0.45);
        }

        .viewfinder.idcard {
            width: 85%; aspect-ratio: 1.586; border-radius: 16px; border: 2px solid white;
        }
        .viewfinder.idcard::after {
            content: ''; position: absolute; inset: -2px; border: 2px solid transparent; border-radius: 16px;
            background: linear-gradient(to right, var(--primary) 20px, transparent 20px) top left,
            linear-gradient(to bottom, var(--primary) 20px, transparent 20px) top left,
            linear-gradient(to left, var(--primary) 20px, transparent 20px) top right,
            linear-gradient(to bottom, var(--primary) 20px, transparent 20px) top right,
            linear-gradient(to right, var(--primary) 20px, transparent 20px) bottom left,
            linear-gradient(to top, var(--primary) 20px, transparent 20px) bottom left,
            linear-gradient(to left, var(--primary) 20px, transparent 20px) bottom right,
            linear-gradient(to top, var(--primary) 20px, transparent 20px) bottom right;
            background-repeat: no-repeat; background-size: 20px 20px;
        }

        .viewfinder.selfie {
            width: 65%; aspect-ratio: 0.8; border-radius: 50%; border: 3px solid white;
            box-shadow: 0 0 0 5000px rgba(0,0,0,0.7);
        }
        .viewfinder.selfie.good {
            border-color: #34c759;
            box-shadow: 0 0 0 5000px rgba(0,0,0,0.7), 0 0 0 6px rgba(52,199,89,0.25);
        }
        .viewfinder.selfie.bad {
            border-color: #ef4444;
            box-shadow: 0 0 0 5000px rgba(0,0,0,0.7), 0 0 0 6px rgba(239,68,68,0.25);
        }

        .hint-text {
            position: absolute; top: 25px; width: 100%; text-align: center; color: white;
            z-index: 4; text-shadow: 0 2px 4px rgba(0,0,0,0.6); font-size: 14px; font-weight: 500; letter-spacing: 0.5px;
        }

        .controls {
            padding: 20px 30px calc(40px + env(safe-area-inset-bottom));
            display: flex; align-items: center; justify-content: space-between;
            background: var(--bg);
        }

        .btn-round {
            width: 52px; height: 52px; border-radius: 50%; border: none; background: #fff;
            display: flex; align-items: center; justify-content: center; cursor: pointer; color: #333;
            box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: 0.2s;
        }
        .btn-round svg { width: 24px; height: 24px; fill: #333; }
        .btn-round:active { transform: scale(0.95); }
        .btn-round.hidden { opacity: 0; pointer-events: none; }

        .shutter-outer { width: 80px; height: 80px; border-radius: 50%; border: 4px solid #e0e0e0; display: flex; align-items: center; justify-content: center; cursor: pointer; background: white; }
        .shutter-inner { width: 64px; height: 64px; background: var(--primary); border-radius: 50%; transition: 0.2s; }
        .shutter-outer:active .shutter-inner { transform: scale(0.85); }

        /* --- Review Modal --- */
        .review-modal { position: fixed; inset: 0; background: white; z-index: 100; display: none; flex-direction: column; }
        .review-header { padding: 40px 20px 15px; text-align: center; border-bottom: 1px solid #f0f0f0; }
        .review-img-wrap { flex: 1; display: flex; align-items: center; justify-content: center; background: #f9f9f9; padding: 20px; }
        .review-img-wrap img { max-width: 100%; max-height: 75vh; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
        .modal-actions { padding: 20px 25px calc(30px + env(safe-area-inset-bottom)); display: flex; gap: 15px; }
        .btn-block { flex: 1; padding: 18px; border-radius: 16px; border: none; font-size: 16px; font-weight: 700; cursor: pointer; }
        .btn-grey { background: #f2f2f7; color: #1c1c1e; }
        .btn-primary { background: var(--primary); color: white; }

        .status-screen {
            position: fixed; inset: 0; background: white; z-index: 200;
            display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center;
        }

        .spinner { width: 45px; height: 45px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 25px; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        .success-icon-wrap {
            width: 80px; height: 80px; border-radius: 50%; background: var(--success);
            display: flex; align-items: center; justify-content: center; margin-bottom: 24px;
            box-shadow: 0 10px 25px rgba(52, 199, 89, 0.3);
            animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .checkmark {
            width: 32px; height: 18px; border-left: 5px solid white; border-bottom: 5px solid white;
            transform: rotate(-45deg) translate(2px, -4px);
        }
        @keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

        .status-title { font-size: 22px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
        .status-desc { font-size: 15px; color: #888; margin: 0; padding: 0 40px; line-height: 1.5; }
		/* --- استایل‌های جدید برای مرحله اول (Info Form) --- */
.user-input-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
    width: 100%;
    z-index: 20;
}

.user-input-card {
    background: white;
    width: 100%;
    max-width: 400px; /* عرض کارت */
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin-top: 10px;
    text-align: left;
}

/* استایل اینپوت‌ها برای تم روشن */
.user-input-card input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #e5e5ea; /* بوردر طوسی روشن */
    background: #f2f2f7; /* پس‌زمینه طوسی خیلی روشن */
    color: #1d1d1f; /* متن تیره */
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    margin-top: 5px;
}

.user-input-card input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(93, 95, 239, 0.1);
}

.user-input-card label {
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    margin-left: 4px;
}

/* دکمه ادامه */
#userInputContinueBtn {
    margin-top: 20px;
    border-radius: 16px;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(93, 95, 239, 0.3);
}
:root {
  --primary: #5d5fef;
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --success: #34c759;
}

body {
  background: var(--bg) !important;
  color: var(--text) !important;
}
#faceDrawingCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* تا مانع لمس دکمه‌ها نشود */
}

.gallery-crop-modal {
    position: fixed;
    inset: 0;
    background: white;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 101;
    display: none;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
}

.gallery-crop-body {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px 0;
    background: #f8f8fb;
    overflow: hidden;
}

.gallery-crop-canvas-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gallery-crop-body img {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.gallery-crop-canvas-wrap #galleryCropImage {
    opacity: 1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    touch-action: auto;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-crop-canvas-wrap .cropper-container {
    position: relative !important;
    width: 100%;
    height: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.gallery-crop-canvas-wrap .cropper-canvas {
    cursor: grab;
}

.gallery-crop-canvas-wrap .cropper-canvas:active {
    cursor: grabbing;
}

.gallery-crop-modal .modal-actions {
    flex: 0 0 auto;
    position: relative;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    margin-top: auto;
    border-top: 1px solid #ececf0;
    background: white;
    gap: 10px;
}

.gallery-crop-canvas-wrap .cropper-view-box {
    outline: 2px solid rgba(93, 95, 239, 0.55);
    outline-offset: -2px;
}

.gallery-crop-canvas-wrap .cropper-face,
.gallery-crop-canvas-wrap .cropper-move {
    cursor: grab;
}

.gallery-crop-canvas-wrap .cropper-face:active,
.gallery-crop-canvas-wrap .cropper-move:active {
    cursor: grabbing;
}
    </style>
