:root {
  --green-900: #0b4a2f;
  --green-700: #12794a;
  --lime: #c5f06a;
  --paper: #f6faf7;
  --ink: #12261b;
  --muted: #4d6558;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
.page {
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.hero {
  background: linear-gradient(160deg, var(--green-700), var(--green-900));
  border-radius: 20px;
  padding: 28px 20px 16px;
}
.gauge { width: 100%; height: auto; display: block; }
.gauge path { fill: none; stroke-width: 16; stroke-linecap: round; }
.gauge .track { stroke: rgba(255, 255, 255, .22); }
.gauge .value {
  stroke: var(--lime);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.4s cubic-bezier(.2, .7, .2, 1);
}
.gauge .score { fill: #fff; font-size: 38px; font-weight: 800; }
.gauge .caption { fill: #cfeedd; font-size: 11px; }
.gauge .limit { fill: #a9d8bf; font-size: 9px; }

.slides { position: relative; flex: 1; min-height: 150px; }
.slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transform: translateX(-24px);
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}
.slide.active { opacity: 1; visibility: visible; transform: none; }
h1 { margin: 0 0 12px; font-size: 1.6rem; font-weight: 800; line-height: 1.5; color: var(--green-900); }
p { margin: 0; font-size: 1rem; line-height: 2; color: var(--muted); }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #c6d8cd; transition: all .3s; }
.dots i.on { width: 24px; border-radius: 4px; background: var(--green-700); }
.next {
  font: inherit; font-weight: 600; font-size: 1rem;
  background: var(--green-700); color: #fff;
  border: 0; border-radius: 12px; padding: 12px 40px; cursor: pointer;
}
.next:hover { background: var(--green-900); }
.next:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .gauge .value, .slide, .dots i { transition: none; }
}

/* ---------- صفحه ۲: فرم ثبت اطلاعات ---------- */
.form-card {
  border: 2px solid var(--green-700);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #fff;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; color: var(--green-900); }
.field input {
  font: inherit; font-size: 1rem; color: var(--ink);
  border: 1.5px solid #c6d8cd; border-radius: 12px;
  padding: 12px 14px; background: var(--paper);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(197, 240, 106, .6); }
.field input.invalid { border-color: #c0392b; }
.field .err { min-height: 1.2em; font-size: .8rem; color: #c0392b; }
.field input[inputmode="numeric"] { direction: ltr; text-align: right; }

.submit {
  font: inherit; font-weight: 600; font-size: 1rem;
  width: 100%; background: var(--green-700); color: #fff;
  border: 0; border-radius: 12px; padding: 14px; cursor: pointer;
}
.submit:hover { background: var(--green-900); }
.submit:focus-visible, .btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.dialog {
  border: 0; border-radius: 20px; padding: 0;
  width: min(92vw, 400px); color: var(--ink); background: #fff;
  position: fixed; inset: 0; margin: auto; height: fit-content;
}
.dialog::backdrop { background: rgba(11, 74, 47, .55); }
.dialog[open] { animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.dialog-body { padding: 24px 20px 16px; }
.dialog h2 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 800; color: var(--green-900); line-height: 1.7; }
.summary { margin: 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #e3ede7; }
.summary dt { color: var(--muted); font-size: .9rem; }
.summary dd { margin: 0; font-weight: 600; }
.summary dd.num { direction: ltr; }
.dialog-actions { display: flex; gap: 12px; padding: 0 20px 20px; }
.btn { flex: 1; font: inherit; font-weight: 600; font-size: 1rem; border-radius: 12px; padding: 12px; cursor: pointer; }
.btn.edit { background: #fff; color: var(--green-700); border: 1.5px solid var(--green-700); }
.btn.confirm { background: var(--green-700); color: #fff; border: 1.5px solid var(--green-700); }
.btn.confirm:hover { background: var(--green-900); }

@media (prefers-reduced-motion: reduce) { .dialog[open] { animation: none; } }


/* ---------- صفحه ۳: انتخاب بانک ---------- */
.select { position: relative; }
.select-btn {
  width: 100%; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font: inherit; font-size: 1rem; color: var(--ink); background: #fff; cursor: pointer;
  border: 2px solid var(--green-700); border-radius: 16px; padding: 10px 14px;
}
.select-btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.select-value { display: flex; align-items: center; gap: 12px; min-width: 0; }
.placeholder { color: var(--muted); }
.chev { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--green-700); stroke-width: 2.2; transition: transform .2s; }
.select-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.select-list {
  position: absolute; inset-inline: 0; top: calc(100% + 8px); z-index: 10;
  margin: 0; padding: 6px; list-style: none; max-height: min(340px, 55vh); overflow-y: auto;
  background: #fff; border: 2px solid var(--green-700); border-radius: 16px;
  box-shadow: 0 12px 28px rgba(11, 74, 47, .18);
}
.select-list[hidden] { display: none; }
.select-list li { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.select-list li:hover { background: #eaf6d2; }
.select-list li:focus { outline: none; background: #eaf6d2; box-shadow: inset 0 0 0 2px var(--green-700); }
.select-list li[aria-selected="true"] { background: #dff0c4; font-weight: 600; }
.logo { position: relative; width: 38px; height: 38px; flex: none; display: block; }
.logo .fb { position: absolute; inset: 0; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; border-radius: 10px; }
.logo img[hidden] { display: none; }
.cta { margin-top: auto; }
.cta .next { width: 100%; padding: 14px; animation: rise .3s ease; }
.cta .next[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chev, .cta .next { transition: none; animation: none; } }

/* ---------- بخش تکمیلی: ایمیل و کد پستی ---------- */
.extra { display: flex; flex-direction: column; gap: 16px; animation: rise .3s ease; }
.extra[hidden] { display: none; }
.extra-note { margin: 0; font-size: .95rem; line-height: 2; color: var(--green-900); background: #eaf6d2; border-radius: 12px; padding: 10px 14px; }
.form-missing-note { margin: 0; font-size: .9rem; line-height: 2; color: #c0392b; background: #fdecea; border: 1px solid #f3c6c2; border-radius: 12px; padding: 10px 14px; }
.form-missing-note a { color: #c0392b; font-weight: 600; }
.outline-field {
  position: relative; border: 1.5px solid var(--green-700); border-radius: 12px; padding: 16px 14px 14px;
}
.outline-field .hint {
  position: absolute; top: -10px; right: 14px; padding: 0 6px; background: var(--paper);
  font-size: .8rem; font-weight: 600; color: var(--green-700);
}
.outline-field input {
  width: 100%; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 1rem; color: var(--ink); padding: 2px 0;
}
.outline-field:focus-within { border-color: var(--green-900); box-shadow: 0 0 0 3px rgba(197, 240, 106, .5); }
.outline-field .err { display: block; min-height: 1.1em; font-size: .8rem; color: #c0392b; margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .extra { animation: none; } }

/* ---------- دیالوگ ادامه فرآیند ---------- */
.dialog-text { margin: 0 0 20px; font-size: .95rem; line-height: 2; color: var(--muted); }
.btn.cancel { background: #fff; color: #c0392b; border: 1.5px solid #c0392b; }
.btn.cancel:hover { background: #fdecea; }

/* ---------- لودینگ ---------- */
.loading-overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: rgba(246, 250, 247, .9);
}
.loading-overlay[hidden] { display: none; }
.spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid #d7e8dd; border-top-color: var(--green-700);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* ---------- صفحه ۴: نمودار رتبه اعتباری ---------- */
.scale-intro { color: var(--muted); font-size: .95rem; line-height: 2; }
.scale-wrap { margin-top: 8px; position: relative; }
.scale-bar {
  display: flex; border-radius: 14px; overflow: hidden; height: 56px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.grade {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: #fff; direction: ltr;
}
.grade.active { outline: 2px solid var(--green-900); outline-offset: -2px; }
/* گرادیان رنگ از سبز (A1، راست) تا قرمز (E3، چپ) */
.grade:nth-child(1)  { background: #0f8a4b; }
.grade:nth-child(2)  { background: #1f9a53; }
.grade:nth-child(3)  { background: #3fab5a; }
.grade:nth-child(4)  { background: #6cb94f; }
.grade:nth-child(5)  { background: #9cc43f; }
.grade:nth-child(6)  { background: #c7cf33; }
.grade:nth-child(7)  { background: #e9c62e; }
.grade:nth-child(8)  { background: #f0a92e; }
.grade:nth-child(9)  { background: #ef8f2e; }
.grade:nth-child(10) { background: #ea7638; }
.grade:nth-child(11) { background: #e35f3a; }
.grade:nth-child(12) { background: #dc4a3d; }
.grade:nth-child(13) { background: #cf3c3c; }
.grade:nth-child(14) { background: #bc2f36; }
.grade:nth-child(15) { background: #a3242f; }

.scale-pointer {
  position: absolute; top: 58px; height: 28px;
  width: 24px; transform: translateX(-50%);
  left: 0;
}
.scale-pointer svg { width: 24px; height: 28px; fill: var(--green-900); filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.scale-ends { display: flex; justify-content: space-between; margin-top: 36px; font-size: .8rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .scale-pointer { transition: none !important; }
}

/* ---------- صفحه ۵: لیست تیک‌دار توضیحات ---------- */
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.check-list li { display: flex; align-items: flex-start; gap: 12px; }
.check-icon {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-700); display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.check-icon svg { width: 15px; height: 15px; stroke: #fff; }
.check-list p { margin: 0; font-size: .98rem; line-height: 2; color: var(--ink); }

/* ---------- دکمه دانلود تصویر کارت ---------- */
.download-group { flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.download-group[hidden] { display: none; }
.download-note {
  margin: 0; text-align: right; font-size: .72rem; line-height: 1.8; color: var(--green-900);
  background: #f3ead9; border: 1px solid rgba(0,0,0,.18); border-radius: 10px;
  padding: 5px 12px; align-self: flex-end;
}
.next.download { display: flex; align-items: center; justify-content: center; text-decoration: none; width: 100%; }
