/* ============================================================
   سامانه هوشمند انتخاب مهارت و هدایت شغلی - فن‌آموزان
   رنگ‌های اصلی را از همین متغیرها تغییر دهید.
   ============================================================ */
:root {
    --brand: #1857c4;
    --brand-dark: #10399a;
    --brand-soft: #eaf0ff;
    --accent: #f59f00;
    --success: #16a34a;
    --danger: #dc2626;
    --ink: #16202e;
    --muted: #64748b;
    --line: #e3e8ef;
    --bg: #f5f7fb;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(16, 33, 66, .08);
    --font: Vazirmatn, "IRANSans", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.9;
}

body { direction: rtl; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 620px; }
.container-lg { max-width: 1180px; }

/* ---------------------------------------------------------- هیرو */
.hero {
    background: linear-gradient(135deg, #10399a 0%, #1857c4 55%, #2f8de0 100%);
    color: #fff;
    padding: 70px 0 92px;
    position: relative;
    overflow: hidden;
}
.hero h1 { font-size: 30px; margin: 0 0 14px; line-height: 1.6; position: relative; z-index: 2; }
.hero p { font-size: 16px; opacity: .95; margin: 0 auto; max-width: 640px; position: relative; z-index: 2; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; position: relative; z-index: 2; }
.hero-badges span {
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25);
    padding: 7px 14px; border-radius: 999px; font-size: 13px;
}

/* ---------------------------------------------------------- کارت */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
}
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 6px; font-size: 20px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.pull-up { margin-top: -48px; position: relative; z-index: 5; }

/* ---------------------------------------------------------- فرم */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
    border-radius: 12px; font-family: var(--font); font-size: 15px;
    background: #fbfcfe; transition: .18s; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand); background: #fff;
    box-shadow: 0 0 0 4px rgba(24, 87, 196, .1);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field.ltr input { direction: ltr; text-align: left; letter-spacing: 2px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--brand); color: #fff; border: none; border-radius: 12px;
    padding: 13px 26px; font-family: var(--font); font-size: 15px; font-weight: 700;
    cursor: pointer; transition: .18s; width: auto;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-accent { background: var(--accent); color: #23282f; }
.btn-accent:hover { background: #e08e00; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }

.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #c7d7fb; }

/* ---------------------------------------------------------- پرسشنامه */
.progress-wrap { margin-bottom: 22px; }
.progress-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2f8de0); width: 0; transition: width .3s; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; }

.section-tag {
    display: inline-block; background: var(--brand-soft); color: var(--brand-dark);
    padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; margin-bottom: 14px;
}
.question-title { font-size: 19px; font-weight: 800; line-height: 1.8; margin: 0 0 20px; }

.options { display: grid; gap: 11px; }
.option {
    display: flex; gap: 13px; align-items: flex-start; padding: 15px 17px;
    border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
    background: #fbfcfe; transition: .16s;
}
.option:hover { border-color: #b9c9ee; background: #fff; }
.option.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(24, 87, 196, .09); }
.option input { display: none; }
.option .key {
    flex: 0 0 30px; height: 30px; border-radius: 9px; background: #fff;
    border: 1.5px solid var(--line); display: grid; place-items: center;
    font-weight: 800; font-size: 13px; color: var(--muted); transition: .16s;
}
.option.selected .key { background: var(--brand); border-color: var(--brand); color: #fff; }
.option .body strong { display: block; font-size: 15px; margin-bottom: 2px; }
.option .body span { color: var(--muted); font-size: 13.5px; }

.quiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }

/* ---------------------------------------------------------- نتیجه */
.result-hero {
    background: linear-gradient(135deg, #10399a, #2f8de0);
    color: #fff; border-radius: var(--radius); padding: 30px; margin-bottom: 20px;
}
.result-hero h1 { margin: 0 0 8px; font-size: 25px; }
.result-hero p { margin: 0; opacity: .93; }
.profile-chip {
    display: inline-block; background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .3); padding: 8px 18px;
    border-radius: 999px; font-weight: 800; margin-top: 14px; font-size: 15px;
}

.axes { display: grid; gap: 14px; }
.axis-row { display: grid; grid-template-columns: 130px 1fr 46px; align-items: center; gap: 12px; font-size: 14px; }
.axis-bar { height: 11px; background: var(--line); border-radius: 999px; overflow: hidden; }
.axis-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #2f8de0); }
.axis-row b { text-align: left; color: var(--brand-dark); font-variant-numeric: tabular-nums; }

.analysis-text { white-space: pre-line; font-size: 15px; line-height: 2.1; }

.course-list { display: grid; gap: 14px; }
.course-item {
    display: flex; gap: 16px; align-items: center; justify-content: space-between;
    border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fbfcfe;
    transition: .16s;
}
.course-item:hover { border-color: #b9c9ee; background: #fff; }
.course-item .rank {
    flex: 0 0 34px; height: 34px; border-radius: 10px; background: var(--brand-soft);
    color: var(--brand-dark); display: grid; place-items: center; font-weight: 800;
}
.course-item .info { flex: 1; min-width: 0; }
.course-item .info strong { display: block; font-size: 16px; margin-bottom: 3px; }
.course-item .info .tags { font-size: 12.5px; color: var(--muted); }
.course-item .match { text-align: center; flex: 0 0 auto; }
.course-item .match b { display: block; font-size: 18px; color: var(--success); }
.course-item .match span { font-size: 11px; color: var(--muted); }

.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
    background: #f1f5f9; color: #475569; border-radius: 999px;
    padding: 5px 12px; font-size: 12.5px;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-green { background: #ecfdf5; color: #047857; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.summary-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfcfe; }
.summary-item span { display: block; font-size: 12px; color: var(--muted); }
.summary-item strong { font-size: 14px; }

.cta-box {
    background: linear-gradient(135deg, #fff7e6, #fffdf7);
    border: 1.5px solid #ffe0a3; border-radius: var(--radius);
    padding: 24px; text-align: center;
}
.cta-box h3 { margin: 0 0 8px; }
.cta-box p { color: var(--muted); margin: 0 0 16px; }

/* ---------------------------------------------------------- پنل مدیریت */
.admin-body { background: var(--bg); }
.admin-nav {
    background: var(--ink); color: #fff; padding: 0 16px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.admin-nav a { color: #cbd5e1; padding: 15px 14px; font-size: 14px; border-bottom: 3px solid transparent; }
.admin-nav a:hover { color: #fff; text-decoration: none; }
.admin-nav a.active { color: #fff; border-color: var(--accent); }
.admin-nav .spacer { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat b { display: block; font-size: 26px; color: var(--brand); }
.stat span { font-size: 13px; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; font-size: 14px; }
table.data th, table.data td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.data th { background: #f8fafc; font-size: 13px; color: var(--muted); font-weight: 700; }
table.data tr:hover td { background: #fafbfe; }
table.data td.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: left; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pagination a, .pagination span {
    padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px;
    background: #fff; font-size: 13px;
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; }

.tag-status { padding: 4px 11px; border-radius: 999px; font-size: 12px; display: inline-block; }
.status-new { background: var(--brand-soft); color: var(--brand-dark); }
.status-called { background: #fef9c3; color: #854d0e; }
.status-enrolled { background: #dcfce7; color: #166534; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* ---------------------------------------------------------- فوتر */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px 40px; }

.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hidden { display: none !important; }

@media (max-width: 640px) {
    .hero { padding: 42px 0 70px; }
    .hero h1 { font-size: 23px; }
    .card { padding: 20px 17px; }
    .axis-row { grid-template-columns: 96px 1fr 40px; font-size: 13px; }
    .course-item { flex-wrap: wrap; gap: 10px; }
    .course-item .info { flex: 1 1 calc(100% - 100px); }
    .course-item .match { order: 3; }
    .course-item .btn { order: 4; margin-right: auto; }
    .quiz-nav .btn { flex: 1; }
}

@media print {
    .quiz-nav, .cta-box, .no-print { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; }
}

/* ------------------------------------------------- نشانگر تولید تحلیل هوشمند */
.ai-loading { display: inline-flex; align-items: center; gap: 8px; color: var(--brand-dark); font-weight: 700; }
.ai-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--brand); display: inline-block;
    animation: ai-pulse 1.1s ease-in-out infinite;
}
@keyframes ai-pulse {
    0%, 100% { opacity: .25; transform: scale(.8); }
    50%      { opacity: 1;   transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
    .ai-dot { animation: none; opacity: .8; }
}
