/* 🚪 «بوابة EduVira» — شكل صفحة الدخول حين يكون المفتاح مشغّلًا (entry_portal.py، طلب المالك 2026-11-15).
   كلّ قاعدةٍ هنا تحت `html.ev-look`؛ بلا الصنف لا يتغيّر في الصفحة شيء. لا يُحذف عنصرٌ ولا يُنقل منطق:
   البطاقة ونماذجها ولوحة المفاتيح واختيار المدرسة كما هي، وما يُضاف (العرض، الشعار، صقر) تبنيه login-eduvira.js. */

html.ev-look {
  --ev-mist: #F1F8F7; --ev-sky: #E3F2F1; --ev-teal: #125E6E; --ev-teal-2: #1C7A8C; --ev-deep: #0E3E48;
  --ev-text: #24414A; --ev-muted: #5E7A82; --ev-line: #D8E8E7; --ev-orange: #E9711C; --ev-orange-h: #D8611A;
  --ev-head: "Readex Pro", "IBM Plex Sans Arabic", var(--sp-font-ui), system-ui, sans-serif;
  --ev-body: "IBM Plex Sans Arabic", "Readex Pro", var(--sp-font-ui), system-ui, sans-serif;
  --ev-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ── الأرضية: الصفحة كلّها لـ EduVira ── */
html.ev-look body {
  background: radial-gradient(900px 520px at 80% 8%, rgba(43, 184, 160, .18), transparent 60%),
              radial-gradient(760px 520px at 8% 96%, rgba(18, 94, 110, .13), transparent 60%),
              linear-gradient(160deg, var(--ev-mist), var(--ev-sky));
  background-color: var(--ev-mist);
  font-family: var(--ev-body); color: var(--ev-text);
  display: block; padding: 0 !important; overflow: hidden;
}
html.ev-look body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5; z-index: 0;
  background-image: radial-gradient(rgba(18, 94, 110, .10) 1px, transparent 1px); background-size: 22px 22px;
}

/* ── الترويسة: اللغة وزرّ الموقع ── */
html.ev-look .ev-topbar {
  position: fixed; top: calc(18px + env(safe-area-inset-top, 0px)); inset-inline-end: 40px; z-index: 50;
  display: flex; gap: 10px; align-items: center;
}
html.ev-look .ev-topbar .lang-toggle-btn {
  position: static; height: auto; font-family: var(--ev-head); font-size: .9rem; font-weight: 500; color: var(--ev-deep);
  background: rgba(255, 255, 255, .85); border: 1.5px solid var(--ev-line); border-radius: 999px; padding: 10px 16px;
}
html.ev-look .ev-topbar .lang-toggle-btn:hover { border-color: var(--ev-teal); background: #fff; }
html.ev-look .ev-discover {
  font-family: var(--ev-head); font-weight: 700; font-size: 1rem; color: #fff; text-decoration: none; white-space: nowrap;
  background: var(--ev-teal); border-radius: 999px; padding: 12px 22px; display: inline-flex; gap: 10px; align-items: center;
  box-shadow: 0 10px 24px rgba(18, 94, 110, .30); transition: transform .25s var(--ev-ease), background .2s;
}
html.ev-look .ev-discover:hover { background: var(--ev-deep); color: #fff; transform: translateY(-2px); }
html.ev-look .ev-discover:focus-visible, html.ev-look .lang-toggle-btn:focus-visible { outline: 3px solid var(--ev-orange); outline-offset: 2px; }
html.ev-look[dir="ltr"] .ev-discover .bi-arrow-left { transform: scaleX(-1); }

/* ── الإطار: عمود المربّع (يمينًا في العربية) وعمود العرض ── */
html.ev-look .login-wrapper {
  position: relative; z-index: 2; max-width: none !important; width: 100%;
  height: 100vh; height: 100dvh; min-height: 0 !important;
  display: grid; grid-template-columns: clamp(340px, 27vw, 400px) 1fr; gap: clamp(28px, 4vw, 64px);
  padding: 84px 40px 18px; background: transparent; border-radius: 0 !important; box-shadow: none !important; overflow: visible;
}
html.ev-look .login-side { display: none !important; }
html.ev-look .login-form-side {
  background: transparent; padding: 0; overflow: visible; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 22px;
}
html.ev-look .ev-brand { width: min(300px, 85%); height: auto; align-self: center; display: block; }

/* مربّع الدخول — صندوقٌ أبيض ظاهر */
html.ev-look .login-card, html.ev-look .school-card {
  flex: none; background: #fff; border: 1px solid var(--ev-line); border-radius: 24px; padding: 22px 24px;
  box-shadow: 0 30px 70px -24px rgba(14, 62, 72, .40), 0 2px 6px rgba(14, 62, 72, .06);
}
html.ev-look .school-top-logo { margin-bottom: 12px; }
html.ev-look .school-top-logo img { max-height: 58px; max-width: 150px; }
html.ev-look .logo-area { margin-bottom: 14px; }
html.ev-look .logo-area h1, html.ev-look .school-card h2 { font-family: var(--ev-head); font-weight: 700; color: var(--ev-deep); font-size: 1.4rem; }
html.ev-look .logo-area p { font-size: .82rem; color: var(--ev-muted); }
html.ev-look .login-tabs { background: var(--ev-mist); border: 1px solid var(--ev-line); border-radius: 14px; padding: 4px; }
html.ev-look .login-tab { font-family: var(--ev-head); font-weight: 500; border-radius: 10px; color: var(--ev-muted); }
html.ev-look .login-tab.on { background: #fff; color: var(--ev-teal); box-shadow: 0 2px 8px rgba(14, 62, 72, .12); }
html.ev-look .form-label { color: var(--ev-deep); }
html.ev-look .form-control { border: 1.5px solid var(--ev-line); border-radius: 12px; }
html.ev-look .form-control:focus { border-color: var(--ev-teal); box-shadow: 0 0 0 4px rgba(18, 94, 110, .12); }
html.ev-look .link-btn { color: var(--ev-teal-2); }
html.ev-look .remember input { accent-color: var(--ev-teal); }
html.ev-look .btn-login {
  font-family: var(--ev-head); font-weight: 700; background: var(--ev-orange); border-color: var(--ev-orange); border-radius: 999px;
  box-shadow: 0 10px 24px rgba(233, 113, 28, .28); transition: transform .25s var(--ev-ease), background .2s;
}
html.ev-look .btn-login:hover:not(:disabled) { background: var(--ev-orange-h); border-color: var(--ev-orange-h); transform: translateY(-2px); }
html.ev-look .login-form-side > .brand-foot { display: none; }   /* شعاراها فوق المربّع وفي الذيل */

/* ── عمود العرض: الإطار ثابت، والصورتان تتبدّلان معًا ── */
html.ev-look .ev-show { position: relative; min-height: 0; display: flex; flex-direction: column; padding-inline-end: 40px; }
html.ev-look .ev-caps { display: grid; text-align: center; margin: 0 auto 14px; max-width: 680px; }
html.ev-look .ev-cap { grid-area: 1 / 1; opacity: 0; transform: translateY(8px); transition: opacity .6s var(--ev-ease), transform .6s var(--ev-ease); }
html.ev-look .ev-cap.on { opacity: 1; transform: none; }
html.ev-look .ev-kick { font-family: var(--ev-head); font-weight: 500; color: var(--ev-teal-2); font-size: .92rem; margin: 0 0 4px; display: inline-flex; gap: 6px; align-items: center; }
html.ev-look .ev-cap h2 { font-family: var(--ev-head); font-weight: 700; color: var(--ev-deep); font-size: clamp(1.5rem, 2.3vw, 2.2rem); margin: 0; line-height: 1.4; text-wrap: balance; }
html.ev-look .ev-device { position: relative; flex: 1; min-height: 0; container-type: size; display: flex; justify-content: center; align-items: center; }
html.ev-look .ev-laptop { position: relative; display: flex; flex-direction: column; align-items: center; }
html.ev-look .ev-scr {
  position: relative; width: min(90cqw, calc((100cqh - 16px) * 1.6)); aspect-ratio: 16 / 10; background: #0f1d22;
  border: 10px solid #16262c; border-bottom-width: 12px; border-radius: 16px 16px 4px 4px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(14, 62, 72, .45);
}
html.ev-look .ev-base { width: 114%; height: 14px; background: linear-gradient(#e3e9eb, #aab6bb); border-radius: 2px 2px 14px 14px; box-shadow: 0 10px 20px -8px rgba(14, 62, 72, .35); }
html.ev-look .ev-phone {
  position: absolute; bottom: -2%; inset-inline-start: -9%; height: 82%; aspect-ratio: 9 / 19.5; background: #16262c;
  border-radius: 30px; padding: 8px; box-shadow: 0 30px 50px -16px rgba(14, 62, 72, .55); z-index: 2;
}
html.ev-look .ev-phone::before { content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 28%; height: 8px; border-radius: 8px; background: #16262c; z-index: 3; }
html.ev-look .ev-pscr { position: relative; width: 100%; height: 100%; border-radius: 23px; overflow: hidden; background: #fff; }
html.ev-look .ev-scr img, html.ev-look .ev-pscr img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .8s var(--ev-ease);
}
html.ev-look .ev-scr img.on, html.ev-look .ev-pscr img.on { opacity: 1; }
html.ev-look .ev-foot { display: flex; justify-content: center; margin-top: 4px; padding-top: 58px; }
html.ev-look .ev-track { position: relative; }

/* 🦅 صقر واقفٌ على نقطة الصورة الحالية، يقفز إلى التالية وينقرها */
html.ev-look .ev-bird { position: absolute; left: 0; bottom: 1px; width: 64px; height: 64px; pointer-events: none; z-index: 3; will-change: transform; }
html.ev-look .ev-bird-hop, html.ev-look .ev-bird-flip { width: 100%; height: 100%; }
html.ev-look .ev-bird-img { width: 100%; height: 100%; display: block; transform-origin: 50% 82%; filter: drop-shadow(0 6px 8px rgba(14, 62, 72, .25)); }
html.ev-look .ev-bubble {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--ev-head); font-weight: 500; font-size: .86rem; color: var(--ev-deep); background: #fff; border: 1px solid var(--ev-line);
  border-radius: 14px; padding: 6px 12px; box-shadow: 0 6px 16px rgba(14, 62, 72, .12); transition: opacity .6s var(--ev-ease);
}
html.ev-look .ev-bubble.hide { opacity: 0; }
html.ev-look .ev-dot.lit { animation: evLit .6s var(--ev-ease); }
@keyframes evLit { 0% { box-shadow: 0 0 0 0 rgba(240, 127, 42, .65); background: #F07F2A; } 100% { box-shadow: 0 0 0 10px rgba(240, 127, 42, 0); } }
html.ev-look .ev-dots { display: flex; gap: 8px; }
html.ev-look .ev-dot { width: 9px; height: 9px; border-radius: 999px; border: 0; background: rgba(18, 94, 110, .25); cursor: pointer; padding: 0; transition: width .3s var(--ev-ease), background .3s; }
html.ev-look .ev-dot.on { width: 28px; background: var(--ev-teal); }

html.ev-look .ev-copy { text-align: center; font-size: .74rem; color: var(--ev-muted); margin-top: -8px; }
html.ev-look .ev-mfeat { display: none; }

/* شاشةٌ قصيرة: أصغر قليلًا ليبقى المربّع كاملًا بلا تمرير */
@media (max-height: 760px) {
  html.ev-look .ev-brand { width: 220px; }
  html.ev-look .login-form-side { gap: 14px; }
  html.ev-look .login-card, html.ev-look .school-card { padding: 18px 22px; }
  html.ev-look .ev-foot { padding-top: 44px; }
  html.ev-look .ev-bird { width: 50px; height: 50px; bottom: 1px; }
}
@media (max-height: 700px) {
  html.ev-look .login-wrapper { padding-top: 72px; }
  html.ev-look .ev-brand { width: 150px; }
  html.ev-look .login-form-side { gap: 10px; }
  html.ev-look .login-card { padding: 14px 20px; }
  html.ev-look .school-top-logo { margin-bottom: 6px; }
  html.ev-look .school-top-logo img { max-height: 40px; }
  html.ev-look .logo-area { margin-bottom: 8px; }
  html.ev-look .logo-area p { display: none; }
  html.ev-look .login-card .mb-3 { margin-bottom: 8px !important; }
  html.ev-look .ev-kick { display: none; }
  html.ev-look .ev-copy { display: none; }
}

/* الجوال واللوحيّ الضيّق: الترويسة والشعار والمربّع، وتحته الميزات أيقونات */
@media (max-width: 900px) {
  html.ev-look body { overflow: auto; }
  html.ev-look .login-wrapper { height: auto; min-height: 100dvh; grid-template-columns: 1fr; padding: 76px 16px 40px; gap: 0; }
  html.ev-look .ev-topbar { inset-inline: 16px; justify-content: center; top: calc(14px + env(safe-area-inset-top, 0px)); }
  html.ev-look .ev-discover { padding: 9px 14px; font-size: .84rem; gap: 6px; }
  html.ev-look .ev-discover .bi { display: none; }
  html.ev-look .ev-topbar .lang-toggle-btn { padding: 8px 12px; }
  html.ev-look .login-form-side { justify-content: flex-start; gap: 18px; max-width: 460px; width: 100%; margin: 0 auto; }
  html.ev-look .ev-brand { width: 200px; }
  html.ev-look .ev-show { display: none; }
  html.ev-look .ev-copy { display: block; margin-top: 0; }
  html.ev-look .ev-mfeat { display: block; }
  html.ev-look .ev-mfeat h2 { font-family: var(--ev-head); font-weight: 700; color: var(--ev-deep); font-size: 1.1rem; text-align: center; margin: 6px 0 12px; }
  html.ev-look .ev-mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  html.ev-look .ev-mtile {
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; background: rgba(255, 255, 255, .75);
    border: 1px solid var(--ev-line); border-radius: 14px; padding: 10px 4px; font-size: .74rem; font-weight: 600; color: var(--ev-deep); line-height: 1.3;
  }
  html.ev-look .ev-mtile .bi { font-size: 1.25rem; color: var(--ev-teal-2); }
  html.ev-look .ev-mmore { display: block; text-align: center; margin-top: 12px; font-family: var(--ev-head); font-weight: 500; color: var(--ev-teal); text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.ev-look .ev-cap, html.ev-look .ev-scr img, html.ev-look .ev-pscr img { transition: none; }
}
