: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;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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 & Language */
.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 Bar */
.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: #e5e7eb; 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: #e5e7eb; 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 Layout */
.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); } }

/* Home Step */
#step-0.active { display: flex; align-items: center; justify-content: center; min-height: 70vh; text-align: center; background: #ffffff; border-radius: 32px; }
.home-container { max-width: 800px; margin: 0 auto; padding: 1rem 1rem; text-align: center; }
.home-container h1 { font-size: 2rem; font-weight: 700; color: #0f172a; margin-bottom: 0.5rem; }
.home-container .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; }
.intro-paragraph-box p { margin: 0; font-size: 0.95rem; line-height: 1.6; color: #334155; }
.info-cards-wrapper { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-bottom: 2.5rem; }
.info-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; display: flex; align-items: center; text-align: start; gap: 1rem; }
.icon-box { background: #fef2f2; color: #dc2626; 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; color: #0f172a; font-weight: 700; }
.info-text p { margin: 0; font-size: 0.8rem; color: #64748b; }
.formal-btn.hero-btn {
    background-color: #dc2626;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center; 
    gap: 0.75rem;
    width: 100%;
    max-width: 350px;
    margin: 2rem auto 0;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(220,38,38,0.15);
}
.formal-btn.hero-btn:hover { background: #b91c1c; transform: translateY(-1px); }
.time-to-complete { margin-top: 1rem; font-size: 0.85rem; color: #64748b; }

/* Cards & Inputs */
.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; }
.form-group label { font-weight: 700; color: #374151; font-size: 1rem; }
.helper-text { font-size: 0.85rem; color: #64748b; margin-bottom: 0.75rem; }
select, .hc-select { 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; }
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(220,38,38,0.1); background: white; }
.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; }
.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); }

/* Results */
.score-hero { background: #111827; color: white; padding: 3rem; border-radius: var(--radius); text-align: center; margin-bottom: 2rem; }
.score-number { font-size: 3rem; font-weight: 800; line-height: 1; margin: 1rem 0; color: white; }
.ai-card { background: linear-gradient(145deg, #ffffff, #fef2f2); 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; }
.ai-btn-large:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* 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); border-radius: 28px; padding: 2.5rem 1.8rem; max-width: 460px; width: 100%; text-align: center; border: 1px solid rgba(255,255,255,0.8); }
.lead-input-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 1.5rem; }
.hc-input { font-size: 16px !important; padding: 0.9rem !important; border: 1px solid #e5e7eb; border-radius: 12px; }
.lead-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: #4b5563; margin-bottom: 1.5rem; }
.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; }

/* Utility */
.space-y-4 > * + * { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.rounded-lg { border-radius: 0.5rem; }
.p-3 { padding: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-medium { font-weight: 500; }

/* RTL */
.fa-body .rtl-arrow { transform: rotate(180deg); }

/* Responsive */
@media (max-width: 768px) {
    .hc-card { padding: 1.5rem; }
}
@media (min-width: 768px) {
    .info-cards-wrapper { grid-template-columns: repeat(3, 1fr); }
}