:root {
    --primary: #dc2626;
    --primary-hover: #b91c1c;
    --primary-light: #fef2f2;
    --bg-gray: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-light: #f3f4f6;
    --border-color: #e5e7eb;
    --radius: 24px;
    --radius-md: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.06);
    --transition: all 0.25s ease;
}
body {
    background-color: var(--bg-gray);
    color: var(--text-main);
    font-family: 'Inter', 'Vazirmatn', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}
.fa-body { direction: rtl; }

/* Header */
.main-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.header-brand img { height: 40px; border-radius: 8px; }
.header-brand-name { font-weight: 800; font-size: 1.25rem; color: var(--text-main); }
.lang-toggle {
    background: var(--bg-gray);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 4px;
}
.lang-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
}
.lang-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Progress */
.progress-container {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 0.5rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.progress-line-bg {
    position: absolute;
    top: 16px;
    left: 0;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    z-index: 1;
}
.progress-line-fill {
    position: absolute;
    top: 16px;
    left: 0;
    height: 4px;
    background: var(--primary);
    z-index: 2;
    transition: width 0.5s ease;
}
.fa-body .progress-line-fill { left: auto; right: 0; }
.step-indicator {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 52px;
}
.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #9ca3af;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    transition: 0.3s;
    border: 4px solid var(--bg-gray);
    box-sizing: content-box;
}
.step-circle.active, .step-circle.completed { background: var(--primary); color: white; }
.step-label {
    margin-top: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
    line-height: 1.2;
}
.step-circle.active ~ .step-label,
.step-circle.completed ~ .step-label { color: var(--primary); }

/* Main */
.app-main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1rem 4rem 1rem;
    min-height: 60vh;
}
.step-section { display: none; animation: fadeIn 0.4s ease forwards; }
.step-section.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.hc-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}
.hc-card-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 1.5rem;
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: start;
}
.form-group label { font-weight: 700; color: #374151; font-size: 1rem; }
select, input[type="text"], .hc-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: #f9fafb;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: 0.2s;
    box-sizing: border-box;
}
select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
    background: white;
}

/* Toggle (for Yes/No) */
.toggle-group { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.toggle-label { cursor: pointer; flex: 1; }
.toggle-label input { display: none; }
.toggle-btn {
    padding: 0.6rem 1rem;
    background: #f8fafc;
    color: #475569;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}
.toggle-label:hover .toggle-btn { background: #f1f5f9; }
.toggle-label input:checked + .toggle-btn {
    background: var(--primary-light);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 6px -1px rgba(220,38,38,0.15);
    padding: calc(0.6rem - 1px) calc(1rem - 1px);
}
@media (max-width: 480px) { .toggle-group { flex-direction: column; } }

/* Helper text */
.helper-text {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-weight: 400;
}

/* Navigation */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}
.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 700;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 10px;
    transition: 0.2s;
}
.btn-back:hover { color: var(--text-main); }
.btn-next {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
    transition: 0.2s;
}
.btn-next:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Live Score */
.live-score-bar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    position: sticky;
    top: 70px;
    z-index: 40;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.live-score-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}
.live-score-label { font-weight: 700; color: var(--text-muted); }
.live-score-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.live-score-max { color: var(--text-muted); font-weight: 600; }

/* Home */
#step-home.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    background: #ffffff;
    border-radius: 32px;
    padding: 2rem 1rem;
}
.home-container { max-width: 800px; margin: 0 auto; text-align: center; }
.home-header h1 { font-size: 2rem; font-weight: 700; color: #0f172a; margin-bottom: 0.5rem; }
.home-header .subtitle { font-size: 1rem; color: #475569; margin-bottom: 1.5rem; }
.intro-paragraph-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.intro-paragraph-box p { margin: 0; color: #334155; font-size: 0.95rem; line-height: 1.6; }
.info-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}
.info-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: start;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: var(--transition);
}
.info-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.icon-box {
    background: var(--primary-light);
    color: var(--primary);
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.info-text h4 { margin: 0 0 0.2rem 0; font-size: 0.95rem; font-weight: 700; color: #0f172a; }
.info-text p { margin: 0; font-size: 0.8rem; color: #64748b; }
.hero-btn {
    width: 100%;
    max-width: 350px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(220,38,38,0.2);
}
.hero-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.time-to-complete { margin-top: 1rem; font-size: 0.85rem; color: #64748b; }

/* Results */
.score-hero {
    background: #111827;
    color: white;
    padding: 3rem;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 2rem;
}
.score-number { font-size: 6rem; font-weight: 800; line-height: 1; margin: 1rem 0; color: white; }
.score-max { font-size: 1.5rem; color: #9ca3af; font-weight: 600; }
.ai-card {
    background: linear-gradient(145deg, #ffffff, var(--primary-light));
    border: 2px solid #fecaca;
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}
.ai-btn-large {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(220,38,38,0.2);
}
.ai-btn-large:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* Insight cards */
.insight-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    padding: 1.5rem 1.5rem 1.5rem 1.8rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    border-left: 5px solid var(--primary);
}
.fa-body .insight-card {
    border-left: 1px solid #f1f5f9;
    border-right: 5px solid var(--primary);
    padding: 1.5rem 1.8rem 1.5rem 1.5rem;
}
.insight-card:hover {
    border-color: #fecaca;
    box-shadow: 0 12px 24px -8px rgba(220,38,38,0.12);
    transform: translateY(-2px);
}
.insight-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.insight-content { flex: 1; }
.insight-content strong { display: block; font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 0.35rem; }

/* Breakdown */
.breakdown-row { margin-bottom: 1rem; }
.breakdown-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: #334155;
}
.breakdown-score { font-weight: 700; font-size: 1rem; color: var(--primary); }
.breakdown-bar-bg {
    width: 100%;
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.breakdown-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(to right, #f87171, var(--primary));
    transition: width 0.8s ease;
}
.breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #fee2e2;
    font-size: 1.1rem;
    font-weight: 700;
}
.breakdown-total .label { color: #1e293b; }
.breakdown-total .score { color: var(--primary); font-size: 1.3rem; }

/* Draws table (for snapshot) */
.draws-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}
.draws-table th {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 1.2rem;
    text-align: center;
}
.draws-table th:first-child { text-align: left; }
.draws-table td {
    padding: 0.9rem 1.2rem;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
}
.draws-table td:first-child { font-weight: 600; color: #1e293b; }
.draws-table tr:last-child td { border-bottom: none; }
.draws-table tr:hover td { background: #fef2f2; transition: background 0.2s; }
.fa-body .draws-table th:first-child { text-align: right; }

/* Lead modal */
.lead-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.lead-modal {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 2.5rem 1.8rem;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.8);
}
.lead-submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

/* Misc */
.hidden { display: none !important; }
.language-skills { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 768px) {
    .step-label { display: none; }
    .hc-card { padding: 1.5rem; }
    .info-cards-wrapper { grid-template-columns: 1fr; }
}

/* Font Awesome RTL fixes */
.fa-body .fas { font-family: 'Font Awesome 6 Free' !important; font-weight: 900 !important; direction: ltr; display: inline-block; line-height: 1.5 !important; }
.fa-body .far { font-family: 'Font Awesome 6 Free' !important; font-weight: 400 !important; direction: ltr; display: inline-block; line-height: 1.5 !important; }
.fa-body .fab { font-family: 'Font Awesome 6 Brands' !important; font-weight: 400 !important; direction: ltr; display: inline-block; line-height: 1.5 !important; }
.fa-body .rtl-arrow { transform: scaleX(-1); display: inline-block; }
/* ----- Lead Capture Modal Full Styles ----- */
.lead-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.lead-modal {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 2.5rem 1.8rem;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.8);
}
.lead-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.lead-modal-header i {
    color: var(--primary);
    font-size: 1.8rem;
}
.lead-modal h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.lead-modal p {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.lead-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1.5rem;
}
.lead-input-group input {
    font-size: 16px !important;
    padding: 0.9rem !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f9fafb;
    width: 100%;
    box-sizing: border-box;
}
.lead-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    text-align: right;
}
.lead-consent input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary);
}
#lead-score-preview {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
    color: #b91c1c;
    display: none;
}
#lead-form-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin: 0.8rem 0;
    font-size: 0.85rem;
    text-align: center;
}
.lead-submit-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}