:root {
  --primary: #0e7c5a;
  --primary-dark: #0a5c43;
  --accent: #f4b740;
  --bg: #f4f8f6;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --radius: 20px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

#app { height: 100vh; display: flex; flex-direction: column; }

/* الترويسة */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
header .logo { font-size: 40px; line-height: 1; }
header h1 { font-size: 24px; font-weight: 700; }
header .badge {
  margin-inline-start: auto;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 999px;
}

/* المسرح */
main { flex: 1; overflow-y: auto; padding: 28px 32px; }
.screen { max-width: 1000px; margin: 0 auto; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.screen-sub { color: var(--muted); margin-bottom: 24px; font-size: 16px; }

/* شبكة أوجه التبرع */
.causes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cause {
  background: var(--card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s, border-color 0.12s;
}
.cause:active { transform: scale(0.97); }
.cause:hover { border-color: var(--primary); }
.cause .ico { font-size: 46px; }
.cause .nm { font-size: 19px; font-weight: 600; margin-top: 12px; }
.cause .nt { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* المبالغ */
.amounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
.amount {
  background: var(--card);
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 26px;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
.amount:active { transform: scale(0.97); }
.amount.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

.custom-amount {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 2px dashed #cbd5e1;
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px;
}
.custom-amount input {
  flex: 1; border: none; outline: none; font-size: 30px; font-weight: 700;
  text-align: center; background: transparent; color: var(--ink); font-family: inherit;
}
.custom-amount .cur { font-size: 20px; color: var(--muted); }

.phone-field { display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 2px solid #e5e7eb; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 18px; }
.phone-field input { flex: 1; border: none; outline: none; font-size: 20px; background: transparent;
  font-family: inherit; text-align: right; }
.phone-field label { color: var(--muted); font-size: 15px; }

/* الأزرار */
.btn {
  display: block; width: 100%; border: none; border-radius: var(--radius);
  padding: 20px; font-size: 22px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform 0.12s, opacity 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--muted); font-size: 17px; padding: 12px; }

/* شاشة الدفع */
.pay-stage { text-align: center; padding: 30px 0; }
.pay-amount { font-size: 52px; font-weight: 800; color: var(--primary); margin: 10px 0; }
.pay-label { font-size: 20px; color: var(--muted); }
.tap-ring {
  width: 180px; height: 180px; margin: 36px auto; border-radius: 50%;
  border: 6px solid var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 70px; animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(14,124,90,0.35); } 50% { box-shadow: 0 0 0 22px rgba(14,124,90,0); } }
.pay-hint { font-size: 22px; font-weight: 600; margin-top: 8px; }
.spinner { width: 54px; height: 54px; border: 6px solid #e5e7eb; border-top-color: var(--primary);
  border-radius: 50%; margin: 40px auto; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* وحدة العملة الصغيرة بجانب الأرقام */
.cur-sm { font-size: 0.55em; font-weight: 600; color: var(--muted); }
.amount .cur-sm { color: inherit; opacity: 0.85; }
.amount-hint { color: var(--muted); font-size: 14px; margin: -6px 0 16px; text-align: center; }

/* شاشة المراجعة والتأكيد */
.confirm { text-align: center; max-width: 560px; }
.confirm-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 24px; margin: 8px 0 24px;
}
.confirm-row { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; color: var(--muted); font-size: 16px; }
.confirm-row .confirm-val { color: var(--ink); font-weight: 600; }
.confirm-amount { font-size: 56px; font-weight: 800; color: var(--primary); margin: 14px 0 4px; }
.confirm-words { color: var(--muted); font-size: 18px; }

/* شاشة الشكر */
.result { text-align: center; padding: 30px 0; }
.result .big { font-size: 84px; }
.result h2 { font-size: 30px; margin: 12px 0; }
.result .ref { color: var(--muted); font-size: 15px; margin-top: 8px; }
.qr { width: 180px; height: 180px; margin: 22px auto 8px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; display: grid; place-items: center; padding: 10px; font-size: 13px; color: var(--muted); }
.qr svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.qr-cap { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.error-box { color: #b91c1c; }

/* شاشة الجذب/الخمول */
.attract {
  text-align: center; min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; cursor: pointer; position: relative;
}
.attract-logo { font-size: 110px; line-height: 1; animation: float 3s ease-in-out infinite; }
.attract-name { font-size: 32px; font-weight: 800; color: var(--primary-dark); }
.attract-icons { display: flex; gap: 18px; font-size: 34px; opacity: 0.65; }
.attract-cta {
  margin-top: 8px; font-size: 26px; font-weight: 700; color: #fff;
  background: var(--primary); padding: 16px 40px; border-radius: 999px;
  box-shadow: var(--shadow); animation: pulse 1.8s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.countdown { color: var(--muted); font-size: 14px; margin-top: 16px; }

footer { text-align: center; padding: 10px; font-size: 12px; color: var(--muted); }
.dev-pill { background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 999px; }
