/* ===== صفحات الدخول واللوحة ===== */
.auth-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 28px 16px;
  min-height: 100vh;
  min-height: 100dvh; /* يراعي أشرطة متصفّح الجوال */
  overflow-y: auto;   /* تمرير عند طول المحتوى بدل قصّه */
}

.auth-card {
  width: 100%;
  max-width: 480px;
  margin-block: auto; /* توسيط رأسي عند الاتّساع، وعدم قصّ عند الطول */
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 38px 30px 32px;
  position: relative;
  animation: rise 0.6s ease both;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, var(--accent, var(--gold-400)), transparent);
}

.auth-back {
  position: absolute;
  top: 18px; left: 22px;
  color: var(--cream-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.auth-back:hover { color: var(--cream); }

.auth-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent, var(--gold-300));
  background: color-mix(in srgb, var(--accent, var(--gold-400)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, var(--gold-400)) 40%, transparent);
  margin-bottom: 18px;
}

.auth-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #fff;
}
.auth-sub {
  color: var(--cream-dim);
  font-weight: 300;
  font-size: 0.92rem;
  margin-bottom: 26px;
}

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 0.85rem;
  color: var(--cream-dim);
  margin-bottom: 8px;
}
.field__input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
  color: var(--cream);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field__input:focus {
  outline: none;
  border-color: var(--accent, var(--gold-400));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--gold-400)) 22%, transparent);
}

/* حقل كلمة المرور مع زرّ إظهار/إخفاء واضح */
.field__wrap { position: relative; display: block; }
.field__input--pass { padding-inline-end: 46px; }
/* إخفاء زرّ الكشف الأصلي في Edge لتفادي أيقونتين */
.field__input--pass::-ms-reveal, .field__input--pass::-ms-clear { display: none; }
.field__eye {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  padding: 0; border: none; background: none; cursor: pointer;
  color: var(--cream-dim); border-radius: 9px; transition: color 0.15s, background 0.15s;
}
.field__eye:hover { color: var(--gold-300); background: rgba(255, 255, 255, 0.07); }
.field__eye:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 1px; }
.field__eye.is-on { color: var(--gold-300); }

.auth-error {
  color: #ffb4b4;
  font-size: 0.88rem;
  min-height: 20px;
  margin-bottom: 14px;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--petrol-900);
  background: linear-gradient(145deg, var(--accent, var(--gold-300)), var(--accent-deep, var(--gold-500)));
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s, opacity 0.2s;
}
.auth-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.auth-btn:disabled { opacity: 0.6; cursor: progress; }

/* السمات حسب البوابة */
body.theme-gold  { --accent: var(--gold-300); --accent-deep: var(--gold-500); }
body.theme-green {
  --accent: var(--green-600); --accent-deep: var(--green-700);
}
body.theme-green .auth-btn { color: #fff; }

/* ===== اللوحة المؤقتة ===== */
.dash {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 28px 16px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
}
.dash-card {
  width: 100%;
  margin-block: auto;
  max-width: 540px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 38px 32px;
  text-align: center;
}
.dash-card h1 { font-size: 1.6rem; margin-bottom: 10px; color: #fff; }
.dash-card p { color: var(--cream-dim); line-height: 1.9; margin-bottom: 8px; }
.dash-meta {
  display: inline-block;
  margin: 14px 0 24px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}
.dash-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.dash-btn {
  padding: 11px 22px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--cream);
  transition: background 0.2s, transform 0.15s;
}
.dash-btn:hover { background: rgba(255, 255, 255, 0.14); transform: translateY(-1px); }
.dash-btn--danger { border-color: rgba(255, 140, 140, 0.5); color: #ffb4b4; }

/* ===== زر الدخول السريع (وضع التطوير) ===== */
.quick { margin-top: 18px; }
.quick__div { text-align: center; margin: 8px 0 12px; }
.quick__div span { font-size: 0.74rem; color: var(--cream-dim); letter-spacing: 1px; }
.quick__btn {
  width: 100%; padding: 11px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 0.92rem; font-weight: 600;
  color: var(--cream); background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(231, 205, 132, 0.55);
  transition: background 0.2s, transform 0.12s;
}
.quick__btn:hover { background: rgba(231, 205, 132, 0.12); transform: translateY(-1px); }
.quick__btn:disabled { opacity: 0.6; cursor: progress; }

/* ===== استعادة كلمة المرور ===== */
.auth-links { margin-top: 14px; text-align: center; }
.auth-links a { color: var(--gold-300, #e7c873); font-size: 0.9rem; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.forgot { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); }
.forgot__hint { color: var(--cream-dim, #c8d4d8); font-size: 0.8rem; margin-bottom: 10px; line-height: 1.6; white-space: nowrap; }
.auth-msg { color: #8ee0c0; font-size: 0.86rem; min-height: 18px; margin: 6px 0; }
.auth-btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: var(--cream, #eef4f5); }

/* نموذج التسجيل (أعرض + شبكة عمودين) */
.auth-card--wide { max-width: 720px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.auth-grid .field { margin-bottom: 16px; }
.auth-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 560px) { .auth-grid { grid-template-columns: 1fr; } }

/* ===== التجاوب مع الشاشات الصغيرة والجوال ===== */
@media (max-width: 480px) {
  .auth-wrap, .dash { padding: 16px 12px; }
  .auth-card { padding: 26px 18px 22px; border-radius: 18px; }
  .auth-title { font-size: 1.35rem; }
  .auth-sub { font-size: 0.86rem; margin-bottom: 18px; }
  .auth-badge { margin-bottom: 14px; }
  .field { margin-bottom: 14px; }
  .field__input { padding: 12px 14px; font-size: 0.95rem; }
  .forgot__hint { white-space: normal; } /* السماح بالالتفاف على الجوال تفادياً للتجاوز */
  .auth-btn { padding: 13px; font-size: 1rem; }
  .dash-card { padding: 26px 18px; }
  .dash-card h1 { font-size: 1.35rem; }
  .dash-actions { flex-direction: column; }
  .dash-btn { width: 100%; }
}
