/* ==========================================
   سامانه مدیریت منابع انسانی هیئت مجنون الحسین
   فایل استایل اصلی - نسخه نهایی 1.0
   ========================================== */

/* فونت وزیرمتن از CDN - چون IRANYekanX/Peyda فقط local() هستند و روی
   اکثر دستگاه‌های کاربران نصب نیستند، بدون این import فرم با فونت
   پیش‌فرض زشت مرورگر (Tahoma) نمایش داده می‌شد. */
@import url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.3/Vazirmatn-font-face.css');

/* ==========================================
   ۱. متغیرهای CSS (Design Tokens)
   ========================================== */
:root {
    --primary: #00B894;
    --primary-dark: #00D4AA;
    --primary-light: rgba(0, 184, 148, 0.15);
    --secondary: #4ade80;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --text: #F5F7FA;
    --text-light: #A7B0BE;
    --text-dark: #F5F7FA;
    --bg: #20252D;
    --bg-soft: #181C22;
    --bg-muted: #181C22;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.05);
    --shadow: 0 10px 30px -10px rgba(0, 184, 148, 0.12);
    --shadow-hover: 0 20px 40px -10px rgba(0, 184, 148, 0.2);
    --shadow-sm: 0 4px 12px -4px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   ۲. Reset و استایل‌های پایه
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'IRANYekanX', 'Peyda', 'Vazirmatn', 'Tahoma', sans-serif;
    font-optical-sizing: auto;
    background-color: #0F1115;
    color: var(--text);
    direction: rtl;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* فونت IRANYekanX - در صورت موجود بودن */
@font-face {
    font-family: 'IRANYekanX';
    src: local('IRANYekanX'), local('IRANYekanX-Regular');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IRANYekanX';
    src: local('IRANYekanX-Bold');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.4;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 10px; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ==========================================
   ۳. Liquid Background
   ========================================== */
.liquid-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    opacity: 0.08;
    z-index: -1;
    animation: float 15s infinite ease-in-out;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(30px, 20px) rotate(5deg);
    }
    66% {
        border-radius: 50% 50% 40% 60% / 40% 50% 60% 50%;
        transform: translate(-20px, 30px) rotate(-5deg);
    }
}

/* ==========================================
   ۴. Container و Card
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-sm {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.container-xs {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--border);
}

/* ==========================================
   ۵. Progress Bar
   ========================================== */
.progress-container {
    margin-bottom: 30px;
    text-align: center;
}

.progress-text {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================
   ۶. Form Elements
   ========================================== */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.form-label .required {
    color: var(--error);
    margin-right: 3px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    transition: var(--transition);
    background: var(--bg);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-light);
    font-size: 0.9rem;
}

.form-control:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: var(--bg);
}

.form-control.is-invalid {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.02);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-control:disabled {
    background: var(--bg-soft);
    cursor: not-allowed;
    opacity: 0.7;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 15px center;
    padding-left: 40px;
}

input[type="file"].form-control {
    padding: 10px;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    transition: var(--transition);
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--primary);
    color: white;
}

/* Checkbox و Radio سفارشی */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
    animation: slideDown 0.3s ease;
    font-weight: 500;
}

.error-msg.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   ۷. Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}

.btn-secondary {
    background: var(--bg-soft);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

/* Loading Spinner در دکمه */
.btn .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   ۸. Step Content (Multi-Step Form)
   ========================================== */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: stepIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   ۹. Signature Pad
   ========================================== */
.signature-wrapper {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: var(--bg-soft);
    transition: var(--transition);
}

.signature-wrapper:hover {
    border-color: var(--primary);
    background: rgba(0, 184, 148, 0.02);
}

.signature-wrapper.is-invalid {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.02);
}

#signature-canvas {
    width: 100%;
    height: 200px;
    background: white;
    border-radius: 8px;
    cursor: crosshair;
    touch-action: none;
    display: block;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    gap: 10px;
}

/* ==========================================
   ۱۰. Rules Card
   ========================================== */
.rules-card {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.05), rgba(74, 222, 128, 0.03));
    border: 1px solid rgba(0, 184, 148, 0.2);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin: 20px 0;
}

.rules-card h4 {
    color: var(--primary-dark);
    margin-bottom: 15px;
}

.rules-card ul {
    padding-right: 20px;
    color: var(--text);
    list-style: none;
}

.rules-card li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.8;
    position: relative;
    padding-right: 25px;
}

.rules-card li::before {
    content: '✓';
    position: absolute;
    right: 0;
    top: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
}

/* ==========================================
   ۱۱. Dynamic Items (Work History)
   ========================================== */
.dynamic-item {
    background: var(--bg-soft);
    padding: 24px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    position: relative;
    border: 1px solid var(--border-light);
    animation: fadeIn 0.3s ease;
}

.btn-remove {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--error);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-remove:hover {
    transform: scale(1.1) rotate(90deg);
    background: #dc2626;
}

/* ==========================================
   ۱۲. Summary Section
   ========================================== */
.summary-section {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.summary-section:last-child {
    border-bottom: none;
}

.summary-title {
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
}

.edit-link {
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition);
    font-weight: 500;
}

.edit-link:hover {
    color: var(--primary);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.summary-item {
    background: var(--bg);
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.summary-item label {
    font-size: 0.8rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 4px;
}

.summary-item span {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

/* ==========================================
   ۱۳. Photo Preview
   ========================================== */
.photo-preview {
    width: 130px;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 3px solid var(--primary);
    margin-top: 12px;
    display: none;
    box-shadow: var(--shadow-sm);
}

.photo-preview.show {
    display: block;
    animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* جعبه‌ی آپلود عکس - کلیک‌پذیر و دراگ‌فرندلی */
.photo-upload-box {
    display: block;
    cursor: pointer;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    background: var(--bg-soft);
    transition: var(--transition);
}

.photo-upload-box:hover {
    border-color: var(--primary);
    background: rgba(0, 184, 148, 0.04);
}

.photo-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 14px 0;
}

.photo-upload-icon {
    font-size: 2rem;
    animation: float-soft 3s ease-in-out infinite;
}

@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* راهنمای کوچک زیر فیلد‌ها (مثل هشدار شغل پدر) */
.field-hint {
    font-size: 0.8rem;
    color: var(--warning);
    margin-top: 8px;
    line-height: 1.7;
}

/* ==========================================
   ۱۳ب. Choice Pills (رادیو/چک‌باکس‌های زیبا برای گواهینامه و ...)
   ========================================== */
.choice-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.choice-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 18px;
    background: var(--bg-soft);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
    flex: 1 1 140px;
    justify-content: center;
}

.choice-pill:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.choice-pill:has(input:checked),
.choice-pill.checked {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.choice-pill-accent:has(input:checked),
.choice-pill-accent.checked {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.hadith-card {
    position: relative;
    overflow: hidden;
}

.hadith-card::before {
    content: '❝';
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 5rem;
    color: rgba(0, 184, 148, 0.08);
    font-family: Georgia, serif;
    line-height: 1;
}

/* ==========================================
   ۱۴. Success Page
   ========================================== */
.success-box {
    text-align: center;
    padding: 40px 25px;
}

.success-icon {
    font-size: 5rem;
    color: var(--success);
    margin-bottom: 20px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.tracking-code {
    background: linear-gradient(135deg, var(--primary-light), rgba(74, 222, 128, 0.1));
    padding: 20px 30px;
    border-radius: var(--radius-sm);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: 3px;
    margin: 20px auto;
    display: inline-block;
    border: 2px dashed var(--primary);
    font-family: 'Courier New', monospace;
}

/* ==========================================
   ۱۵. Toast Notification
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 450px;
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-right: 4px solid var(--primary);
    pointer-events: auto;
}

.toast.success {
    border-right-color: var(--success);
}

.toast.error {
    border-right-color: var(--error);
}

.toast.warning {
    border-right-color: var(--warning);
}

.toast.info {
    border-right-color: var(--info);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
    padding: 4px;
    transition: var(--transition);
}

.toast-close:hover {
    color: var(--error);
}

@keyframes slideInLeft {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.hide {
    animation: slideOutLeft 0.3s ease forwards;
}

@keyframes slideOutLeft {
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

/* ==========================================
   ۱۶. Modal
   ========================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: var(--radius);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-lg);
}

.modal-xl {
    width: 95%;
    max-width: 1200px;
}

.modal-lg {
    width: 90%;
    max-width: 900px;
}

.modal-sm {
    width: 90%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary-light), transparent);
    flex-shrink: 0;
}

.modal-header h2 {
    color: var(--primary-dark);
    font-size: 1.3rem;
}

.modal-close {
    background: var(--bg-soft);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--error);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   ۱۷. Skeleton Loading
   ========================================== */
.skeleton-loader {
    padding: 20px;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-row {
    height: 60px;
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-block {
    height: 200px;
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

/* ==========================================
   ۱۸. Switch Toggle
   ========================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: 0.3s;
    border-radius: 30px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    right: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

input:checked + .slider::before {
    transform: translateX(-26px);
}

/* اصلاح باگ: نمایش واضح وضعیت «غیرفعال» با رنگ قرمز */
.switch input:not(:checked) + .slider {
    background: rgba(239, 68, 68, 0.55);
}

.switch-label {
    font-weight: 600;
    color: var(--text);
    margin-right: 10px;
}

/* ==========================================
   ۱۹. Badge
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-skill {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.badge-interest {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

/* ==========================================
   ۲۰. Empty State
   ========================================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
}

/* ==========================================
   ۲۱. Utilities
   ========================================== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }
.text-bold { font-weight: 700; }

.persian-num {
    font-feature-settings: "ss01";
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* ==========================================
   ۲۲. Responsive
   ========================================== */
@media (max-width: 768px) {
    .container, .container-sm, .container-xs {
        padding: 15px;
    }
    
    .card {
        padding: 20px;
        border-radius: var(--radius-md);
    }
    
    .btn-group {
        flex-direction: column-reverse;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    
    .toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
    
    .modal-content {
        width: 100%;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body {
        padding: 15px 20px;
    }
    
    .tracking-code {
        font-size: 1.3rem;
        padding: 15px 20px;
    }

    .choice-group {
        gap: 10px;
    }

    .choice-pill {
        padding: 11px 14px;
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    .card {
        padding: 16px;
        border-radius: var(--radius-sm);
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .form-label {
        font-size: 0.88rem;
    }

    .form-group {
        margin-bottom: 18px;
    }
    
    .btn {
        padding: 13px 18px;
        font-size: 0.95rem;
        width: 100%;
    }

    .btn-group {
        gap: 10px;
    }

    .rules-card {
        padding: 16px;
    }

    .rules-card ul {
        padding-right: 18px;
        font-size: 0.85rem;
    }
    
    #signature-canvas {
        height: 150px;
    }

    .signature-wrapper {
        padding: 8px;
    }

    /* استک شدن گزینه‌های گواهینامه و پاسخ‌های بله/خیر روی موبایل کوچک */
    .choice-group {
        flex-direction: column;
    }

    .choice-pill {
        width: 100%;
    }

    .photo-preview {
        width: 110px;
        height: 135px;
    }

    .photo-upload-icon {
        font-size: 1.6rem;
    }

    .progress-text {
        font-size: 0.85rem;
    }

    /* هدر صفحه فرم - آیکون و عنوان کوچک‌تر روی موبایل خیلی کوچک */
    h1 { font-size: 1.3rem; }
    h2 { font-size: 1.05rem; }

    .liquid-bg {
        width: 90vw;
        height: 90vw;
    }
}

@media (max-width: 360px) {
    .card {
        padding: 14px;
    }

    .form-control {
        padding: 11px 12px;
    }

    .btn {
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

/* بهبود تجربه لمسی: بزرگ‌تر کردن نواحی قابل کلیک روی صفحات لمسی */
@media (hover: none) and (pointer: coarse) {
    .choice-pill,
    .btn,
    .form-control,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
    }

    input[type="checkbox"],
    input[type="radio"] {
        min-height: 20px;
        width: 20px;
        height: 20px;
    }
}

/* ==========================================
   ۲۳. Print Styles
   ========================================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print,
    .btn,
    .toast-container,
    .liquid-bg,
    .sidebar,
    .main-header {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* ==========================================
   ۲۴. Scrollbar سفارشی
   ========================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================
   ۲۵. Selection
   ========================================== */
::selection {
    background: var(--primary);
    color: white;
}

/* ==========================================
   ۲۶. Focus Visible (Accessibility)
   ========================================== */
*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}