:root {
  --bg: #020817;
  --card: rgba(255,255,255,0.06);
  --border: rgba(148,163,184,0.18);
  --text: #ffffff;
  --muted: #a7b1d6;
  --primary: #0067fe;
  --primary-soft: #38bdf8;
  --danger: #f87171;
  --success: #34d399;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, sans-serif;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

body.rtl {
  direction: rtl;
}

.background {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(0,103,254,0.35), transparent 34%),
    radial-gradient(circle at 85% 75%, rgba(56,189,248,0.22), transparent 35%),
    #020817;
  z-index: -1;
}

.auth-shell {
  width: min(1080px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  place-items: center;
}

.auth-logo {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 700;
}

body.rtl .auth-logo {
  left: auto;
  right: 1.25rem;
}

.auth-logo img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(56,189,248,0.5);
}

.auth-logo strong {
  color: var(--primary-soft);
}

.login-card {
  width: min(460px, 100%);
  padding: 1.6rem;
  border-radius: 22px;
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 24px 70px rgba(0,0,0,0.48);
}

.auth-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.eyebrow {
  color: var(--primary-soft);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-top h1 {
  font-size: clamp(1.8rem, 6vw, 2.25rem);
  line-height: 1.05;
  margin-bottom: 0.4rem;
}

.auth-top p:last-child {
  color: var(--muted);
  font-size: 0.95rem;
}

.lang-btn,
.auth-tabs button {
  border: 1px solid var(--border);
  background: rgba(15,23,42,0.65);
  color: var(--text);
  cursor: pointer;
}

.lang-btn {
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-weight: 700;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-tabs button {
  padding: 0.7rem;
  border-radius: 13px;
  color: var(--muted);
}

.auth-tabs button.active {
    color: #fff;
    border-color: rgba(56,189,248,0.55);
    background: linear-gradient(135deg, var(--primary), #00a3ff);
  }

.auth-form.hidden {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.input-group {
  margin-bottom: 0.9rem;
}

.input-group label {
  font-size: 0.82rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.4rem;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.07);
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-group input:focus {
  background: rgba(255,255,255,0.1);
  border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-inline-end: 3.1rem;
}

body.rtl .password-field input {
  padding-inline-end: 0.9rem;
  padding-inline-start: 3.1rem;
}

.password-toggle-btn {
  position: absolute;
  inset-inline-end: 0.55rem;
  top: 50%;
  width: 2.35rem;
  height: 2.35rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

body.rtl .password-toggle-btn {
  inset-inline-end: auto;
  inset-inline-start: 0.55rem;
}

.password-toggle-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.password-toggle-btn:hover,
.password-toggle-btn.is-visible {
  color: var(--primary-soft);
  background: rgba(56,189,248,0.12);
}

.login-btn {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg,#3ba8ff,#0066ff);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,102,255,0.38);
}

.login-btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.form-message {
  min-height: 1.4rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

.login-footer {
  text-align: center;
  margin-top: 0.8rem;
}

.login-footer a {
  font-size: 0.88rem;
  color: var(--primary-soft);
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-footer a.login-success-link {
  display: inline-flex;
  justify-content: center;
  min-width: 11rem;
  margin-top: 0.35rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #0067fe);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.login-footer a.login-success-link:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

@media (max-width: 560px) {
  .auth-shell {
    padding: 5.5rem 1rem 1rem;
    align-items: start;
  }

  .auth-logo {
    top: 1rem;
    left: 1rem;
  }

  body.rtl .auth-logo {
    right: 1rem;
  }

  .login-card {
    padding: 1.15rem;
    border-radius: 18px;
  }

  .auth-top {
    align-items: center;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
