/* ===== لوحة الدخول =====
   لوحان: هوية على اليمين (اتجاه البدء في RTL)، ونموذج على اليسار.
   على الشاشات الضيقة ينهار إلى عمود واحد بلوح الهوية مختصرًا. */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: stretch;
  padding: 0;
  background:
    radial-gradient(1200px 560px at 85% -14%, rgba(201,162,39,.15), transparent 60%),
    radial-gradient(820px 460px at 8% 112%, rgba(201,162,39,.07), transparent 58%),
    var(--bg);
}

.gate-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  /* الهوية تأخذ النصيب الأكبر: المشهد يحتاج مساحة ليُقرأ منظرًا لا قصاصة،
     والنموذج يحتاج عرضًا قرائيًا فقط لا أكثر. */
  grid-template-columns: minmax(380px, 0.9fr) 1.1fr;
  overflow: hidden;
  background: var(--surface);
}
@media (max-width: 780px) {
  .gate-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .gate-aside { min-height: 240px; }
  .gate-aside { padding: 26px 26px 20px; }
  .gate-aside .points { display: none; }
}

/* ---- لوح الهوية ---- */
.gate-aside {
  position: relative;
  padding: 56px 48px;
  /* الطبقة العليا تدرّج داكن يبقي النص مقروءًا فوق أي صورة.
     تحته cover.jpg إن وُجد — وإن لم يوجد فلا شيء يُرسم ويظهر التدرّج الأساسي. */
  background:
    linear-gradient(180deg, rgba(15,13,10,.78) 0%, rgba(15,13,10,.48) 34%, rgba(15,13,10,.70) 74%, rgba(15,13,10,.92) 100%),
    /* لإحلال صورة فوتوغرافية رسمية: أعِد سطر image-set هنا فوق سطر المشهد.
       أُزيل الآن لأنه يطلب ملفًا غير موجود فيسجّل 404 في كل فتح. */
    url("brand/scene.svg?v=3.4"),
    linear-gradient(158deg, #2A2116 0%, #1C1610 58%, #171208 100%);
  background-size: cover, cover, cover;
  background-position: center, center bottom, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
}
.aside-body { display: grid; gap: 22px; align-content: center; }
/* طبقات حجرية مرسومة بـ CSS — بديل يعمل بلا صورة، ويبقى خلفها إن وُضعت.
   خطوط أفقية غير منتظمة توحي بتطبّق الحجر الرملي. لا صورة خارجية (شرط CSP). */
.gate-aside::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(
      177deg,
      rgba(232,211,160,.055) 0px, rgba(232,211,160,.055) 1px,
      transparent 1px, transparent 9px,
      rgba(232,211,160,.03) 9px, rgba(232,211,160,.03) 10px,
      transparent 10px, transparent 23px
    ),
    linear-gradient(90deg, rgba(201,162,39,.05) 1px, transparent 1px);
  background-size: auto, 30px 100%;
  mask-image: radial-gradient(130% 100% at 76% 4%, #000 8%, transparent 78%);
  pointer-events: none;
}
.gate-aside > * { position: relative; }

.gate-brand { display: flex; align-items: center; gap: 13px; }
.gate-brand h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.2px; }
.gate-brand p  { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* الشعار: عنصر <img> يُملأ من brand/logo.svg. لا خلفية ولا إطار،
   فالشعار الرسمي يأتي بهويته الكاملة ولا نضيف عليه شيئًا. */
.mark {
  width: 52px; height: 52px; flex: 0 0 52px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.45));
}

.gate-aside .lead-lg {
  font-size: 22px; font-weight: 640; line-height: 1.55;
  letter-spacing: -.3px; margin: 0;
}
.gate-aside .lead-lg b { color: var(--gold-soft); font-weight: 640; }

.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.points li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}
.points .tick {
  width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px;
  border-radius: 5px; display: grid; place-items: center;
  background: rgba(201,162,39,.14); color: var(--gold-soft);
  font-size: 10px; border: 1px solid rgba(201,162,39,.24);
}

.gate-aside .foot-note {
  font-size: 11px; color: var(--muted); line-height: 1.7;
  padding-top: 16px; border-top: 1px solid var(--line-soft);
}

/* ---- لوح النموذج ---- */
.gate-main {
  padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: center;
}
/* الحقل لا يُمدّ بامتداد اللوح — سطر بعرض نصف الشاشة يُتعب العين ويجعل
   النموذج يبدو مفكّكًا. نحصره ونتوسّطه داخل نصفه. */
.gate-main > div { width: 100%; max-width: 420px; margin-inline: auto; }
.gate-main h2 { margin: 0 0 5px; font-size: 19px; font-weight: 640; letter-spacing: -.2px; }
.gate-main .lead { margin: 0 0 24px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 11.5px; color: var(--ink-2);
  margin: 0 0 7px; font-weight: 500; letter-spacing: .1px;
}
.field .wrap { position: relative; }
.gate input {
  width: 100%; padding: 12px 14px;
  background: #14100C; color: var(--ink);
  border: 1px solid var(--line); border-radius: 11px;
  font: inherit; font-size: 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.gate input::placeholder { color: #6B5F4E; }
.gate input:hover { border-color: #4A3F2E; }
.gate input:focus {
  outline: none; background: #171209;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201,162,39,.11);
}
.gate input[type="password"] { letter-spacing: .06em; }

/* زر إظهار كلمة المرور */
.reveal {
  position: absolute; inset-inline-start: 8px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.03); border: 1px solid var(--line-soft);
  color: var(--ink-2); cursor: pointer; padding: 5px 9px;
  border-radius: 8px; font-size: 11.5px; transition: background .15s, color .15s;
}
.reveal:hover { color: var(--ink); background: var(--surface-2); border-color: var(--line); }

/* مقياس قوة كلمة المرور */
.meter { display: flex; gap: 4px; margin-top: 8px; }
.meter i {
  height: 3px; flex: 1; border-radius: 2px; background: var(--surface-3);
  transition: background .2s;
}
.meter.s1 i:nth-child(1) { background: #B4534E; }
.meter.s2 i:nth-child(-n+2) { background: #C08A2E; }
.meter.s3 i:nth-child(-n+3) { background: #B08B4F; }
.meter.s4 i { background: #4E9A62; }
.meter-txt { font-size: 11px; color: var(--muted); margin-top: 6px; min-height: 16px; line-height: 1.5; }

.btn {
  width: 100%; padding: 13px; border: 0; border-radius: 11px;
  background: linear-gradient(180deg, #D9B33C, #B8931F);
  color: #17120B; font: inherit; font-weight: 650; font-size: 14.5px;
  cursor: pointer; margin-top: 6px;
  box-shadow: 0 6px 18px rgba(201,162,39,.2);
  transition: filter .15s, transform .06s, box-shadow .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(201,162,39,.18); }
.btn:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.3); }
.btn.busy { color: transparent; position: relative; }
.btn.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(23,18,11,.3); border-top-color: #17120B;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.err, .ok-msg {
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px;
  margin-bottom: 15px; line-height: 1.6;
}
.err    { background: #2C1A17; border: 1px solid #5C332C; color: #EDA79D; }
.ok-msg { background: #16261B; border: 1px solid #2E5138; color: #8FCB9F; }

.note-box {
  margin-top: 20px; padding: 12px 14px;
  border: 1px dashed var(--line); border-radius: 11px;
  font-size: 11.5px; color: var(--muted); line-height: 1.75;
}
.note-box b { color: var(--gold-soft); }

.note-box .cmd {
  margin-top: 9px; padding: 9px 11px;
  background: #0D0B08; border: 1px solid var(--line); border-radius: 8px;
  font-family: Consolas, "Courier New", monospace; font-size: 11.5px;
  color: var(--gold-soft); overflow-x: auto; white-space: nowrap;
}
