:root {
  --auth-surface: rgba(255, 255, 255, 0.92);
  --auth-border: rgba(255, 255, 255, 0.55);
  --auth-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  --auth-radius: 18px;
  --auth-control-radius: 14px;
  --auth-ring: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

/* Full-page background with soft blur + overlays */
.auth-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 12% 0%, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0) 62%),
    radial-gradient(900px 560px at 100% 18%, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 58%),
    radial-gradient(1200px 800px at 50% 110%, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0) 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.62) 0%, rgba(15, 23, 42, 0.34) 100%);
}
.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--auth-bg-image);
  /* Full width/height coverage (may crop depending on aspect ratio) */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* User request: keep background image clear and ~50% visible */
  filter: none;
  transform: none;
  opacity: 0.5;
  z-index: 0;
}
.auth-page::after {
  content: "";
  position: fixed;
  inset: 0;
  /* Slight overlay to keep the form readable while image stays clear */
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(2, 6, 23, 0.22) 0%, rgba(2, 6, 23, 0) 55%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.30) 0%, rgba(2, 6, 23, 0.14) 100%);
  z-index: 0;
}

/* Center content */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* Split layout (brand panel + form panel) */
.auth-split {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  grid-template-areas: "brand form";
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.26);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
}
html[dir="rtl"] .auth-split {
  grid-template-columns: 0.85fr 1.15fr;
  grid-template-areas: "form brand";
}
.auth-split__brand { grid-area: brand; }
.auth-split__form { grid-area: form; }

.auth-brand {
  position: relative;
  height: 100%;
  padding: 44px 44px;
  color: rgba(255, 255, 255, 0.96);
  background:
    radial-gradient(900px 520px at 10% 10%, rgba(37, 99, 235, 0.55) 0%, rgba(37, 99, 235, 0) 62%),
    radial-gradient(760px 540px at 100% 30%, rgba(99, 102, 241, 0.42) 0%, rgba(99, 102, 241, 0) 58%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.86) 100%);
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--auth-bg-image);
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  mix-blend-mode: screen;
  pointer-events: none;
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.25) 0%, rgba(2, 6, 23, 0.55) 100%);
  pointer-events: none;
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-brand__top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.auth-brand__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.35);
}
.auth-brand__name {
  font-weight: 900;
  letter-spacing: .2px;
  line-height: 1.1;
}
.auth-brand__tag {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}
.auth-brand__headline {
  font-size: clamp(1.1rem, 2.4vw, 1.65rem);
  line-height: 1.25;
  font-weight: 900;
  margin: 0 0 18px 0;
}
.auth-brand__bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.auth-brand__bullets li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(255, 255, 255, 0.84);
}
.auth-brand__bullets i {
  font-size: 1.05rem;
  margin-top: 2px;
  color: rgba(147, 197, 253, 0.95);
}

.auth-form {
  height: 100%;
  padding: 44px 40px;
  background: rgba(255, 255, 255, 0.96);
}
.auth-form__header {
  margin-bottom: 22px;
}
.auth-form__title {
  margin: 0;
  font-weight: 900;
  letter-spacing: .15px;
  color: rgba(15, 23, 42, 0.92);
}
.auth-form__subtitle {
  margin: 6px 0 0 0;
  color: rgba(15, 23, 42, 0.58);
}
.auth-submit {
  padding-top: 11px;
  padding-bottom: 11px;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.22);
}
.auth-form__footer {
  margin: 22px 0 0 0;
  text-align: center;
  color: rgba(15, 23, 42, 0.52);
  font-size: .85rem;
}

@media (max-width: 991.98px) {
  .auth-split {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "form";
  }
  html[dir="rtl"] .auth-split {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "form";
  }
  .auth-brand {
    padding: 26px 22px;
  }
  .auth-form {
    padding: 28px 22px;
  }
}

/* Supports both old `.login-box` pages and the new `.auth-card` markup */
.auth-card,
.login-box {
  width: min(520px, 100%);
}
.login-box {
  margin: 0 auto;
}

.auth-card.card,
.login-box .card {
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
  backdrop-filter: blur(10px);
  border-radius: var(--auth-radius) !important;
  position: relative;
}

.auth-card.card::before,
.login-box .card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: calc(var(--auth-radius) + 1px);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(99, 102, 241, 0.22), rgba(255, 255, 255, 0.35));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-logo {
  margin-bottom: 14px;
  text-align: center;
  font-weight: 800;
  letter-spacing: .2px;
  color: rgba(255, 255, 255, 0.98) !important;
  text-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.auth-logo {
  width: clamp(64px, 7.5vw, 84px);
  height: clamp(64px, 7.5vw, 84px);
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  padding: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

.auth-title {
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(15, 23, 42, 0.92);
  margin: 0;
  font-size: clamp(1.1rem, 2.1vw, 1.55rem);
  line-height: 1.25;
}

.auth-subtitle,
.login-box-msg {
  color: rgba(15, 23, 42, 0.62);
}

.auth-page a {
  text-decoration: none;
}
.auth-page a:hover {
  text-decoration: underline;
}

/* Input group polish */
.auth-page .form-label {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.86);
}

.auth-page .input-group {
  border-radius: var(--auth-control-radius);
}

.auth-page .input-group-text,
.auth-page .input-group .form-control,
.auth-page .input-group .btn {
  border: 1px solid rgba(18, 23, 39, 0.10);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.78);
  padding-top: 10px;
  padding-bottom: 10px;
}

.auth-page .input-group-text {
  background: rgba(15, 23, 42, 0.03);
  font-size: 1.05rem;
}

.auth-page .input-group .form-control::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

/* A single focus ring around the whole group */
.auth-page .input-group:focus-within {
  box-shadow: var(--auth-ring);
}
.auth-page .input-group:focus-within .input-group-text,
.auth-page .input-group:focus-within .form-control,
.auth-page .input-group:focus-within .btn {
  border-color: rgba(37, 99, 235, 0.45);
}
.auth-page .input-group .form-control:focus {
  box-shadow: none !important;
}

/* Keep the password toggle button visually consistent inside input groups */
.auth-page .auth-password-toggle {
  min-width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.03);
  color: rgba(15, 23, 42, 0.70);
}
.auth-page .auth-password-toggle:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Proper radii for input-group pieces (LTR) */
html[dir="ltr"] .auth-page .input-group > :first-child {
  border-top-left-radius: var(--auth-control-radius);
  border-bottom-left-radius: var(--auth-control-radius);
}
html[dir="ltr"] .auth-page .input-group > :last-child {
  border-top-right-radius: var(--auth-control-radius);
  border-bottom-right-radius: var(--auth-control-radius);
}
html[dir="ltr"] .auth-page .input-group > :not(:first-child) {
  border-left: 0;
}
html[dir="ltr"] .auth-page .input-group > :not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Proper radii for input-group pieces (RTL) */
html[dir="rtl"] .auth-page .input-group > :first-child {
  border-top-right-radius: var(--auth-control-radius);
  border-bottom-right-radius: var(--auth-control-radius);
}
html[dir="rtl"] .auth-page .input-group > :last-child {
  border-top-left-radius: var(--auth-control-radius);
  border-bottom-left-radius: var(--auth-control-radius);
}
html[dir="rtl"] .auth-page .input-group > :not(:first-child) {
  border-right: 0;
}
html[dir="rtl"] .auth-page .input-group > :not(:first-child):not(:last-child) {
  border-radius: 0;
}

/* Subtle entrance animation (respects reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .auth-card.card,
  .login-box .card {
    animation: authIn 420ms ease-out both;
  }
  @keyframes authIn {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (max-width: 420px) {
  .auth-shell {
    padding: 22px 12px;
  }
}


