/* صندوق وام خانگی — full design system from Sandogh mockups */
:root {
  --sg-blue: #2b63e1;
  --sg-blue-dark: #1f4fc0;
  --sg-blue-soft: #eef3ff;
  --sg-green: #10b981;
  --sg-green-soft: #ecfdf5;
  --sg-orange: #f59e0b;
  --sg-bg: #f5f7fb;
  --sg-card: #ffffff;
  --sg-border: #e8edf5;
  --sg-text: #0f172a;
  --sg-muted: #64748b;
  --sg-radius: 18px;
}

.sg-page {
  background: var(--sg-bg);
  min-height: 60vh;
  padding: 1.1rem 0 5.5rem;
  color: var(--sg-text);
}

.sg-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

.sg-wrap--wide { max-width: 980px; }

.sg-head { margin-bottom: 1rem; }
.sg-head h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 .35rem;
  letter-spacing: -.02em;
}
.sg-head p {
  color: var(--sg-muted);
  margin: 0;
  font-size: .92rem;
  line-height: 1.75;
}

.sg-search {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--sg-card);
  border: 1px solid var(--sg-border);
  border-radius: 16px;
  padding: .85rem 1.05rem;
  margin: 1rem 0 .75rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}
.sg-search i { color: var(--sg-muted); }
.sg-search input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  font-size: .95rem;
}

.sg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sg-toolbar select,
.sg-chip {
  border: 1px solid var(--sg-border);
  background: var(--sg-card);
  border-radius: 999px;
  padding: .5rem 1rem;
  font-size: .85rem;
  color: var(--sg-text);
  text-decoration: none !important;
}
.sg-chip--active {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
  color: #fff !important;
}

.sg-card {
  background: var(--sg-card);
  border: 1px solid var(--sg-border);
  border-radius: var(--sg-radius);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}
.sg-card__title {
  font-size: 1.08rem;
  font-weight: 800;
  margin: 0 0 .4rem;
}

.sg-verified {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--sg-green);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: .55rem;
}

.sg-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  color: var(--sg-muted);
  font-size: .8rem;
  margin-bottom: .75rem;
}

.sg-amount {
  color: var(--sg-blue);
  font-weight: 800;
  font-size: 1.08rem;
  margin: .35rem 0 .75rem;
}

.sg-accept {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--sg-green-soft);
  border-radius: 14px;
  padding: .6rem .8rem;
  margin-bottom: .75rem;
  font-size: .85rem;
}
.sg-accept__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sg-green);
  flex-shrink: 0;
}

.sg-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  background: #f8fafc;
  border-radius: 14px;
  padding: .75rem .55rem;
  margin-bottom: .95rem;
  text-align: center;
  font-size: .72rem;
  color: var(--sg-muted);
}
.sg-meta i {
  display: block;
  margin: 0 auto .25rem;
  color: #475569;
  font-size: 1rem;
}

.sg-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: .9rem;
  font-size: .85rem;
}
.sg-stats strong { display: block; margin-top: .15rem; }

.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: .9rem 1rem;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: .15s ease;
}
.sg-btn--primary {
  background: linear-gradient(180deg, #3b7af0, var(--sg-blue));
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(43, 99, 225, .3);
}
.sg-btn--primary:hover { background: var(--sg-blue-dark); color: #fff !important; }
.sg-btn--outline {
  background: #fff;
  color: var(--sg-blue) !important;
  border: 1.5px solid var(--sg-blue);
}
.sg-btn--ghost {
  background: #fff;
  border: 1px solid var(--sg-border);
  color: var(--sg-text) !important;
}
.sg-btn:disabled,
.sg-btn.is-disabled {
  opacity: .45;
  pointer-events: none;
}
.sg-btn-row {
  display: grid;
  gap: .65rem;
  margin-top: .85rem;
}

.sg-section-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--sg-muted);
  margin: 0 0 .65rem;
}

.sg-kv {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .9rem;
}
.sg-kv:last-child { border-bottom: 0; }
.sg-kv span { color: var(--sg-muted); }

.sg-check-list { list-style: none; padding: 0; margin: 0; }
.sg-check-list li {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .35rem 0;
  font-size: .9rem;
}
.sg-check-list i { color: var(--sg-green); margin-top: .15rem; }

.sg-progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: .5rem 0;
}
.sg-progress > span {
  display: block;
  height: 100%;
  background: var(--sg-blue);
  border-radius: 999px;
}

.sg-order-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.sg-order-item:last-child { border-bottom: 0; }

.sg-badge-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sg-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sg-hero-create { text-align: center; padding: 1.5rem 1rem .5rem; }
.sg-hero-create__icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  border-radius: 28px;
  background: linear-gradient(145deg, #dbe7ff, #eff4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sg-blue);
  font-size: 2.4rem;
  box-shadow: 0 12px 28px rgba(43,99,225,.12);
}

.sg-form-label {
  display: block;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .4rem;
}
.sg-form-control {
  width: 100%;
  border: 1px solid var(--sg-border);
  background: #f8fafc;
  border-radius: 14px;
  padding: .85rem 1rem;
  margin-bottom: .95rem;
  font-size: .92rem;
}
.sg-form-control:focus {
  outline: 0;
  border-color: #93b4f5;
  box-shadow: 0 0 0 3px rgba(43,99,225,.12);
  background: #fff;
}

.sg-choice {
  display: block;
  border: 1.5px solid var(--sg-border);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: .75rem;
  cursor: pointer;
  background: #fff;
  transition: .15s ease;
}
.sg-choice:has(input:checked) {
  border-color: var(--sg-blue);
  background: var(--sg-blue-soft);
}
.sg-choice input { margin-left: .65rem; vertical-align: middle; }

.sg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .85rem 0 1rem;
}
.sg-tabs a {
  border-radius: 999px;
  padding: .45rem .9rem;
  border: 1px solid var(--sg-border);
  background: #fff;
  color: var(--sg-muted);
  text-decoration: none;
  font-size: .85rem;
}
.sg-tabs a.active {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
  color: #fff;
}

.sg-req-card { display: flex; gap: .85rem; align-items: flex-start; }
.sg-req-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

.sg-status {
  display: inline-block;
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .75rem;
  font-weight: 700;
}
.sg-status--pending { background: #fff7ed; color: #c2410c; }
.sg-status--ok { background: var(--sg-green-soft); color: #047857; }
.sg-status--no { background: #fef2f2; color: #b91c1c; }

.sg-add-dashed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1.5px dashed #93b4f5;
  border-radius: var(--sg-radius);
  padding: 1.15rem;
  color: var(--sg-blue);
  font-weight: 700;
  text-decoration: none !important;
  margin-bottom: 1rem;
  background: #f8fbff;
}

.sg-userbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.sg-userbar__who { display: flex; align-items: center; gap: .65rem; }
.sg-userbar__who i { font-size: 2rem; color: var(--sg-blue); }
.sg-userbar__meta { font-size: .8rem; color: var(--sg-muted); }

.sg-alert {
  border-radius: 14px;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.sg-alert--ok { background: var(--sg-green-soft); color: #047857; }
.sg-alert--err { background: #fef2f2; color: #b91c1c; }
.sg-alert--info { background: var(--sg-blue-soft); color: #1e40af; }

.sg-pager {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 1.25rem;
}
.sg-pager a {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--sg-border);
  background: #fff;
  color: var(--sg-text);
  text-decoration: none;
}
.sg-pager a.active {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
  color: #fff;
}

.sg-highlight {
  background: #f8fafc;
  border: 1px solid var(--sg-border);
  border-radius: 16px;
  padding: 1rem;
  margin: .75rem 0;
  text-align: center;
}
.sg-highlight__label { color: var(--sg-muted); font-size: .85rem; margin-bottom: .25rem; }
.sg-highlight__value { color: var(--sg-blue); font-size: 1.4rem; font-weight: 800; }

.sg-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--sg-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sg-text);
  text-decoration: none !important;
  margin-bottom: .75rem;
  box-shadow: 0 4px 12px rgba(15,23,42,.05);
}

/* Stepper */
.sg-steps {
  display: flex;
  gap: .35rem;
  margin: .5rem 0 1.25rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}
.sg-steps__item {
  flex: 1;
  min-width: 72px;
  text-align: center;
  font-size: .68rem;
  color: var(--sg-muted);
}
.sg-steps__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto .35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #cbd5e1;
  font-weight: 700;
  font-size: .75rem;
  background: #fff;
}
.sg-steps__item.is-active { color: var(--sg-blue); font-weight: 700; }
.sg-steps__item.is-active .sg-steps__dot {
  background: var(--sg-blue);
  border-color: var(--sg-blue);
  color: #fff;
}
.sg-steps__item.is-done .sg-steps__dot {
  background: var(--sg-green);
  border-color: var(--sg-green);
  color: #fff;
}

.sg-wizard-pane[hidden] { display: none !important; }

.sg-info-card {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid var(--sg-border);
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.sg-info-card i { color: var(--sg-blue); font-size: 1.4rem; }
.sg-secure-banner {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  background: var(--sg-blue-soft);
  border-radius: 14px;
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .85rem;
  color: #1e40af;
}

.sg-filter-sheet {
  background: #fff;
  border: 1px solid var(--sg-border);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: none;
}
.sg-filter-sheet.is-open { display: block; }

/* Lottery wheel */
.sg-wheel-wrap { text-align: center; padding: 1rem 0; }
.sg-wheel {
  width: min(260px, 70vw);
  height: min(260px, 70vw);
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: conic-gradient(
    #f9a8d4 0 60deg,
    #f1f5f9 60deg 120deg,
    #f9a8d4 120deg 180deg,
    #f1f5f9 180deg 240deg,
    #f9a8d4 240deg 300deg,
    #f1f5f9 300deg 360deg
  );
  border: 8px solid #fff;
  box-shadow: 0 0 0 4px #e2e8f0, 0 16px 40px rgba(15,23,42,.12);
  position: relative;
  transition: transform 3s cubic-bezier(.15,.85,.25,1);
}
.sg-wheel::after {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid #0f172a;
}
.sg-wheel.is-spinning { transform: rotate(1440deg); }

/* Bottom nav */
.sg-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sg-border);
  padding: .45rem .35rem calc(.45rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(15,23,42,.06);
}
.sg-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  text-decoration: none !important;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 600;
  padding: .25rem;
  position: relative;
}
.sg-bottom-nav__item i { font-size: 1.2rem; }
.sg-bottom-nav__item.is-active { color: var(--sg-blue); }
.sg-bottom-nav__item.is-active::before {
  content: "";
  position: absolute;
  top: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sg-blue);
}

.sg-terms-box {
  background: #f5f7f9;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.sg-terms-box h3 {
  color: #27ae60;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .65rem;
}
.sg-agree {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  padding: .85rem 1rem;
  margin: 1rem 0;
  background: #fff;
}
.sg-agree input { margin-top: .2rem; }

@media (min-width: 768px) {
  .sg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .sg-grid .sg-card { margin-bottom: 0; }
  .sg-bottom-nav { display: none; }
  .sg-page { padding-bottom: 3rem; }
}

/* App shell */
.sg-app { margin: 0; min-height: 100vh; background: var(--sg-bg); font-family: 'PeydaFaNum', Tahoma, sans-serif; }
.sg-app-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem; background: #fff; border-bottom: 1px solid var(--sg-border);
}
.sg-app-top__brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; color: var(--sg-text); text-decoration: none; }
.sg-app-top__brand i { color: var(--sg-blue); font-size: 1.25rem; }
.sg-app-top__site { color: var(--sg-muted); font-size: 1.2rem; text-decoration: none; }
.sg-app-main { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 5.5rem; }
.sg-stepper { display: flex; gap: .35rem; overflow-x: auto; margin-bottom: 1.1rem; padding-bottom: .2rem; }
.sg-stepper__item { flex: 1; min-width: 64px; text-align: center; font-size: .68rem; color: var(--sg-muted); }
.sg-stepper__dot {
  width: 28px; height: 28px; border-radius: 50%; margin: 0 auto .3rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #cbd5e1; font-weight: 700; font-size: .75rem; background: #fff;
}
.sg-stepper__item.is-active { color: var(--sg-blue); font-weight: 700; }
.sg-stepper__item.is-active .sg-stepper__dot { background: var(--sg-blue); border-color: var(--sg-blue); color: #fff; }
.sg-stepper__item.is-done .sg-stepper__dot { background: var(--sg-green); border-color: var(--sg-green); color: #fff; }
.sg-camera {
  background: #0f172a; color: #fff; border-radius: 16px; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1rem; position: relative; overflow: hidden;
}
.sg-camera video, .sg-camera img { max-width: 100%; max-height: 280px; border-radius: 12px; }
.sg-camera__frame {
  border: 2px solid #fff; border-radius: 12px; width: 85%; height: 120px; margin-bottom: 1rem; opacity: .85;
}
