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

:root {
  --silver-50: #F6F7F8;
  --silver-100: #E5E7EA;
  --silver-200: #D1D3D6;
  --silver-300: #B8BFC6;
  --silver-400: #A0A6AD;
  --blue-900: #02045C;
  --blue-800: #0710A8;
  --blue-700: #0810A8;
  --blue-600: #071BE8;
  --blue-500: #0D47A1;
  --blue-400: #1565C0;
  --blue-300: #1976D2;
  --blue-200: #1E88E5;
  --blue-100: #2196F3;
  --black-900: #000000;
  --black-700: #111111;
  --fd-border: rgba(0, 0, 0, 0.1);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --red: #ef4444;
  --green: #22c55e;
  --cyan: #22d3ee;
  --gold: #D4AF37;
  --gold2: #F0D060;
}

html, body {
  height: 100%;
  background: linear-gradient(90deg, var(--silver-300), var(--silver-50), var(--silver-200), var(--silver-400), var(--silver-100));
  color: var(--black-900);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

html[lang="ar"] body {
  font-family: 'Amiri', 'Inter', serif;
}

.fd-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(90deg, var(--silver-300), var(--silver-50), var(--silver-200), var(--silver-400), var(--silver-100));
  z-index: 0;
  pointer-events: none;
}

.fd-wave {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.fd-wave-1 {
  width: 800px;
  height: 800px;
  top: -250px;
  right: -150px;
  background: radial-gradient(circle, rgba(0,0,0,0.05) 0%, transparent 70%);
  animation: waveFloat1 10s ease-in-out infinite;
}

.fd-wave-2 {
  width: 600px;
  height: 600px;
  bottom: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(7,16,168,0.15) 0%, transparent 70%);
  animation: waveFloat2 13s ease-in-out infinite;
}

@keyframes waveFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
}

@keyframes waveFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -40px) scale(1.06); }
}

.fd-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(1px 1px at 10% 15%, rgba(0,0,0,0.3), transparent),
              radial-gradient(1px 1px at 25% 45%, rgba(0,0,0,0.2), transparent),
              radial-gradient(1.5px 1.5px at 40% 8%, rgba(7,16,168,0.4), transparent),
              radial-gradient(1px 1px at 60% 70%, rgba(0,0,0,0.2), transparent),
              radial-gradient(1.5px 1.5px at 75% 22%, rgba(7,16,168,0.3), transparent),
              radial-gradient(1px 1px at 88% 78%, rgba(0,0,0,0.25), transparent);
  background-size: 200px 200px;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.3; }
  100% { opacity: 0.8; }
}

.fd-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 8px 20px;
  background: rgba(246,247,248,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--fd-border);
}

.fd-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fd-logo-box {
  width: 20px;
  height: 20px;
}

.fd-logo-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.fd-lang-wrap {
  position: relative;
}

.fd-lang-btn {
  background: var(--silver-100);
  border: 1px solid var(--fd-border);
  border-radius: 30px;
  padding: 6px 16px;
  color: var(--black-900);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.fd-lang-btn:hover {
  border-color: var(--blue-700);
  background: rgba(7,16,168,0.1);
  box-shadow: 0 0 12px rgba(7,16,168,0.3);
}

.fd-lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(30px);
  border: 1px solid var(--fd-border);
  border-radius: 16px;
  padding: 4px;
  min-width: 150px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  z-index: 200;
}

html[dir="rtl"] .fd-lang-menu {
  right: auto;
  left: 0;
}

.fd-lang-menu.show {
  display: grid;
  gap: 1px;
}

.fd-lang-menu button {
  background: transparent;
  border: none;
  color: var(--black-900);
  padding: 10px 12px;
  text-align: left;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

html[dir="rtl"] .fd-lang-menu button {
  text-align: right;
}

.fd-lang-menu button:hover {
  background: rgba(7,16,168,0.15);
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 40px;
}

.login-card {
  width: 100%;
  max-width: 540px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 36px;
  border: 1px solid rgba(7,16,168,0.25);
  box-shadow: 0 30px 60px rgba(0,0,0,0.12), 0 0 50px rgba(7,27,232,0.15);
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.brand-logo {
  width: 60px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
}

.fd-kicker {
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

h1 {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #000;
}

.fd-subtitle {
  color: #222;
  line-height: 1.7;
  margin: 14px 0 28px;
  font-size: 15px;
  text-align: center;
}

form {
  width: 100%;
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #000;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

html[lang="ar"] label {
  text-align: right;
}

input {
  width: 100%;
  height: 52px;
  border: 1px solid rgba(0,0,0,0.2);
  border-radius: 18px;
  background: rgba(0,0,0,0.02);
  padding: 0 16px;
  font-size: 16px;
  color: #000;
  outline: none;
  transition: 0.2s;
}

input:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(7,27,232,0.1);
}

button[type="submit"] {
  width: 100%;
  height: 58px;
  margin-top: 8px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #0810A8, #071BE8, #1565C0);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 15px 35px rgba(7,27,232,0.45);
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.6) 0%, transparent 70%);
  opacity: 0;
  transition: 0.3s;
}

button[type="submit"]:hover::after {
  opacity: 1;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(7,27,232,0.7), 0 0 70px rgba(7,27,232,0.5);
}

.fd-msg {
  min-height: 24px;
  margin: 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.fd-links {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.fd-links a {
  color: var(--blue-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.fd-back {
  display: block;
  margin-top: 14px;
  color: var(--blue-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 560px) {
  .login-card {
    padding: 32px 20px;
    border-radius: 30px;
  }
  h1 { font-size: 28px; }
}