/* Auth pages — green hero panel + neutral login card */
:root {
  --auth-primary: #1e293b;
  --auth-primary-hover: #0f172a;
  --auth-accent: #475569;
  --auth-hero-green-strong: rgba(8, 48, 36, 0.9);
  --auth-hero-green-mid: rgba(13, 110, 79, 0.55);
  --auth-hero-green-soft: rgba(13, 110, 79, 0.15);
  --auth-hero-kayan: #b8f0d8;
  --form-primary: #0d6e4f;
  --form-primary-dark: #0a5840;
  --form-accent: #1a9b6f;
  --form-glass-bg: rgba(255, 255, 255, 0.94);
  --form-glass-border: rgba(255, 255, 255, 0.5);
  --form-text: #1a2e28;
  --form-text-muted: #5c6b64;
  --form-label: #2a3d36;
  --form-input-border: #c5d4ce;
  --form-focus-ring: rgba(26, 155, 111, 0.2);
}

.auth-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  background: #0f172a url('/Img/BgImg.jpg') center / cover no-repeat fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Full-viewport overlay keeps the toggle pinned while page content scrolls */
.auth-lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  pointer-events: none;
}

.auth-lang-bar {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  inset-inline-end: max(1rem, env(safe-area-inset-right));
  padding: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
}

.auth-login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.auth-login-shell--single {
  grid-template-columns: 1fr;
  place-items: center;
  padding: clamp(4.5rem, 12vw, 5rem) clamp(1rem, 4vw, 2rem) 2rem;
}

.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background: linear-gradient(
    to right,
    var(--auth-hero-green-strong) 0%,
    var(--auth-hero-green-mid) 40%,
    var(--auth-hero-green-soft) 70%,
    transparent 100%
  );
  min-height: 0;
}

[dir="rtl"] .auth-hero {
  background: linear-gradient(
    to left,
    var(--auth-hero-green-strong) 0%,
    var(--auth-hero-green-mid) 40%,
    var(--auth-hero-green-soft) 70%,
    transparent 100%
  );
}

.auth-hero-logo {
  width: clamp(4.5rem, 12vw, 6rem);
  height: clamp(4.5rem, 12vw, 6rem);
  border-radius: 0;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  overflow: visible;
  padding: 0;
}

.auth-hero-logo .app-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-hero h2 {
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  font-weight: 700;
  margin-bottom: 0.65rem;
  line-height: 1.2;
}

.auth-hero-sub {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  opacity: 0.95;
  margin-bottom: 0.4rem;
}

.auth-hero-kayan {
  font-weight: 600;
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  margin-bottom: 0.85rem;
  color: var(--auth-hero-kayan);
}

.auth-hero-desc {
  max-width: 32rem;
  line-height: 1.65;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.auth-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: clamp(0.75rem, 2vw, 0.875rem);
}

.auth-login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  width: 100%;
  max-width: 28rem;
  margin-inline: auto;
  align-self: center;
  height: fit-content;
}

.auth-glass {
  background: var(--form-glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-inline-start: 1px solid var(--form-glass-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
  border-radius: 5px;
}

[dir="rtl"] .auth-glass {
  border-inline-start: none;
  border-inline-end: 1px solid var(--form-glass-border);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.08);
}

.auth-login-card h1 {
  font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  font-weight: 700;
  color: var(--form-text);
  margin-bottom: 0.2rem;
}

.auth-card-hint {
  color: var(--form-text-muted);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.auth-login-card .auth-field {
  margin-bottom: 0.75rem;
}

.auth-login-card .auth-field label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--form-label);
  margin-bottom: 0.25rem;
}

.auth-login-card .auth-field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.25rem;
}

.auth-field-label-row label {
  margin-bottom: 0;
}

.auth-login-card .auth-inline-link {
  font-size: 0.8rem;
  color: var(--form-primary);
  text-decoration: none;
}

.auth-login-card .auth-inline-link:hover {
  text-decoration: underline;
}

.auth-input-wrap {
  position: relative;
}

.auth-login-card .auth-input-wrap .form-control {
  padding-inline-start: 2.5rem;
  padding-inline-end: 0.85rem;
  min-height: 2.5rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid var(--form-input-border);
  font-size: 0.9375rem;
  width: 100%;
}

.auth-login-card .auth-input-wrap .form-control:focus {
  border-color: var(--form-accent);
  box-shadow: 0 0 0 0.2rem var(--form-focus-ring);
}

.auth-password-wrap .form-control {
  padding-inline-end: 2.65rem;
}

.auth-login-card .auth-input-wrap .input-icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--form-text-muted);
  pointer-events: none;
}

.auth-pw-toggle {
  position: absolute;
  inset-inline-end: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--form-text-muted);
  padding: 0.25rem 0.45rem;
  line-height: 1;
  min-width: 2rem;
  min-height: 2rem;
}

.auth-login-card .auth-pw-toggle:hover {
  color: var(--form-primary);
}

.auth-login-card .auth-mfa-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: #e8f5ef;
  border: none;
  border-radius: 0.5rem;
  color: #2a5c4a;
  font-size: 0.8125rem;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.auth-login-card .auth-mfa-notice .bi {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.auth-login-card .btn-marassem {
  background: linear-gradient(135deg, var(--form-primary), var(--form-accent));
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  min-height: 2.5rem;
  font-size: 0.9375rem;
}

.auth-login-card .btn-marassem:hover,
.auth-login-card .btn-marassem:focus {
  background: linear-gradient(135deg, var(--form-primary-dark), var(--form-primary));
  color: #fff;
}

.auth-body .lang-glass-option.is-active {
  color: var(--form-primary);
}

.auth-otp-input {
  letter-spacing: 0.35em;
  font-weight: 600;
  text-align: center;
}

.auth-otp-sent-to {
  font-size: 0.875rem;
  color: var(--form-text-muted);
  margin-bottom: 1rem;
}

.auth-otp-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: rgba(13, 110, 79, 0.1);
  border: 1px solid rgba(13, 110, 79, 0.2);
  color: var(--form-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.auth-otp-timer.is-expired {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.25);
  color: #dc3545;
}

.auth-otp-timer-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.auth-resend-otp-form {
  text-align: center;
}

.auth-back-login {
  text-align: center;
  font-size: 0.875rem;
}

.field-validation-error,
.validation-summary-errors {
  color: #dc3545;
  font-size: 0.875rem;
}

.validation-summary-errors ul {
  margin: 0;
  padding-inline-start: 1rem;
}

/* Glass language toggle */
.lang-glass-form {
  margin: 0;
}

.lang-glass-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-width: 7.5rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.15);
}

.lang-glass-slider {
  position: absolute;
  top: 0.2rem;
  bottom: 0.2rem;
  width: calc(50% - 0.2rem);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  transition: inset-inline-start 0.25s ease, inset-inline-end 0.25s ease;
  pointer-events: none;
}

.lang-glass-slider.is-en {
  inset-inline-start: 0.2rem;
  inset-inline-end: auto;
}

.lang-glass-slider.is-ar {
  inset-inline-start: auto;
  inset-inline-end: 0.2rem;
}

.lang-glass-option {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.85rem;
  min-height: 2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.lang-glass-option.is-active {
  color: var(--form-primary);
}

.lang-glass-option:not(.is-active):hover {
  color: #fff;
}

/* Navbar variant (main layout) */
.navbar .lang-glass-toggle {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(203, 213, 225, 0.9);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}

.navbar .lang-glass-option:not(.is-active) {
  color: var(--auth-text-muted);
}

.navbar .lang-glass-option:not(.is-active):hover {
  color: var(--auth-primary);
}

/* —— Responsive —— */
@media (max-width: 991.98px) {
  .auth-login-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    justify-items: center;
    align-content: start;
    padding-inline: 0;
  }

  .auth-hero {
    width: 100%;
    padding: clamp(3.5rem, 10vw, 4rem) clamp(1.25rem, 4vw, 2rem) clamp(2rem, 5vw, 3rem);
    text-align: center;
    align-items: center;
    background: linear-gradient(
      to bottom,
      var(--auth-hero-green-strong) 0%,
      var(--auth-hero-green-mid) 45%,
      var(--auth-hero-green-soft) 75%,
      transparent 100%
    );
  }

  [dir="rtl"] .auth-hero {
    background: linear-gradient(
      to bottom,
      var(--auth-hero-green-strong) 0%,
      var(--auth-hero-green-mid) 45%,
      var(--auth-hero-green-soft) 75%,
      transparent 100%
    );
  }

  .auth-hero-desc {
    margin-inline: auto;
  }

  .auth-hero-badges {
    justify-content: center;
  }

  .auth-glass {
    border: none;
    border-radius: 3px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
    width: min(26rem, 100%);
    max-width: min(26rem, calc(100vw - 2rem));
    margin-top: 0.75rem;
    margin-inline: auto;
  }

  [dir="rtl"] .auth-glass {
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  }

  .auth-login-card {
    width: 100%;
    max-width: min(26rem, calc(100vw - 2rem));
    padding: clamp(1rem, 3vw, 1.5rem);
  }
}

@media (max-width: 575.98px) {
  .auth-lang-bar {
    top: max(0.75rem, env(safe-area-inset-top));
    inset-inline-end: max(0.75rem, env(safe-area-inset-right));
    inset-inline-start: auto;
  }

  .auth-hero {
    padding-top: 3.25rem;
  }

  .auth-hero-badges {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-pill {
    justify-content: center;
  }

  .auth-glass,
  .auth-login-card {
    max-width: min(22rem, calc(100vw - 1.5rem));
  }

  .auth-login-shell--single {
    padding-top: 4rem;
  }
}

@media (min-width: 1400px) {
  .auth-login-card {
    max-width: 32rem;
  }
}
