:root {
    --primary: #195cfb;
    --primary-hover: #1142c4;
    --primary-light: #eef4ff;
    
    --bg-gray: #f9fafb;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #64748b;
    --border-light: #f3f4f6;
    --border-color: #e2e8f0;
    
    --radius-md: 16px;
    --radius: 24px;
    
    --shadow: 0 4px 6px -1px rgba(25, 92, 251, 0.05), 0 10px 15px -3px rgba(25, 92, 251, 0.08);
    --shadow-md: 0 10px 15px -3px rgba(25, 92, 251, 0.1), 0 4px 6px -2px rgba(25, 92, 251, 0.05);
    --transition: all 0.2s ease;
}

body {
    background-color: var(--bg-gray);
    color: var(--text-main);
    font-family: 'Noto Sans', 'Vazirmatn', sans-serif !important;
    margin: 0; padding: 0; line-height: 1.6;
}

.fa-body {
    direction: rtl;
    font-family: 'IRANYekanX', 'Vazirmatn', 'Tahoma', sans-serif !important;
}

/* 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-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: var(--transition); 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: 60px; }
.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); }

/* App 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); } }

/* Home / Intro Step */
#step-0.active { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 75vh; padding: 2rem 1rem; background: #ffffff; border-radius: 32px; }
.home-container { width: 100%; max-width: 800px; text-align: center; }
.home-header h1 { font-size: 2.2rem; color: #0f172a; margin-bottom: 0.5rem; font-weight: 800; }
.home-header .subtitle { font-size: 1.1rem; color: #64748b; margin-bottom: 2rem; }
.intro-paragraph-box { background: var(--primary-light); border: 1px solid #c7d2fe; border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 2rem; color: #334155; font-size: 0.95rem; line-height: 1.6; }

.info-cards-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.info-card { background: white; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; text-align: start; transition: var(--transition); }
.info-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.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; color: #0f172a; font-weight: 700; }
.info-text p { margin: 0; font-size: 0.8rem; color: var(--text-muted); }

.hero-btn { background-color: var(--primary); color: #ffffff; border: none; border-radius: 24px; padding: 1rem 2rem; 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 12px rgba(25, 92, 251, 0.3); }
.hero-btn:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(25, 92, 251, 0.4); }
.time-to-complete { margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }

/* Forms & 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.6rem; 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 1fr; 
    gap: 1.5rem; 
    align-items: stretch; 
}
.form-grid.full { grid-template-columns: 1fr; }

.form-group { 
    display: flex; 
    flex-direction: column; 
    text-align: start; 
    height: 100%; 
}
.form-group.full-width { grid-column: 1 / -1; }

.form-group label { font-weight: 700; margin-bottom: 0.5rem; color: #374151; font-size: 0.95rem; }
.helper-text { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.8rem 0; line-height: 1.5; }


select, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"] {
    margin-top: auto; 
    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: var(--transition); 
    box-sizing: border-box;
}
select:focus, input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25, 92, 251, 0.15); background: white; }

/* Radio Cards (Path Selection) */
.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.path-label { cursor: pointer; }
.path-label input { display: none; }
.path-card { border: 2px solid var(--border-color); border-radius: 16px; padding: 1.5rem; text-align: center; background: white; transition: var(--transition); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
.path-card i { font-size: 2rem; margin-bottom: 10px; color: #94a3b8; display: block; }
.path-card span { font-weight: 700; color: var(--text-muted); }
.path-label input:checked + .path-card { border-color: var(--primary); background: var(--primary-light); }
.path-label input:checked + .path-card i, .path-label input:checked + .path-card span { color: var(--primary); }

/* Nav Buttons */
.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: var(--transition); }
.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(25, 92, 251, 0.3); transition: var(--transition); }
.btn-next:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* Results & AI */
.ai-card { background: linear-gradient(145deg, #ffffff, var(--primary-light)); border: 2px solid #c7d2fe; padding: 2rem; border-radius: var(--radius); margin-bottom: 2rem; text-align: center;}
.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: var(--transition); box-shadow: 0 10px 20px rgba(25, 92, 251, 0.2); }
.ai-btn-large:hover { background: var(--primary-hover); transform: translateY(-2px); }
.ai-result-content { background: white; padding: 2rem; border-radius: 16px; text-align: start; margin-top: 2rem; border: 1px solid #e2e8f0; display: none; line-height: 1.8; }

.fa-body .rtl-arrow { transform: rotate(180deg); }
.fa-body .btn-back i, .fa-body .btn-next i { margin-left: 0; margin-right: 8px; }


.hidden { display: none !important; }

@media (max-width: 768px) {
    .form-grid, .path-grid { grid-template-columns: 1fr; }
    .hc-card { padding: 1.5rem; }
    .step-label { display: none; }
}


.fa-body .fas, .fa-body .far, .fa-body .fab, .fa-body .fa-solid {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    direction: ltr !important;
    display: inline-block !important;
}


.ai-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.modern-ai-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.modern-ai-spinner div {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: ai-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.modern-ai-spinner div:nth-child(1) { animation-delay: -0.45s; }
.modern-ai-spinner div:nth-child(2) { animation-delay: -0.3s; border-top-color: var(--secondary); }
.modern-ai-spinner div:nth-child(3) { animation-delay: -0.15s; }

@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-pulse-text {
    font-weight: 800;
    color: var(--primary);
    animation: ai-pulse 1.5s ease-in-out infinite;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


.ai-result-content {
    border: none;
    background: white;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}


.timer-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timer-svg {
    transform: rotate(-90deg); 
}
.timer-circle-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 6;
}
.timer-circle-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear; 
}
.timer-text {
    position: absolute;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.result-score-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.result-score-svg {
    transform: rotate(-90deg);
}
.result-score-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 10;
}
.result-score-fill {
    fill: none;
    stroke: #10b981;
    stroke-width: 10;
    stroke-linecap: round;
}
.result-score-text {
    position: absolute;
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.result-score-text span {
    font-size: 2.8rem;
    margin-right: 2px;
}