/* وقف الاقتصاد — صفحة التسجيل */

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("/fonts/readex-pro-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  src: url("/fonts/readex-pro-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --navy: #002d49;
  --green: #01d378;
  --teal: #2cb9b7;
  --blue: #2a74ba;
  --ink: #0b2b40;
  --muted: #56707f;
  --line: #d6e1e8;
  --line-strong: #b3c4cf;
  --bg: #f4f8f9;
  --surface: #ffffff;
  --tint: #edf9f7;
  --accent: #14857f; /* تركوازي أغمق للنصوص والحدود المحدَّدة */
  --danger: #b3261e;
  --danger-bg: #fdf1f0;
  --brand-gradient: linear-gradient(90deg, var(--blue), var(--teal) 55%, var(--green));
  --radius: 14px;
  --font: "Readex Pro", "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 350;
  line-height: 1.75;
  color: var(--ink);
  background:
    radial-gradient(60rem 26rem at 85% -8rem, rgba(1, 211, 120, 0.13), transparent 70%),
    radial-gradient(52rem 24rem at 10% -6rem, rgba(42, 116, 186, 0.12), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

.brand-bar { height: 5px; background: var(--brand-gradient); }

.page {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ---------- الترويسة ---------- */
.hero { text-align: center; padding: 36px 4px 28px; }
.hero__logo { width: 208px; height: auto; display: block; margin: 0 auto 26px; }
.hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 5.4vw, 2.2rem);
  font-weight: 650;
  line-height: 1.35;
  color: var(--navy);
  text-wrap: balance;
}
.hero__lead {
  margin: 0 auto;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1rem;
  text-wrap: pretty;
}

/* ---------- البطاقة ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px 20px 24px;
  box-shadow: 0 1px 2px rgba(0, 45, 73, 0.04), 0 18px 40px -22px rgba(0, 45, 73, 0.28);
}

/* ---------- الحقول ---------- */
.field { margin: 0; padding: 22px 0; border: 0; border-bottom: 1px solid #e8eff3; min-width: 0; }
.field--consent { border-bottom: 0; padding-bottom: 8px; }
/* في fieldset تُطبَّق الحشوة العلوية بعد العنوان (legend)، فننقلها إلى العنوان نفسه */
fieldset.field { padding-top: 0; }
fieldset.field > legend { padding-top: 22px; }

.field__label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 0;
  margin: 0 0 12px;
  font-size: 1.04rem;
  font-weight: 550;
  line-height: 1.6;
  color: var(--navy);
}
.num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
}
.req { color: var(--danger); font-weight: 600; }
.opt {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef3f6;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.9;
  vertical-align: middle;
  white-space: nowrap;
}

.field__hint { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.7; }
.field__hint--top { margin: -8px 38px 12px 0; }
.field__hint:empty { display: none; }
.field__error { margin: 8px 0 0; color: var(--danger); font-size: 0.875rem; font-weight: 500; }

.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem; /* لا تقل عن 16px حتى لا يكبّر iOS الصفحة عند الكتابة */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #8fa3af; }
.input:hover { border-color: #8fa6b3; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(44, 185, 183, 0.22); }
.input--ltr { direction: ltr; text-align: left; font-weight: 400; letter-spacing: 0.01em; }
.input--area { min-height: 124px; resize: vertical; line-height: 1.8; }
.input--follow { margin-top: 10px; }
.is-invalid .input { border-color: var(--danger); }
.is-invalid .input:focus { box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.16); }

/* ---------- الخيارات ---------- */
.options { display: grid; gap: 10px; }
.options--two { grid-template-columns: 1fr 1fr; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.option:hover { border-color: var(--line-strong); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.option__text { flex: 1; line-height: 1.6; font-weight: 400; }

.option__box {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: #fff center / 14px 14px no-repeat;
  transition: background-color 0.15s, border-color 0.15s;
}
.option:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.option:has(input:checked) .option__text { color: var(--navy); font-weight: 500; }
.option:has(input:checked) .option__box {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4l3 3 6-6.3' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.option:has(input:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(44, 185, 183, 0.25); }

.option--center { flex-direction: column; justify-content: center; gap: 6px; padding: 16px 10px; text-align: center; }
.option--center .option__text { flex: none; }
.option__icon { width: 28px; height: 28px; color: var(--muted); transition: color 0.15s; }
.option--center:has(input:checked) .option__icon { color: var(--accent); }

.option--consent { align-items: flex-start; background: #f8fbfc; }
.option--consent .option__box { margin-top: 3px; }
.option--consent .option__text { font-size: 0.95rem; line-height: 1.8; }
.is-invalid > .option--consent,
.is-invalid > .options > .option:not(:has(input:checked)) { border-color: #e2a39f; }

/* حقل الفخ للروبوتات */
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- الأزرار والتنبيهات ---------- */
.form-alert {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #f0c4c0;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: #8a1c15;
  font-size: 0.95rem;
  font-weight: 450;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  padding: 12px 20px;
  border: 0;
  border-radius: 16px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 10px 22px -12px rgba(0, 45, 73, 0.7);
}
.btn:hover { background: #0a3f61; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(44, 185, 183, 0.45); }
.btn[disabled] { cursor: progress; opacity: 0.85; }
.btn__spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.is-loading .btn__spinner { display: block; }
.btn--ghost {
  width: auto;
  min-height: 50px;
  margin: 22px auto 0;
  padding: 10px 26px;
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--line-strong);
  box-shadow: none;
  font-size: 1rem;
  font-weight: 500;
}
.btn--ghost:hover { background: var(--tint); border-color: var(--accent); }

/* ---------- حالة النجاح ---------- */
.success { text-align: center; padding: 44px 22px 36px; }
.success:focus { outline: none; }
.success__icon { width: 76px; height: 76px; }
.success__check { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.5s 0.15s ease-out forwards; }
.success__title { margin: 16px 0 8px; font-size: 1.45rem; font-weight: 650; line-height: 1.45; color: var(--navy); text-wrap: balance; }
.success__text { margin: 0 auto; max-width: 30rem; color: var(--muted); text-wrap: pretty; }

/* بعد الإرسال: نُبقي الشعار فقط حتى تظهر رسالة الشكر مباشرة */
.is-done .hero__title, .is-done .hero__lead { display: none; }
.is-done .hero__logo { margin-bottom: 0; }

/* ---------- التذييل ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 28px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer__mark { width: 18px; height: auto; margin-inline-end: 2px; }
.footer__dot { opacity: 0.6; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (min-width: 620px) {
  .page { padding-inline: 24px; }
  .hero { padding: 52px 8px 36px; }
  .hero__logo { width: 250px; margin-bottom: 32px; }
  .hero__lead { font-size: 1.06rem; }
  .card { padding: 14px 36px 34px; }
  .options:not(.options--two) { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
  .success__check { stroke-dashoffset: 0; animation: none; }
}

/* ---------- صفحة الإدارة ---------- */
.page--narrow { max-width: 30rem; }
.admin-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid #bfe6df;
  border-radius: var(--radius);
  background: var(--tint);
  color: #0d5f5b;
  font-size: 0.95rem;
  font-weight: 450;
}
