/* ══════════════════════════════════════════════════════
   DASHBOARD LOGIN — Dark glassmorphism
══════════════════════════════════════════════════════ */
:root {
  --login-bg:        #0b0f19;
  --login-surface:   rgba(17, 24, 39, 0.72);
  --login-border:    rgba(255, 255, 255, 0.08);
  --login-accent:    #6366f1;
  --login-accent-h:  #818cf8;
  --login-text:      #f8fafc;
  --login-muted:     #94a3b8;
  --login-input-bg:  rgba(15, 23, 42, 0.65);
  --login-success:   #34d399;
  --login-error:     #f87171;
  --login-radius:    18px;
  --login-shadow:    0 24px 64px rgba(0, 0, 0, 0.45);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--login-text);
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 90%, rgba(14, 165, 233, 0.12), transparent 50%),
    var(--login-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: min(100%, 420px);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
  margin-bottom: 14px;
}

.login-brand__logo svg {
  width: 28px;
  height: 28px;
}

.login-brand__title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-brand__sub {
  margin: 8px 0 0;
  font-size: 0.92rem;
  color: var(--login-muted);
}

.login-card {
  background: var(--login-surface);
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius);
  box-shadow: var(--login-shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  padding: 32px 28px 28px;
}

.login-field {
  margin-bottom: 18px;
}

.login-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--login-muted);
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--login-border);
  background: var(--login-input-bg);
  color: var(--login-text);
  font: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.login-input::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.login-input:focus {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.login-password-wrap {
  position: relative;
}

.login-input--password {
  padding-inline-end: 44px;
}

.login-password-toggle {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--login-muted);
  cursor: pointer;
  outline: none;
  transition: color 0.18s;
}

.login-password-toggle:hover,
.login-password-toggle.is-revealed {
  color: var(--login-accent-h);
}

.login-password-toggle__icon {
  font-size: 1.05rem;
  line-height: 1;
  pointer-events: none;
}

.login-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 0.88rem;
  color: var(--login-muted);
  cursor: pointer;
  user-select: none;
}

.login-forgot {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.login-forgot__link {
  padding: 0;
  border: none;
  background: none;
  color: var(--login-accent-h);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.18s, opacity 0.18s;
}

.login-forgot__link:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

.login-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--login-accent);
}

.login-submit {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.35);
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(99, 102, 241, 0.42);
}

.login-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-card__footer {
  margin: 1rem 0 0;
  text-align: center;
}

.login-card__link {
  color: var(--login-accent-h);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s;
}

.login-card__link:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.login-submit__spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

/* ── Toastr ── */
.login-toast-host {
  position: fixed;
  top: 24px;
  inset-inline-end: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: min(92vw, 380px);
}

.login-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--login-border);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color: var(--login-text);
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-12px) scale(0.96);
  transition: opacity 0.32s ease, transform 0.32s ease;
  pointer-events: auto;
}

.login-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.login-toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.login-toast--success {
  border-color: rgba(52, 211, 153, 0.35);
}

.login-toast--success .login-toast__icon {
  color: var(--login-success);
}

.login-toast--error {
  border-color: rgba(248, 113, 113, 0.35);
}

.login-toast--error .login-toast__icon {
  color: var(--login-error);
}

.login-toast__msg {
  flex: 1;
  min-width: 0;
}

@media (max-width: 480px) {
  .login-toast-host {
    top: auto;
    bottom: 24px;
    inset-inline: 24px;
    inset-inline-end: 24px;
    max-width: none;
  }
}

/* ── Forgot-password modal ── */
body.login-modal-open {
  overflow: hidden;
}

.login-modal[hidden] {
  display: none !important;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.login-modal__dialog {
  position: relative;
  width: min(100%, 420px);
  background: var(--login-surface);
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius);
  box-shadow: var(--login-shadow);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  padding: 32px 28px 28px;
  animation: loginModalIn 0.28s ease;
}

@keyframes loginModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-modal__close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  inset-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--login-border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.55);
  color: var(--login-muted);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.login-modal__close svg {
  width: 16px;
  height: 16px;
}

.login-modal__close:hover {
  color: var(--login-text);
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.12);
}

.login-modal__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-modal__sub {
  margin: 0 0 22px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--login-muted);
}

/* ── Language switcher (login / reset password) ── */
.login-lang {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 100;
}

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

.login-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  border: 1.5px solid var(--login-border);
  border-radius: 999px;
  background: var(--login-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--login-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}

.login-lang-btn svg:first-of-type {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}

.login-lang-btn__chevron {
  width: 10px;
  height: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.login-lang-btn[aria-expanded="true"] .login-lang-btn__chevron {
  transform: rotate(180deg);
}

.login-lang-btn:hover,
.login-lang-btn[aria-expanded="true"] {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.14);
  color: #fff;
}

.login-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--login-border);
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.login-lang-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.login-lang-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--login-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.login-lang-menu__item:hover,
.login-lang-menu__item.is-active {
  background: rgba(99, 102, 241, 0.14);
  color: var(--login-text);
}

.login-lang-menu__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--login-muted);
}

.login-lang-menu__item.is-active .login-lang-menu__chip {
  background: rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
}

.login-lang-menu__check {
  width: 14px;
  height: 14px;
  margin-inline-start: auto;
  color: var(--login-success);
}

@media (max-width: 480px) {
  .login-lang {
    top: 14px;
    inset-inline-end: 14px;
  }

  .login-lang-btn > span {
    display: none;
  }

  .login-lang-btn {
    padding: 10px;
    border-radius: 50%;
  }

  .login-lang-btn__chevron {
    display: none;
  }
}
