/* ===== Athar login — scoped page styles only ===== */
.athar-login {
  --login-ink: var(--eduhive-primary, #584530);
  --login-deep: #2a231c;
  --login-mid: var(--eduhive-base, #7D684F);
  --login-accent: var(--eduhive-yellow2, #EF802B);
  --login-glow: var(--eduhive-secondary, #ffcc80);
  --login-paper: var(--eduhive-light, #FFFAEF);
  --login-panel: rgba(255, 250, 239, 0.94);
  --login-muted: #7a6a56;
  --login-line: rgba(125, 104, 79, 0.22);
  --login-bad: #b42318;
  --login-radius: 18px;
  --login-font: "Plus Jakarta Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --login-display: "Plus Jakarta Sans", "IBM Plex Sans Arabic", system-ui, sans-serif;

  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 110px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 56px) 16px;
  overflow: hidden;
  background: var(--login-deep);
  font-family: var(--login-font);
  color: var(--login-ink);
}

.athar-login__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 18% 22%, rgba(239, 128, 43, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 78%, rgba(125, 104, 79, 0.45), transparent 60%),
    radial-gradient(ellipse 40% 35% at 70% 12%, rgba(255, 204, 128, 0.12), transparent 55%),
    linear-gradient(155deg, #181818 0%, #2a231c 42%, #3d3228 100%);
}

.athar-login__atmosphere::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 250, 239, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 250, 239, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 75%);
  animation: atharLoginGrid 18s linear infinite;
}

.athar-login__atmosphere::after {
  content: "";
  position: absolute;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -54%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 128, 43, 0.16), transparent 68%);
  animation: atharLoginPulse 7s ease-in-out infinite;
}

@keyframes atharLoginGrid {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}

@keyframes atharLoginPulse {
  0%, 100% { opacity: 0.65; transform: translate(-50%, -54%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -54%) scale(1.08); }
}

@keyframes atharLoginRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.athar-login__stage {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: atharLoginRise 0.7s ease both;
}

.athar-login__brand {
  text-align: center;
  color: #FFFAEF;
  animation: atharLoginRise 0.85s ease 0.06s both;
}

.athar-login__name {
  margin: 0 0 10px;
  font-family: var(--login-display);
  font-size: clamp(2.35rem, 6vw, 3.15rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #FFFAEF;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

html[lang="ar"] .athar-login__name {
  font-family: "IBM Plex Sans Arabic", var(--login-display), sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.athar-login__tagline {
  margin: 0 auto;
  max-width: 28ch;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 250, 239, 0.82);
  font-weight: 500;
}

.athar-login__panel {
  background: var(--login-panel);
  border: 1px solid rgba(255, 250, 239, 0.18);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 28px);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.35) inset;
  backdrop-filter: blur(14px);
  animation: atharLoginRise 0.9s ease 0.12s both;
}

.athar-login__panel .athar-form__grid {
  gap: 16px;
}

.athar-login__panel .athar-field__label {
  color: var(--login-ink);
  font-weight: 600;
  font-size: 0.88rem;
}

.athar-login__panel .athar-field__control,
.athar-login__panel .athar-form input[type="text"],
.athar-login__panel .athar-form input[type="password"] {
  min-height: 52px;
  border: 1.5px solid var(--login-line) !important;
  border-radius: var(--login-radius) !important;
  background: #fff !important;
  color: var(--login-ink) !important;
  padding: 12px 16px !important;
  font-size: 0.98rem !important;
  box-shadow: none !important;
}

.athar-login__panel .athar-field__control:focus,
.athar-login__panel .athar-form input:focus {
  border-color: var(--login-accent) !important;
  box-shadow: 0 0 0 4px rgba(239, 128, 43, 0.18) !important;
  background: #fff !important;
}

.athar-login__panel .athar-field__control.is-invalid,
.athar-login__panel .athar-form input.is-invalid {
  border-color: rgba(180, 35, 24, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1) !important;
}

.athar-login__panel .athar-field__error {
  color: var(--login-bad);
  font-size: 0.8rem;
  font-weight: 600;
}

.athar-login__password {
  position: relative;
}

.athar-login__password .toggle-password-icon {
  position: absolute;
  top: 50%;
  inset-inline-end: 14px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--login-muted);
  z-index: 2;
}

.athar-login__password .athar-field__control {
  padding-inline-end: 44px !important;
}

.athar-login__panel .alert {
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.08);
  color: #7f1d1d;
  font-size: 0.9rem;
}

.athar-login__panel .athar-form__actions {
  margin-top: 4px;
}

.athar-login__submit,
.athar-login__panel .athar-form__btn,
.athar-login__panel .athar-form .eduhive-btn {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  border-radius: 14px !important;
  border: 0 !important;
  background: linear-gradient(135deg, var(--login-accent) 0%, var(--login-mid) 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 28px rgba(125, 104, 79, 0.28) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.athar-login__submit:hover,
.athar-login__panel .athar-form__btn:hover,
.athar-login__panel .athar-form .eduhive-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 18px 34px rgba(125, 104, 79, 0.34) !important;
}

.athar-login__submit:focus-visible {
  outline: 3px solid rgba(239, 128, 43, 0.55);
  outline-offset: 2px;
}

.athar-login__footer {
  text-align: center;
  animation: atharLoginRise 1s ease 0.18s both;
}

.athar-login__footer a {
  color: rgba(255, 250, 239, 0.78);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 250, 239, 0.28);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.athar-login__footer a:hover,
.athar-login__footer a:focus-visible {
  color: #fff;
  border-bottom-color: rgba(255, 250, 239, 0.7);
}

/* Quiet chrome on login so the viewport stays one composition */
body.athar-login-page .athar-bridge-cta,
body.athar-login-page .athar-close-band {
  display: none !important;
}

body.athar-login-page .scroll-to-top {
  display: none !important;
}

@media (max-width: 575px) {
  .athar-login {
    min-height: calc(100vh - 90px);
    padding: 24px 14px 40px;
  }

  .athar-login__stage {
    gap: 22px;
  }

  .athar-login__panel {
    padding: 20px 16px;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .athar-login__atmosphere::before,
  .athar-login__atmosphere::after,
  .athar-login__stage,
  .athar-login__brand,
  .athar-login__panel,
  .athar-login__footer {
    animation: none !important;
  }
}
