/* =====================================================================
   ليموناش — Design tokens
   Palette: near-black charcoal + electric lime (اسم "ليموناش") + كورال
   دافئ للتباين. خط عرض هندسي جريء + خط نصوص عربي واضح + خط مونو للعدّاد.
   ===================================================================== */
:root {
  --bg: #0b0d10;
  --bg-panel: #12151a;
  --bg-card: #171b21;
  --border: #262b33;
  --lime: #c6f135;
  --lime-dim: #8fae2a;
  --coral: #ff5d78;
  --text: #f5f7f2;
  --text-muted: #8b92a0;
  --text-faint: #565d6b;

  --font-display: "Space Grotesk", "Tajawal", sans-serif;
  --font-body: "Tajawal", "Space Grotesk", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------------
   زر تبديل اللغة — يبقى في نفس الزاوية العلوية بغضّ النظر عن الاتجاه
   بفضل خصائص CSS المنطقية (inset-inline-*)
   --------------------------------------------------------------------- */
.lang-toggle {
  position: fixed;
  top: 18px;
  inset-inline-end: 18px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(23, 27, 33, 0.85);
  backdrop-filter: blur(6px);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-toggle:hover {
  color: var(--lime);
  border-color: var(--lime-dim);
}

/* ---------------------------------------------------------------------
   التخطيط العام: شاشة مقسومة — هوية على جانب، بطاقة الدخول على الآخر
   --------------------------------------------------------------------- */
.stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

@media (max-width: 920px) {
  .stage {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------
   لوحة الهوية
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 0%, #1a1f14 0%, var(--bg-panel) 55%, var(--bg) 100%);
  border-left: 1px solid var(--border);
}

html[dir="rtl"] .hero {
  border-left: none;
  border-right: 1px solid var(--border);
}

@media (max-width: 920px) {
  .hero {
    padding: 40px 28px 32px;
    border: none;
    border-bottom: 1px solid var(--border);
  }
}

.hero__glow {
  position: absolute;
  inset: -30% -10% auto auto;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(198, 241, 53, 0.16) 0%, transparent 70%);
  pointer-events: none;
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.hero__mark {
  font-size: 22px;
  filter: drop-shadow(0 0 10px rgba(198, 241, 53, 0.5));
}

.hero__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.hero__headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.12;
  margin: 0 0 20px;
  max-width: 12ch;
}

.hero__headline-accent {
  color: var(--lime);
}

.hero__sub {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 40ch;
  margin: 0 0 44px;
}

@media (max-width: 920px) {
  .hero__sub {
    margin-bottom: 28px;
  }
}

/* ---------------------------------------------------------------------
   العنصر المميّز: قوس بطولة مباشر
   --------------------------------------------------------------------- */
.bracket {
  max-width: 460px;
}

.bracket__svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.bracket__line {
  stroke: var(--border);
  stroke-width: 1.5;
}

.bracket__line--live {
  stroke: var(--lime-dim);
  stroke-dasharray: 4 4;
  animation: dash 1.6s linear infinite;
}

.bracket__node {
  fill: var(--text-faint);
}

.bracket__node--live {
  fill: var(--lime);
  filter: drop-shadow(0 0 6px rgba(198, 241, 53, 0.8));
  animation: pulse 1.6s ease-in-out infinite;
}

.bracket__label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--text-faint);
  direction: rtl;
}

html[dir="ltr"] .bracket__label {
  direction: ltr;
}

.bracket__label--live {
  fill: var(--lime);
}

@keyframes dash {
  to {
    stroke-dashoffset: -16;
  }
}

@keyframes pulse {
  0%, 100% {
    r: 6;
    opacity: 1;
  }
  50% {
    r: 8;
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bracket__line--live,
  .bracket__node--live {
    animation: none;
  }
}

/* ---------------------------------------------------------------------
   بطاقة تسجيل الدخول
   --------------------------------------------------------------------- */
.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth__card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 30px;
  position: relative;
}

.auth__brand-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.auth__brand-mobile .hero__wordmark {
  font-size: 16px;
}

@media (max-width: 920px) {
  .auth__brand-mobile {
    display: flex;
  }
}

.auth__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 6px;
}

.auth__subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
}

.auth__hint {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
  margin: 18px 0 0;
  text-align: center;
}

/* ---------------------------------------------------------------------
   بانر الخطأ
   --------------------------------------------------------------------- */
.banner {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.banner--error {
  background: rgba(255, 93, 120, 0.1);
  border: 1px solid rgba(255, 93, 120, 0.35);
  color: #ffb3c0;
}

/* ---------------------------------------------------------------------
   Turnstile + زر Google
   --------------------------------------------------------------------- */
.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  min-height: 65px;
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--text);
  color: #1a1a1a;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.google-btn:hover:not(:disabled) {
  opacity: 0.92;
}

.google-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.google-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.google-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   حالة الجلسة النشطة
   --------------------------------------------------------------------- */
.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.profile__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.profile__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile__name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile__email {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.logout-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
}

/* ---------------------------------------------------------------------
   حالة التحميل
   --------------------------------------------------------------------- */
.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 8px 0;
  color: var(--text-faint);
  font-size: 13px;
}

.loading__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading__dot {
    animation: none;
  }
}
