
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 24px 16px 40px;
}

h2.page-title {
  text-align: center;
  margin: 18px 0 22px;
  color: var(--green);
  font-family: 'Qahwa Arabic';
  font-size: 30px;
}

.container {
  width: 100%;
  max-width: 620px;
  box-shadow: 0 6px 24px rgba(56, 114, 108, 0.25);
  background: var(--abyad);
  border-radius: 20px;
  padding: 28px 32px;
}

/* شبكة عمودين مدمجة */
.form-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
  width: 100%;
  font-family: 'IBMPlexArabic', sans-serif;
}

.field { display: flex; flex-direction: column; }
.full { grid-column: 1 / -1; }

label {
  margin: 0 0 5px;
  color: var(--brik);
  font-weight: bold;
  font-size: 14px;
  font-family: 'IBMPlexArabic', sans-serif;
}

input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--brik);
  border-radius: 8px;
  outline: none;
  background-color: transparent;
  direction: rtl;
  font-family: 'IBMPlexArabic', sans-serif !important;
  font-size: 14px;
}

input::placeholder {
  font-family: 'IBMPlexArabic', sans-serif;
  color: var(--brik);
  opacity: 0.4;
}

/* توحيد حقل التاريخ مع باقي الحقول (iOS يكبّره افتراضياً) */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  height: 40px;
  min-height: 0;
  line-height: normal;
  text-align: right;
}
input[type="date"]::-webkit-date-and-time-value { text-align: right; }
input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; }

/* اختيار نوع الحساب — بطاقتان توضيحيتان */
.acc-type {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.acc-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 14px;
  padding-inline-start: 44px; /* مساحة لزر الراديو على جهة البداية (يمين بالعربي) */
  position: relative;
  border: 2px solid rgba(56,114,108,0.35);
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: 'IBMPlexArabic', sans-serif;
}
.acc-card input[type="radio"] {
  position: absolute;
  top: 16px;
  inset-inline-start: 14px;
  width: auto;
  margin: 0;
  accent-color: var(--green);
  transform: scale(1.3);
  cursor: pointer;
}
.acc-card-title {
  color: var(--green);
  font-weight: bold;
  font-size: 17px;
}
.acc-card-desc {
  color: #5a6b67;
  font-size: 12.5px;
  line-height: 1.6;
}
/* تمييز البطاقة المختارة */
.acc-card:has(input:checked) {
  border-color: var(--green);
  background: rgba(56,114,108,0.06);
  box-shadow: 0 4px 14px rgba(56,114,108,0.15);
}
.acc-card:has(input:checked) .acc-card-title { color: var(--brik); }

/* حقول النازح كشبكة فرعية بعمودين */
.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 22px;
  border-top: 1px dashed rgba(185,100,20,0.4);
  padding-top: 14px;
  margin-top: 4px;
}

.text {
  font-size: 12.5px;
  color: var(--green);
  font-weight: bold;
  font-family: 'IBMPlexArabic', sans-serif;
  line-height: 1.7;
  margin: 6px 0 0;
}

.terms {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.terms label {
  font-size: 13px;
  margin: 0;
  color: var(--green);
  font-family: 'IBMPlexArabic', sans-serif;
  cursor: pointer;
}
.terms input[type="checkbox"] {
  width: auto;
  transform: scale(1.4);
  accent-color: var(--green);
}

.btn {
  justify-self: center;
  margin-top: 8px;
  height: 44px;
  width: 200px;
  background: var(--brik);
  color: white;
  border: 2px solid var(--brik);
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  font-family: 'Qahwa Arabic';
}
.btn:hover {
  background: var(--abyad);
  color: var(--brik);
}

#agreeError {
  color: red;
  font-size: 13px;
  margin-top: -6px;
}
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    font-family: 'Qahwa Arabic';
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 9999;
    max-width: 350px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg,#89d6b7 0%, var(--green) 100%);
}

.toast-error {
    background: linear-gradient(135deg, #e58957 0%, #ac1c2f 100%);
}

.toast-info {
    background: linear-gradient(135deg, #65686a 0%,  var(--abyad)100%);
    color:var(--green);
}

/* ===== تجاوب الموبايل ===== */
@media (max-width: 600px) {
  body { padding: 16px 12px 32px; }
  h2.page-title { font-size: 24px; margin: 10px 0 16px; }
  .container { padding: 20px 16px; border-radius: 16px; }
  /* عمود واحد على الموبايل */
  .form-box { grid-template-columns: 1fr; gap: 12px; }
  .sub-grid { grid-template-columns: 1fr; }
  /* بطاقتا النوع فوق بعض */
  .acc-type { flex-direction: column; }
  .btn { width: 100%; font-size: 18px; }
  label { font-size: 13.5px; }
  input { font-size: 15px; padding: 11px; } /* أكبر لراحة اللمس */
}

/* ===== حقل كلمة المرور مع أيقونة العين ===== */
.pw-field { position: relative; width: 100%; }
.pw-field input { width: 100%; height: 44px; box-sizing: border-box; padding-left: 42px; }
.pw-eye {
  position: absolute;
  left: 8px;
  top: 22px; /* منتصف الحقل الثابت — لا يتأثر برسالة الخطأ تحته */
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  padding: 4px !important;
  margin: 0 !important;
  width: auto !important;
  color: var(--green);
  cursor: pointer;
  display: flex;
  align-items: center;
  line-height: 0;
}
.pw-eye:hover { color: var(--brik); }
