/* ============================================================
   ECHO//LINE — Login Page
   Modern, animated, fully RTL/LTR aware
   ============================================================ */

:root {
  --bg-deep: #04060B;
  --bg-card: rgba(10, 14, 22, 0.72);
  --bg-input: rgba(0, 0, 0, 0.35);

  --c-cyan: #00E5FF;
  --c-amber: #D4AF37;
  --c-violet: #9013FE;
  --c-green: #00E676;
  --c-red: #FF5252;

  --text-main: #F0F4F8;
  --text-soft: #B8C2D1;
  --text-muted: #6E7A8E;

  --border-soft: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);

  --font-body: 'Cairo', 'Outfit', system-ui, sans-serif;
  --font-display: 'Outfit', 'Cairo', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; height: 100%; overflow: hidden; }
html[dir="rtl"] body { font-family: var(--font-body); }

body.login-page {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
  color: var(--text-main);
  position: relative;
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

/* Animated background orbs */
.bg-orbs {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orb-float 18s ease-in-out infinite;
}
.orb-1 {
  inline-size: 520px; block-size: 520px;
  background: radial-gradient(circle, var(--c-cyan), transparent 70%);
  inset-block-start: -180px; inset-inline-start: -120px;
  animation-delay: 0s;
}
.orb-2 {
  inline-size: 460px; block-size: 460px;
  background: radial-gradient(circle, var(--c-violet), transparent 70%);
  inset-block-end: -160px; inset-inline-end: -100px;
  animation-delay: -6s;
  animation-duration: 22s;
}
.orb-3 {
  inline-size: 380px; block-size: 380px;
  background: radial-gradient(circle, var(--c-amber), transparent 70%);
  inset-block-start: 40%; inset-inline-start: 50%;
  opacity: 0.25;
  animation-delay: -12s;
  animation-duration: 26s;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 60px) scale(0.95); }
}

/* Subtle grid */
.grid-pattern {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* Layout */
.login-wrap {
  position: relative;
  z-index: 1;
  inline-size: min(440px, 92vw);
  display: flex; flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
}

/* Card */
.login-card {
  inline-size: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 2.5rem 2rem 2rem;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 -1px 0 rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-card.in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Logo */
.logo-zone {
  text-align: center;
  margin-block-end: 1.75rem;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 84px; block-size: 84px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.08), rgba(212, 175, 55, 0.08));
  border: 1px solid var(--border-strong);
  margin-block-end: 1rem;
  animation: logo-pulse 4s ease-in-out infinite;
}
@keyframes logo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.3); }
  50% { box-shadow: 0 0 30px 4px rgba(0, 229, 255, 0.15); }
}
.logo-mark svg { filter: drop-shadow(0 4px 12px rgba(0, 229, 255, 0.4)); }

.brand-title {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.brand-title .t-en {
  background: linear-gradient(135deg, var(--c-cyan), var(--c-amber));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}
.brand-title .t-ar {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-main);
}
.brand-tag {
  margin-block-start: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
html[dir="rtl"] .brand-tag { letter-spacing: 0; text-transform: none; }

/* Alert */
.alert {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.75rem 1rem;
  margin-block-end: 1.25rem;
  border-radius: 12px;
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.3);
  color: #FFB4B4;
  font-size: 0.88rem;
  animation: alert-shake 0.4s ease;
}
@keyframes alert-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.alert-ic { font-size: 1.1rem; }

/* Form */
.login-form {
  display: flex; flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex; flex-direction: column;
  gap: 0.4rem;
}
.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-inline-start: 0.25rem;
}
html[dir="rtl"] .field label { text-transform: none; letter-spacing: 0; }

.input-shell {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  transition: all 0.2s ease;
  overflow: hidden;
}
.input-shell:focus-within {
  border-color: var(--c-cyan);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.12);
}
.input-shell:focus-within .input-ic { color: var(--c-cyan); }

.input-ic {
  flex-shrink: 0;
  padding-inline: 0.9rem 0.4rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.input-shell input {
  flex: 1;
  inline-size: 100%;
  padding: 0.85rem 1rem 0.85rem 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.98rem;
  font-family: inherit;
  letter-spacing: 0.02em;
}
html[dir="rtl"] .input-shell input { padding: 0.85rem 0 0.85rem 1rem; }
.input-shell input::placeholder { color: var(--text-muted); }
.input-shell input:-webkit-autofill {
  -webkit-text-fill-color: var(--text-main);
  -webkit-box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4) inset;
  caret-color: var(--text-main);
}

/* Password toggle */
.toggle-pwd {
  flex-shrink: 0;
  inline-size: 40px; block-size: 40px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.toggle-pwd:hover { color: var(--c-cyan); }
.toggle-pwd .eye-off { display: none; }
.toggle-pwd.showing .eye-on { display: none; }
.toggle-pwd.showing .eye-off { display: block; }

/* Submit button */
.btn-submit {
  margin-block-start: 0.5rem;
  inline-size: 100%;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c-cyan), #008CB8);
  color: #001318;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.25);
}
.btn-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 229, 255, 0.4);
}
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }
.btn-submit svg { transition: transform 0.2s ease; }
html[dir="rtl"] .btn-submit svg { transform: scaleX(-1); }
.btn-submit:hover svg { transform: translateX(3px); }
html[dir="rtl"] .btn-submit:hover svg { transform: scaleX(-1) translateX(3px); }

/* Security badge */
.security {
  margin-block-start: 1.25rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.security svg { color: var(--c-green); }

/* Footer */
.login-foot {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .login-card { padding: 2rem 1.5rem 1.5rem; border-radius: 20px; }
  .logo-mark { inline-size: 72px; block-size: 72px; }
  .brand-title { font-size: 1.55rem; }
  .orb-1, .orb-2, .orb-3 { filter: blur(60px); opacity: 0.3; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .orb, .logo-mark { animation: none; }
  .login-card { transition: none; opacity: 1; transform: none; }
}