@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.app {
  min-height: 100vh;
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  background: #f8f9fa;
  color: #212529;
  position: relative;
  overflow-x: hidden;
  line-height: 1.7;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(130px);
  opacity: 0.22;
  z-index: 0;
}

.g1 { width: 700px; height: 700px; top: -220px; right: -160px; background: #1a56c4; }
.g2 { width: 600px; height: 600px; bottom: -160px; left: -120px; background: #ff5a5f; }
.g3 { width: 500px; height: 500px; top: 38%; left: 42%; background: #6d4bc4; transform: translate(-50%,-50%); }

.container {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-img { width: 160px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 10px #2563eb33); }

.logo-en {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, #1a56c4, #ff5a5f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.logo-fa { font-size: 0.88rem; color: #ff5a5f; font-weight: 800; }

.policy-badge {
  background: #f8f9fa;
  border: 1.5px solid rgba(26, 86, 196, 0.2);
  color: #1a56c4;
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 10px rgba(26, 86, 196, 0.05);
}

.hero { text-align: center; margin-bottom: 36px; animation: fade-up 500ms ease; }
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 900;
  background: linear-gradient(135deg, #1a56c4 0%, #6d4bc4 50%, #ff5a5f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero p { color: #4a5a80; font-size: 1rem; font-weight: 400; line-height: 1.8; max-width: 520px; margin: 0 auto; }

.stepper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-item { display: flex; flex-direction: column; align-items: center; position: relative; flex: 1; min-width: 0; }
.step-dot {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid #c8d8f8; background: #ffffff;
  color: #8099c8; display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
  font-weight: 700; position: relative; z-index: 1; transition: all 250ms ease; box-shadow: 0 2px 8px #2563eb0f;
}

.step-item.done .step-dot { background: #eef4ff; border-color: #2563eb; color: #1a56c4; }
.step-item.active .step-dot { background: linear-gradient(135deg, #1a56c4, #6d4bc4); border-color: #1a56c4; color: #fff; box-shadow: 0 4px 18px #2563eb44; }

.step-label { font-size: 0.7rem; color: #8099c8; margin-top: 6px; text-align: center; white-space: nowrap; font-weight: 500; transition: color 250ms; }
.step-item.active .step-label { color: #1a56c4; font-weight: 700; }
.step-item.done .step-label { color: #2563eb; }

.step-line { position: absolute; top: 19px; left: 0; right: -100%; height: 2px; background: #d0ddf8; z-index: 0; }
.step-item.done .step-line { background: linear-gradient(90deg, #2563eb, #c8d8f8); }

.card {
  background: rgba(255, 255, 255, 0.93);
  border: 1.5px solid #d8e4f8; border-radius: 24px; padding: 34px 30px;
  box-shadow: 0 8px 48px -8px #2563eb18, 0 2px 8px #0000000a, inset 0 1px 0 #ffffff;
  backdrop-filter: blur(14px);
}

.card-step-title {
  font-size: 0.78rem; font-weight: 700; background: linear-gradient(90deg, #1a56c4, #6d4bc4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1.5px solid #e8eef8;
}

.fields { display: flex; flex-direction: column; gap: 28px; }

.yn-label { font-size: 1rem; font-weight: 700; color: #0f1b3d; margin-bottom: 8px; line-height: 1.5; }
.yn-hint { font-size: 0.83rem; color: #4a5a80; margin-bottom: 12px; line-height: 1.65; padding: 11px 15px; background: linear-gradient(135deg, #eef4ff, #f0eeff); border-radius: 10px; border-right: 3px solid #2563eb44; }
.warning-box { background: #fffbeb; border: 1.5px solid #fcd34d; color: #92400e; padding: 12px 16px; border-radius: 12px; font-size: 0.85rem; line-height: 1.6; border-right: 4px solid #f59e0b; }
.mt-2 { margin-top: 0.5rem; }
.yn-row { display: flex; gap: 10px; }

.choice-btn {
  flex: 1; padding: 12px 18px; border-radius: 12px; border: 1.5px solid #d0ddf8; background: #ffffff;
  color: #4a5a80; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: all 200ms ease;
  display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 1px 4px #2563eb08;
}
.choice-btn:hover:not(.active) { border-color: #2563eb88; color: #1a56c4; background: #f4f8ff; box-shadow: 0 2px 10px #2563eb12; }
.choice-btn.active { border-color: #1a56c4; background: linear-gradient(135deg, #f4f8ff, #f0f4ff); color: #1a56c4; font-weight: 700; box-shadow: 0 2px 14px rgba(26, 86, 196, 0.15), inset 0 1px 0 #ffffff; }
.check-icon { font-size: 0.82rem; font-weight: 900; color: #1a56c4; }

.select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.select-grid .choice-btn { flex: unset; }
.field-label { font-size: 0.95rem; font-weight: 700; color: #0f1b3d; margin-bottom: 12px; }

.nav-row { display: flex; justify-content: flex-start; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.btn-next {
  padding: 14px 36px; border-radius: 14px; border: none; background: linear-gradient(135deg, #1a56c4, #ff5a5f);
  background-size: 200% 100%; background-position: right; color: #ffffff; font-size: 1rem; font-weight: 800;
  cursor: pointer; transition: all 250ms ease; letter-spacing: 0.02em; box-shadow: 0 4px 18px rgba(26, 86, 196, 0.2); text-shadow: 0 1px 2px #0000001a;
  font-family: 'IRANYekanX' !important;
}
.btn-next:hover:not(.disabled) { transform: translateY(-2px); box-shadow: 0 10px 30px #2563eb55; background-position: left; }
.btn-next.disabled { background: #e8eef8; color: #a0b0d0; cursor: not-allowed; box-shadow: none; text-shadow: none; }
.btn-back {
  padding: 14px 24px; border-radius: 14px; border: 1.5px solid #d0ddf8; background: #ffffff; color: #4a5a80;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: all 200ms ease; box-shadow: 0 1px 4px #0000000a;
}
.btn-back:hover { border-color: #2563eb66; color: #1a56c4; background: #f4f8ff; }

.result-card { border-radius: 24px; padding: 38px 30px 28px; box-shadow: 0 8px 48px -8px #0000001a; backdrop-filter: blur(14px); }
.result-card.eligible { background: rgba(255, 255, 255, 0.96); border: 1.5px solid #86efac; }
.result-card.ineligible { background: rgba(255, 255, 255, 0.96); border: 1.5px solid #fca5a5; }
.result-icon { font-size: 3rem; text-align: center; margin-bottom: 14px; }
.result-badge { display: flex; width: fit-content; margin: 0 auto 24px; align-items: center; padding: 12px 36px; border-radius: 999px; font-size: 1.3rem; font-weight: 900; letter-spacing: 0.03em; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.result-badge.el { background: linear-gradient(135deg, #f0fdf4, #dcfce7); color: #15803d; border: 1.5px solid #86efac; box-shadow: 0 2px 12px #22c55e22; }
.result-badge.in { background: linear-gradient(135deg, #fff1f2, #fce7e7); color: #b91c1c; border: 1.5px solid #fca5a5; box-shadow: 0 2px 12px #ef444422; }
.result-summary { text-align: center; font-size: 1.4rem; line-height: 1.9; color: #0f1b3d; font-weight: 600; margin-bottom: 36px; padding: 32px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(240, 244, 255, 0.8)); border-radius: 20px; border: 2px solid #e8eef8; box-shadow: 0 4px 20px rgba(26, 86, 196, 0.05); }

.rules-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.rule-item { border-radius: 14px; border: 1.5px solid #e0e8f8; overflow: hidden; background: #fafbff; transition: border-color 200ms, box-shadow 200ms; }
.rule-item:hover { box-shadow: 0 2px 14px #2563eb0f; }
.rule-item.pass { border-right: 4px solid #22c55e; }
.rule-item.fail { border-right: 4px solid #ef4444; }
.rule-item.info { border-right: 4px solid #6d4bc4; }
.rule-item summary { list-style: none; padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px; user-select: none; }
.rule-item summary::-webkit-details-marker { display: none; }
.rule-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 800; flex-shrink: 0; }
.rule-item.pass .rule-icon { background: #dcfce7; color: #15803d; }
.rule-item.fail .rule-icon { background: #fee2e2; color: #b91c1c; }
.rule-item.info .rule-icon { background: #f0eeff; color: #6d4bc4; }
.rule-title { flex: 1; font-size: 0.95rem; font-weight: 600; color: #0f1b3d; }
.rule-status { font-size: 0.78rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.rule-status.p { background: #dcfce7; color: #15803d; }
.rule-status.f { background: #fee2e2; color: #b91c1c; }
.rule-item.info .rule-status { background: #f0eeff; color: #6d4bc4; }

.rule-body { padding: 6px 16px 16px; display: flex; flex-direction: column; gap: 10px; border-top: 1.5px solid #e8eef8; background: #f8faff; }
.rule-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; font-size: 0.87rem; line-height: 1.65; color: #2a3a60; }
.rule-key { background: linear-gradient(135deg, #1a56c4, #6d4bc4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; font-size: 0.8rem; padding-top: 2px; }
.source-row { color: #7080a8; }

.disclaimer { background: linear-gradient(135deg, #fffbeb, #fef9ec); border: 1.5px solid #fcd34d55; border-radius: 12px; padding: 14px 16px; font-size: 0.83rem; color: #78650a; line-height: 1.65; margin-bottom: 20px; }
.official-links { margin-bottom: 28px; }
.ol-title { font-size: 0.78rem; font-weight: 700; color: #8099c8; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.official-links a { display: block; color: #1a56c4; text-decoration: none; font-size: 0.85rem; margin-bottom: 6px; transition: color 200ms; }
.official-links a:hover { color: #6d4bc4; text-decoration: underline; }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-restart { padding: 14px 28px; border-radius: 14px; border: none; background: linear-gradient(135deg, #1a56c4, #6d4bc4); color: #ffffff; font-size: 0.95rem; font-weight: 800; cursor: pointer; transition: all 200ms ease; box-shadow: 0 4px 16px #2563eb44; text-shadow: 0 1px 2px #0000001a; font-family: 'IRANYekanX';}
.btn-restart:hover { transform: translateY(-2px); box-shadow: 0 10px 26px #2563eb55; }

.site-footer { margin-top: 64px; padding-top: 32px; border-top: 1px solid #dee2e6; }
.footer-links-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.f-btn { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 12px; font-size: 0.9rem; font-weight: 700; text-decoration: none; transition: all 200ms ease; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.f-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.12); }
.f-btn-dark { background: #343a40; color: #fff; }
.f-btn-red { background: #ff5a5f; color: #fff; }
.f-btn-white { background: #fff; color: #343a40; border: 1px solid #dee2e6; }
.f-btn-icon { font-size: 1.1rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: #6c757d; flex-wrap: wrap; gap: 12px; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; }
.footer-logo-img { width: 40px; height: 40px; object-fit: contain; }

.optional-tag { display: inline-block; font-size: 0.7rem; font-weight: 600; color: #6d4bc4; background: linear-gradient(135deg, #f0eeff, #e8e0ff); border: 1px solid #c4b8f0; border-radius: 999px; padding: 1px 8px; margin-right: 6px; vertical-align: middle; }

.dp-with-unknown { display: flex; align-items: flex-start; gap: 10px; }
.dp-with-unknown .dp-wrap { flex: 1; }
.unknown-btn { flex-shrink: 0; padding: 13px 16px; border-radius: 12px; border: 1.5px dashed #c4b8f0; background: #f8f6ff; color: #6d4bc4; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 180ms; white-space: nowrap; }
.unknown-btn:hover { background: #ede8ff; border-color: #6d4bc4; }
.unknown-clear-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1.5px solid #c4b8f0; background: linear-gradient(135deg, #f0eeff, #ede8ff); color: #6d4bc4; font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 180ms; }
.unknown-clear-btn:hover { background: linear-gradient(135deg, #ede8ff, #e0d8ff); border-color: #6d4bc4; }

.dp-wrap { position: relative; }
.dp-label { font-size: 0.95rem; font-weight: 700; color: #0f1b3d; margin-bottom: 8px; }
.dp-trigger { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: #ffffff; border: 1.5px solid #d0ddf8; border-radius: 12px; color: #2a3a60; font-size: 0.95rem; cursor: pointer; transition: border-color 200ms, box-shadow 200ms; text-align: right; box-shadow: 0 1px 4px #2563eb08; }
.dp-trigger:hover, .dp-trigger:focus { border-color: #2563eb88; box-shadow: 0 2px 12px #2563eb18; outline: none; }
.dp-icon { font-size: 1rem; }
.dp-trigger > span:nth-child(2) { flex: 1; text-align: right; }
.dp-chevron { color: #8099c8; font-size: 0.75rem; }

.dp-popup { position: absolute; top: calc(100% + 8px); right: 0; left: 0; z-index: 200; background: #ffffff; border: 1.5px solid #d0ddf8; border-radius: 18px; padding: 18px; box-shadow: 0 16px 48px -8px #2563eb22, 0 4px 16px #0000000c; }
.dp-mode-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.dp-mode-tabs button { flex: 1; padding: 9px; border-radius: 10px; border: 1.5px solid #d0ddf8; background: #f4f8ff; color: #4a5a80; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 180ms; }
.dp-mode-tabs button.active { border-color: #2563eb; background: linear-gradient(135deg, #eef4ff, #ede8ff); color: #1a56c4; box-shadow: 0 2px 10px #2563eb20; }
.dp-month-year { display: flex; align-items: center; gap: 8px; }
.dp-year-select { border: 1.5px solid #d0ddf8; border-radius: 8px; padding: 2px 6px; font-size: 0.9rem; font-weight: 600; color: #1a56c4; background: #f4f8ff; cursor: pointer; outline: none; transition: border-color 150ms; }
.dp-year-select:hover, .dp-year-select:focus { border-color: #2563eb; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dp-month-title { font-size: 0.95rem; font-weight: 700; color: #0f1b3d; }
.dp-arrow { width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid #d0ddf8; background: #ffffff; color: #4a5a80; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 150ms; box-shadow: 0 1px 4px #2563eb08; }
.dp-arrow:hover { border-color: #2563eb66; color: #1a56c4; background: #f0f4ff; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 12px; }
.dp-wh { text-align: center; font-size: 0.72rem; font-weight: 700; color: #8099c8; padding: 4px 0; }
.dp-day { aspect-ratio: 1; border-radius: 8px; border: none; background: transparent; color: #2a3a60; font-size: 0.82rem; cursor: pointer; transition: all 150ms; display: flex; align-items: center; justify-content: center; min-height: 32px; }
.dp-day:hover:not(.selected):not(.disabled) { background: #eef4ff; color: #1a56c4; }
.dp-day.selected { background: linear-gradient(135deg, #1a56c4, #6d4bc4); color: #ffffff; font-weight: 800; box-shadow: 0 2px 10px #2563eb44; }
.dp-day.disabled { color: #c8d4f0; cursor: not-allowed; }
.dp-both-dates { display: flex; justify-content: space-between; padding: 9px 12px; background: linear-gradient(135deg, #eef4ff, #f0eeff); border-radius: 10px; font-size: 0.78rem; color: #6070a0; border: 1.5px solid #d0ddf8; }

/* کلاس‌های مخصوص جاوااسکریپت و انیمیشن */
.d-none { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-15px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 600px) {
  .container { padding: 20px 14px 48px; }
  .card { padding: 22px 16px; }
  .result-card { padding: 26px 16px 20px; }
  .stepper { gap: 0; }
  .step-label { display: none; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .select-grid { grid-template-columns: 1fr 1fr; }
  .rule-row { grid-template-columns: 1fr; }
  .dp-popup { position: fixed; inset: auto 10px 10px; border-radius: 20px 20px 16px 16px; }
  .nav-row { flex-direction: column-reverse; }
  .btn-next, .btn-back { width: 100%; text-align: center; justify-content: center; font-family: 'IRANYekanX' !important;}
}

#btn-next {
    font-family: 'IRANYekanX' !important;
}

#btn-back {
    font-family: 'IRANYekanX' !important;
}