* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --primary: #6846e8;
    --primary-dark: #4930b8;
    --secondary: #e84c9b;
    --dark: #17142b;
    --text: #302c40;
    --muted: #817b90;
    --bg: #f6f7fb;
    --white: #fff;
    --border: #e9e7f1;
    --shadow: 0 10px 30px rgba(35, 24, 82, .07);
    --green: #18a66a;
    --orange: #ed8b28;
    --blue: #3788e9;
}

body {
    font-family: Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* ===== CONTAINER ===== */
.container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 25px 8px 70px !important;
    overflow-x: hidden !important;
}

/* ===== HEADER ===== */
header {
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
}

.nav {
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.logo-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 7px 18px rgba(104, 70, 232, .25);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-links a {
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
}

.nav-links a:hover {
    background: #f1edff;
    color: var(--primary);
}

.login-btn {
    border: 0;
    padding: 8px 14px !important;
    border-radius: 10px;
    color: white;
    font-size: 12px !important;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px !important;
}

.user-badge {
    background: #f0edff;
    color: #4930b8;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== FOOTER ===== */
footer {
    margin-top: 35px;
    padding: 27px 5%;
    text-align: center;
    background: white;
    border-top: 1px solid var(--border);
}

footer strong {
    color: var(--dark);
    font-size: 13px;
}

footer p {
    color: var(--muted);
    font-size: 9px;
    margin-top: 6px;
}

/* ===== HERO ===== */
.hero {
    margin: 25px 0;
    min-height: 300px;
    border-radius: 24px;
    padding: 35px 30px;
    position: relative;
    overflow: hidden;
    color: white;
    background: radial-gradient(circle at 82% 25%, rgba(255, 255, 255, .16), transparent 24%),
                radial-gradient(circle at 10% 100%, rgba(236, 72, 153, .2), transparent 28%),
                linear-gradient(120deg, #261a58, #5d3dd5 55%, #a93883);
    box-shadow: 0 22px 55px rgba(65, 42, 145, .18);
}

.hero-content {
    max-width: 720px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 10px;
    background: rgba(255, 255, 255, .11);
    border: 1px solid rgba(255, 255, 255, .14);
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(26px, 3.5vw, 38px);
    line-height: 1.5;
    margin-bottom: 8px;
}

.hero p {
    max-width: 650px;
    font-size: 13px;
    line-height: 2;
    color: rgba(255, 255, 255, .78);
}

.hero-actions {
    display: flex;
    gap: 9px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.hero-btn {
    border: 0;
    padding: 10px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

.hero-btn.white {
    color: var(--primary);
    background: white;
}

.hero-decoration {
    position: absolute;
    width: 220px;
    height: 220px;
    left: -50px;
    bottom: -80px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .09);
}

.hero-decoration:after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    left: 35px;
    top: 35px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .08);
}

/* ===== QUICK BAR ===== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.quick {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 14px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.quick-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 17px;
    background: #f1edff;
}

.quick strong {
    display: block;
    color: var(--dark);
    font-size: 13px;
    margin-bottom: 2px;
}

.quick span {
    color: var(--muted);
    font-size: 10px;
}

/* ===== SECTION ===== */
.section {
    margin: 30px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .bar {
    width: 4px;
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(var(--primary), var(--secondary));
}

.section-title h2 {
    color: var(--dark);
    font-size: 18px;
}

.section-head p {
    color: var(--muted);
    font-size: 10px;
    margin-top: 4px;
}

/* ===== DASHBOARD ===== */
.dashboard {
    display: grid;
    grid-template-columns: 1.4fr .6fr;
    gap: 12px;
}

.performance {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 18px !important;
    box-shadow: var(--shadow);
}

.performance-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.performance h3 {
    color: var(--dark);
    font-size: 14px;
}

.performance small {
    color: var(--muted);
    font-size: 9px;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.performance-item {
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    background: #faf9fd;
}

.performance-item strong {
    display: block;
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 2px;
}

.performance-item span {
    color: var(--muted);
    font-size: 9px;
}

.mini-message {
    background: linear-gradient(145deg, #211a39, #42266d);
    border-radius: 16px;
    padding: 16px 18px !important;
    color: white;
    box-shadow: var(--shadow);
}

.mini-message h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.mini-message p {
    font-size: 10px;
    line-height: 1.9;
    color: #d4cde0;
}

.mini-message button {
    width: 100%;
    border: 0;
    margin-top: 10px;
    padding: 8px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    color: #442b83;
    background: white;
    cursor: pointer;
}

/* ===== EXAM CARDS ===== */
.exam-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.exam-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 16px !important;
    box-shadow: var(--shadow);
    transition: .2s;
}

.exam-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(35, 24, 82, .12);
}

.exam-card.featured {
    color: white;
    border: 0;
    background: linear-gradient(145deg, #281a4a, #5b348b);
}

.exam-tag {
    font-size: 9px;
    font-weight: bold;
    color: var(--primary);
}

.featured .exam-tag {
    color: #d9caff;
}

.exam-card h3 {
    color: var(--dark);
    font-size: 16px;
    margin: 8px 0 5px;
}

.featured h3 {
    color: white;
}

.exam-card p {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.8;
    min-height: 30px;
}

.featured p {
    color: #d7d0e2;
}

.exam-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 10px 0 12px;
}

.exam-meta span {
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 9px;
    color: #655f72;
    background: #f5f2fb;
}

.featured .exam-meta span {
    color: #eee;
    background: rgba(255, 255, 255, .09);
}

.exam-meta .price-tag {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    font-weight: 600;
}

.exam-button {
    width: 100%;
    border: 0;
    padding: 8px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;
}

.featured .exam-button {
    color: #4b2b80;
    background: white;
}

/* ===== TOOLS ===== */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 100%;
    gap: 12px;
}

.tool {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px !important;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: .2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tool:hover {
    transform: translateY(-3px);
}

.tool-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f0ecff;
    font-size: 20px;
}

.tool-content h3 {
    color: var(--dark);
    font-size: 13px;
    margin-bottom: 2px;
}

.tool-content p {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.8;
}

/* ===== RESOURCES ===== */
.resource-home {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 12px;
}

.resource-box {
    min-height: 120px;
    border-radius: 16px;
    padding: 18px;
    color: white;
    cursor: pointer;
}

.resource-box h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.resource-box p {
    max-width: 500px;
    font-size: 10px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .78);
}

.resource-main {
    background: linear-gradient(135deg, #4930b8, #7b55e9);
}

.resource-old {
    background: linear-gradient(135deg, #17416a, #2a7ab1);
}

/* ===== COUNTDOWN ===== */
.countdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 20px;
    border-radius: 16px;
    color: white;
    background: linear-gradient(120deg, #211a35, #422762);
    box-shadow: var(--shadow);
}

.countdown h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.countdown p {
    color: #cfc8dc;
    font-size: 10px;
}

.days-box {
    min-width: 90px;
    padding: 8px 14px;
    border-radius: 10px;
    text-align: center;
    background: rgba(255, 255, 255, .09);
}

.days-box strong {
    display: block;
    font-size: 22px;
}

.days-box span {
    color: #cfc8dc;
    font-size: 9px;
}

/* =============================================
   استایل حرفه‌ای صفحات آزمون
   ============================================= */
.inner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.inner-card {
    background: #ffffff;
    border: 1px solid #e9e7f1;
    border-radius: 16px;
    padding: 20px 18px !important;
    box-shadow: 0 4px 12px rgba(35, 24, 82, 0.04);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.inner-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(104, 70, 232, 0.10);
    border-color: #6846e8;
}

.inner-card h3 {
    font-size: 15px !important;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px !important;
}

.inner-card p {
    font-size: 12px !important;
    line-height: 1.8 !important;
    color: #5a5a77 !important;
    margin-bottom: 10px !important;
    min-height: 0 !important;
}

.inner-card .exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 14px !important;
}

.inner-card .exam-meta span {
    background: #f5f2fb;
    color: #655f72;
    font-size: 10px !important;
    padding: 4px 12px !important;
    border-radius: 20px;
}

.inner-card .exam-meta .price-tag {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    font-weight: 600;
}

.inner-card .exam-button {
    width: 100%;
    background: linear-gradient(135deg, #6846e8, #4930b8);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px !important;
    font-size: 12px !important;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}

.inner-card .exam-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(104, 70, 232, 0.30);
}

.subject-header {
    background: #f8f7fc;
    border: 1px solid #e9e7f1;
    border-radius: 14px;
    padding: 18px 22px !important;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.subject-header h2 {
    font-size: 17px !important;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 2px;
}

.subject-header p {
    font-size: 12px !important;
    color: #817b90;
}

.subject-badge {
    background: #f0ecff;
    color: #6846e8;
    font-size: 12px !important;
    font-weight: 700;
    padding: 6px 16px !important;
    border-radius: 30px;
    white-space: nowrap;
}

.page-title {
    margin-bottom: 22px;
}

.page-title h1 {
    font-size: 24px !important;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.page-title p {
    font-size: 13px !important;
    color: #817b90;
}

/* =============================================
   تراز تقریبی
   ============================================= */
.calculator {
    max-width: 700px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e9e7f1;
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(35, 24, 82, 0.06);
    overflow: hidden;
}

.calc-header {
    background: linear-gradient(135deg, #6846e8, #4930b8);
    padding: 28px 30px 22px;
    color: #fff;
}

.calc-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.calc-header p {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.8;
    margin: 0;
}

.calc-body {
    padding: 28px 30px 30px;
}

.calc-body .inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 22px;
}

.calc-body .field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}

.calc-body .field input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9e7f1;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: 0.3s;
    background: #faf9fd;
    font-family: inherit;
}

.calc-body .field input:focus {
    border-color: #6846e8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(104, 70, 232, 0.06);
}

.calc-body .field .hint {
    display: block;
    font-size: 11px;
    color: #817b90;
    margin-top: 4px;
}

.calc-body .calculate {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #6846e8, #4930b8);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
}

.calc-body .calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(104, 70, 232, 0.30);
}

.calc-body .result {
    display: none;
    margin-top: 22px;
    padding: 22px;
    background: #f4f0ff;
    border-radius: 14px;
    text-align: center;
    border: 2px dashed #6846e8;
}

.calc-body .result .result-label {
    display: block;
    font-size: 14px;
    color: #4930b8;
    font-weight: 600;
    margin-bottom: 4px;
}

.calc-body .result strong {
    display: block;
    font-size: 38px;
    color: #6846e8;
    margin: 6px 0;
}

.calc-body .result .result-hint {
    display: block;
    font-size: 12px;
    color: #817b90;
}

/* =============================================
   کارت‌های انتخاب رشته
   ============================================= */
.field-selector-group {
    margin-bottom: 22px;
}

.field-selector-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.field-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.field-card {
    background: #faf9fd;
    border: 2px solid #e9e7f1;
    border-radius: 12px;
    padding: 14px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.field-card:hover {
    border-color: #6846e8;
    background: #f0ecff;
    transform: translateY(-2px);
}

.field-card.active {
    border-color: #6846e8;
    background: #f0ecff;
    box-shadow: 0 0 0 3px rgba(104, 70, 232, 0.15);
}

.field-card .field-icon {
    display: block;
    font-size: 28px;
    margin-bottom: 4px;
}

.field-card .field-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
}

.field-card .field-check {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #6846e8;
    color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.field-card.active .field-check {
    display: flex;
}

/* =============================================
   ریسپانسیو
   ============================================= */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
    .quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard {
        grid-template-columns: 1fr;
    }
    .exam-layout {
        grid-template-columns: 1fr;
    }
    .resource-home {
        grid-template-columns: 1fr;
    }
    .inner-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 25px 20px;
    }
    .hero h1 {
        font-size: 24px;
    }
    .quick-grid {
        grid-template-columns: 1fr;
    }
    .performance-grid {
        grid-template-columns: 1fr;
    }
    .countdown {
        flex-direction: column;
        align-items: stretch;
    }
    .days-box {
        width: 100%;
    }
    .inner-grid {
        grid-template-columns: 1fr;
    }
    .subject-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
    }
    .calc-body .inputs {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .calc-header {
        padding: 22px 20px;
    }
    .calc-header h3 {
        font-size: 18px;
    }
    .calc-body {
        padding: 20px 18px 24px;
    }
    .calc-body .result strong {
        font-size: 30px;
    }
    .field-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .field-cards {
        grid-template-columns: 1fr;
    }
}