/**
 * تنسيق موحد لجميع الأجهزة — جوال | تابلت | كمبيوتر
 * تناسق تام مع أبعاد الشاشة (ما عدا الداشبورد)
 * الهواتف ≤520px | تابلت 521–767 | أيباد/تابلت كبير 768–1024 | كمبيوتر ≥1025
 */

/* ——— أساسيات لجميع الشاشات ——— */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  position: relative;
  font-size: 1rem;
  background-color: #fff;
  background-image: url("../image/ready.png");
  background-repeat: repeat;
  background-size: 150px auto;
}

/* منع أي عنصر من الخروج عن عرض الشاشة */
img, video, iframe, embed, object, svg {
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  display: block;
}

/* اسم المستخدم وكلمة السر: الكتابة من اليمين لليسار حتى مع الإنجليزي */
#username,
#password,
#user,
#pass {
  direction: rtl;
  text-align: right;
}

/* الحاويات الرئيسية */
.container,
main.container,
.wrap,
.page,
[class*="container"] {
  width: 100%;
  max-width: 100%;
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  box-sizing: border-box;
}

/* شريط الخطوات (3 خطوات) — خط واحد دون التفاف */
.steps {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 8px;
}
.steps .step-circle,
.steps .dots {
  flex-shrink: 0;
}

/* ——— جوال (شاشات صغيرة جداً) ≤480px ——— */
@media (max-width: 480px) {
  html, body { min-width: 100%; }

  .container, main.container, .wrap, .page {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  h1 { font-size: 1.25rem !important; }
  h2 { font-size: 1.1rem !important; }
  h3 { font-size: 1.05rem !important; }

  a, button, [role="button"], .btn, input[type="submit"], input[type="button"], .optBtn, .bank {
    min-height: 44px;
    min-width: 44px;
  }
  a:not([class]), button:not([class]) { display: inline-flex; align-items: center; justify-content: center; }

  .row { margin-left: 0; margin-right: 0; }
  [class*="col-"] { padding-left: 8px; padding-right: 8px; max-width: 100%; }
}

/* ——— جوال (هواتف) ≤520px ——— */
@media (max-width: 520px) {
  html, body { min-width: 100%; }

  .container, main.container, .wrap, .page {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  h1 { font-size: 1.35rem !important; }
  h2 { font-size: 1.2rem !important; }
  h3 { font-size: 1.1rem !important; }

  p, .section, .form-label, .text-muted { font-size: clamp(0.8125rem, 3.5vw, 0.9375rem); }

  a, button, [role="button"], .btn, input[type="submit"], input[type="button"], .optBtn, .bank {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ——— جوال كبير / تابلت عمودي 521px–767px ——— */
@media (min-width: 521px) and (max-width: 767px) {
  .container, main.container, .wrap, .page {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  h1 { font-size: 1.4rem !important; }
  h2 { font-size: 1.25rem !important; }
  h3 { font-size: 1.15rem !important; }

  p, .section { font-size: 0.9375rem; }
}

/* ——— تابلت / أيباد أفقي 768px–1024px ——— */
@media (min-width: 768px) and (max-width: 1024px) {
  .container, main.container, .wrap, .page {
    max-width: 100%;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }

  .wrap { max-width: min(720px, 100%); margin-left: auto; margin-right: auto; }

  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.35rem !important; }
  h3 { font-size: 1.2rem !important; }

  p, .section { font-size: 0.9375rem; }
}

/* ——— كمبيوتر / شاشات كبيرة ≥1025px ——— */
@media (min-width: 1025px) {
  body { max-width: 100vw; }

  .container, main.container {
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }

  .wrap, .page {
    max-width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
  }

  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.35rem !important; }
  h3 { font-size: 1.2rem !important; }

  p, .section { font-size: 1rem; }
}
