/* Auth pages — responsive split login (loads after theme.css + site.css) */

.erp-auth-body {
  font-family: var(--font-ui, "Tajawal", "Segoe UI", system-ui, sans-serif);
  color: var(--color-text, #0f172a);
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--color-primary, #4f46e5) 12%, transparent), transparent 42%),
    radial-gradient(circle at 8% 88%, color-mix(in srgb, var(--color-accent, #14b8a6) 10%, transparent), transparent 38%),
    var(--color-bg, #f3f4f8);
}

.auth-page-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 1.5rem;
}

.auth-lang-corner {
  position: fixed;
  top: 1rem;
  inset-inline-end: 1rem;
  z-index: 20;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md, 14px);
  background: color-mix(in srgb, var(--color-surface, #fff) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.09));
  box-shadow: var(--shadow-soft, 0 22px 55px rgba(15, 23, 42, 0.07));
}

.erp-lang-switcher {
  display: inline-flex;
  align-items: center;
}

.erp-lang-switcher-form {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
}

.erp-lang-switcher-current {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bs-body-color);
  padding-inline: 0.1rem;
}

.erp-lang-switcher-sep {
  color: var(--bs-secondary-color);
  padding-inline: 0.2rem;
  font-size: 0.85rem;
  user-select: none;
}

.erp-lang-switcher-btn {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--bs-secondary-color);
}

.erp-lang-switcher-btn:hover,
.erp-lang-switcher-btn:focus-visible {
  color: var(--bs-primary);
  text-decoration: none;
}

.auth-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile: single centered card */
.auth-split {
  width: 100%;
  max-width: 28rem;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.09));
  border-radius: var(--radius-xl, 22px);
  box-shadow: var(--shadow-soft-lg, 0 28px 70px rgba(15, 23, 42, 0.09));
  overflow: hidden;
}

.auth-split__brand {
  padding: 1.75rem 1.5rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border, rgba(15, 23, 42, 0.09));
}

.auth-split__brand-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-split__lead {
  color: var(--color-muted, #64748b);
  font-size: var(--text-sm, 0.875rem);
  line-height: var(--leading-relaxed, 1.65);
  margin: 0.75rem 0 0;
  max-width: 22rem;
}

.auth-split__form {
  padding: 1.5rem 1.5rem 1.75rem;
}

.auth-form-card__title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  line-height: var(--leading-tight, 1.25);
}

.auth-brand__name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
  line-height: var(--leading-tight, 1.25);
}

.auth-card__icon {
  display: grid;
  place-items: center;
  width: 3.75rem;
  height: 3.75rem;
  margin-inline: auto;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-md, 14px);
  background: color-mix(in srgb, var(--color-primary, #4f46e5) 10%, transparent);
  color: var(--color-primary, #4f46e5);
  font-size: 1.75rem;
  box-shadow: var(--shadow-icon-glow, 0 10px 26px color-mix(in srgb, var(--color-primary) 22%, transparent));
}

.auth-form-card .form-label {
  font-weight: 600;
  font-size: var(--text-sm, 0.875rem);
  color: var(--brand-slate-700, #334155);
}

.auth-form-card .input-group {
  border-radius: var(--radius-md, 14px);
  overflow: hidden;
  border: 1px solid var(--color-border-strong, rgba(15, 23, 42, 0.14));
  transition: border-color var(--duration-fast, 180ms) ease,
    box-shadow var(--duration-fast, 180ms) ease;
}

.auth-form-card .input-group:focus-within {
  border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent);
}

.auth-form-card .input-group-text {
  border: none;
  background: var(--color-surface, #fff);
  color: var(--color-muted, #64748b);
}

.auth-form-card .input-group .form-control {
  border: none;
  box-shadow: none;
}

.auth-form-card .input-group .form-control:focus {
  box-shadow: none;
}

.auth-password-toggle {
  cursor: pointer;
  transition: color var(--duration-fast, 180ms) ease,
    background-color var(--duration-fast, 180ms) ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--color-primary, #4f46e5);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface, #fff));
}

.auth-form-card .btn-primary {
  border-radius: var(--radius-md, 14px);
  font-weight: 700;
  box-shadow: var(--shadow-glow-primary, 0 14px 38px color-mix(in srgb, var(--color-primary) 28%, transparent));
  transition: transform var(--duration-fast, 180ms) var(--ease-premium, ease),
    box-shadow var(--duration-fast, 180ms) ease;
}

.auth-form-card .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.auth-form-card .btn-primary[aria-busy="true"] {
  opacity: 0.92;
  transform: none;
}

.auth-form-card .alert-danger {
  border-radius: var(--radius-md, 14px);
}

/* Desktop: split panel */
@media (min-width: 992px) {
  .auth-page-shell {
    padding: 2rem 2.5rem;
  }

  .auth-split {
    display: grid;
    grid-template-columns: 1fr minmax(22rem, 26rem);
    max-width: 56rem;
    min-height: 32rem;
  }

  .auth-split__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    border-bottom: none;
    border-inline-end: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent);
    background:
      radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--color-primary) 18%, transparent), transparent 55%),
      radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--color-accent) 14%, transparent), transparent 50%),
      color-mix(in srgb, var(--color-primary) 4%, var(--color-surface, #fff));
  }

  .auth-split__brand-inner {
    max-width: 20rem;
  }

  .auth-split__lead {
    font-size: 0.9375rem;
    max-width: none;
  }

  .app-brand-logo--auth-card {
    max-height: 4.5rem;
    max-width: 8rem;
    margin-bottom: 1rem;
  }

  .auth-brand__name {
    font-size: 1.25rem;
  }

  .auth-card__icon {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .auth-split__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2.25rem;
  }

  .auth-form-card {
    width: 100%;
    max-width: 22rem;
  }

  .auth-form-card__title {
    margin-bottom: 1.5rem;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .auth-split {
    max-width: 32rem;
  }

  .auth-split__brand,
  .auth-split__form {
    padding-inline: 2rem;
  }
}

.auth-dev-hints {
  font-size: var(--text-xs, 0.75rem);
  border-radius: var(--radius-md, 14px);
}

.auth-dev-hints code {
  font-size: 0.85em;
  word-break: break-all;
}
