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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

.admin-login-body {
  --auth-accent: #5d3df0;
  --auth-accent-dark: #4b2fcd;
  --auth-accent-soft: rgba(93, 61, 240, 0.14);
  --auth-text: #20242d;
  --auth-muted: #6f7683;
  min-height: 100dvh;
  width: 100%;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 8% 10%, rgba(93, 61, 240, 0.08), transparent 30%),
    radial-gradient(circle at 93% 90%, rgba(93, 61, 240, 0.1), transparent 28%),
    linear-gradient(160deg, #f4f5fb 0%, #eef1f8 44%, #f5f7fc 100%);
  overflow: hidden;
}

.login-role-admin {
  --auth-accent: #5d3df0;
  --auth-accent-dark: #482bc9;
  --auth-accent-soft: rgba(93, 61, 240, 0.14);
}

.login-role-member {
  --auth-accent: #2563eb;
  --auth-accent-dark: #174fcb;
  --auth-accent-soft: rgba(37, 99, 235, 0.16);
}

.login-role-client {
  --auth-accent: #0f9d74;
  --auth-accent-dark: #0a7b59;
  --auth-accent-soft: rgba(15, 157, 116, 0.16);
}

.login-role-super {
  --auth-accent: #2563eb;
  --auth-accent-dark: #174fcb;
  --auth-accent-soft: rgba(37, 99, 235, 0.16);
}

.auth-shell {
  min-height: 100dvh;
  width: 100%;
  padding: clamp(10px, 2.2vh, 22px);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.auth-shell::before {
  width: 340px;
  height: 340px;
  left: -70px;
  top: -110px;
  background: radial-gradient(circle at center, var(--auth-accent-soft) 0%, rgba(255, 255, 255, 0) 72%);
}

.auth-shell::after {
  width: 360px;
  height: 360px;
  right: -100px;
  bottom: -130px;
  background: radial-gradient(circle at center, var(--auth-accent-soft) 0%, rgba(255, 255, 255, 0) 72%);
}

.auth-grid {
  width: min(440px, 100%);
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}

.auth-bg,
.auth-ring,
.auth-shape {
  display: none;
}

.auth-card-wrap {
  width: 100%;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  border: 1px solid #e9ebf3;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow:
    0 26px 50px rgba(16, 24, 40, 0.08),
    0 8px 20px rgba(16, 24, 40, 0.05);
}

.auth-card .card-body {
  padding: clamp(18px, 3.2vw, 32px) !important;
}

.auth-brand {
  margin-bottom: 10px;
  text-align: center;
}

.auth-brand-mark {
  min-height: 42px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 16px;
  margin: 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  line-height: 1;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  box-shadow: 0 10px 20px var(--auth-accent-soft);
}

.auth-title {
  font-size: clamp(1.25rem, 2.8vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #161c27;
  margin-bottom: 4px;
}

.auth-subtitle {
  color: var(--auth-muted);
  font-size: 0.92rem;
}

.auth-role-switch {
  margin-top: 18px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #f4f5fa;
  border: 1px solid #ebeef6;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.auth-role-link {
  min-height: 38px;
  border-radius: 9px;
  padding: 8px 10px;
  text-align: center;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: #555c69;
  background: transparent;
  transition: 0.2s ease;
}

.auth-role-link:hover {
  color: var(--auth-text);
  background: #ebeef8;
}

.auth-role-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  box-shadow: 0 8px 18px var(--auth-accent-soft);
}

.auth-form {
  margin-top: 2px;
}

.auth-form .form-label {
  margin-bottom: 8px;
  color: #4b5565;
  font-size: 0.84rem;
  font-weight: 700;
}

.auth-form .form-control {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid #e2e7f1;
  background: #fff !important;
  box-shadow: none !important;
  color: #1d2430;
  font-size: 0.93rem;
}

.auth-form .form-control::placeholder {
  color: #a0a8b7;
}

.auth-form .form-control:focus {
  border-color: var(--auth-accent) !important;
  box-shadow: 0 0 0 4px var(--auth-accent-soft) !important;
}

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

.auth-password-wrap .form-control {
  padding-right: 42px;
}

.auth-password-toggle {
  border: 0;
  background: transparent;
  color: #8a92a0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
  color: var(--auth-accent);
  background: #f4f7ff;
}

.auth-meta {
  margin: 12px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 0.84rem;
}

.auth-meta .form-check {
  margin-bottom: 0;
  min-height: auto;
}

.auth-meta .form-check-label {
  color: #68707e;
}

.auth-meta a {
  text-decoration: none;
  color: var(--auth-accent);
  font-weight: 700;
}

.auth-meta a:hover {
  color: var(--auth-accent-dark);
}

.form-check-input {
  border-color: #ccd3e0;
}

.form-check-input:checked {
  background-color: var(--auth-accent);
  border-color: var(--auth-accent);
}

.auth-submit {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-dark));
  box-shadow: 0 12px 24px var(--auth-accent-soft);
}

.auth-submit:hover,
.auth-submit:focus {
  color: #fff;
  filter: brightness(0.98);
}

.auth-theme-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #e2e7f1;
  background: rgba(255, 255, 255, 0.85);
  color: #5e6675;
  display: grid;
  place-items: center;
  z-index: 5;
}

.auth-theme-toggle:hover,
.auth-theme-toggle:focus {
  color: var(--auth-accent);
  border-color: #ccd4e4;
  background: #fff;
}

.auth-form .invalid-feedback {
  color: #cf2d2d;
  font-size: 0.76rem;
  margin-top: 4px;
}

html[data-theme="dark"] .admin-login-body {
  color: #e8ecf6;
  background:
    radial-gradient(circle at 5% 8%, rgba(93, 61, 240, 0.2), transparent 36%),
    radial-gradient(circle at 92% 88%, rgba(93, 61, 240, 0.18), transparent 34%),
    linear-gradient(160deg, #131722 0%, #10141e 100%);
}

html[data-theme="dark"] .auth-card {
  background: rgba(21, 26, 38, 0.94) !important;
  border-color: #2f3646;
}

html[data-theme="dark"] .auth-title {
  color: #f2f5fb;
}

html[data-theme="dark"] .auth-subtitle,
html[data-theme="dark"] .auth-meta,
html[data-theme="dark"] .auth-meta .form-check-label {
  color: #a9b2c3;
}

html[data-theme="dark"] .auth-role-switch {
  background: #1b2232;
  border-color: #2a3347;
}

html[data-theme="dark"] .auth-role-link {
  color: #b7c1d4;
}

html[data-theme="dark"] .auth-role-link:hover {
  background: #242d40;
  color: #f0f4ff;
}

html[data-theme="dark"] .auth-form .form-label {
  color: #c5cede;
}

html[data-theme="dark"] .auth-form .form-control {
  background: #131b2b !important;
  border-color: #2f3a52;
  color: #eef3ff;
}

html[data-theme="dark"] .auth-form .form-control::placeholder {
  color: #7e889d;
}

html[data-theme="dark"] .auth-theme-toggle {
  border-color: #2f3a52;
  background: rgba(19, 27, 43, 0.88);
  color: #b7c1d4;
}

@media (max-width: 575.98px) {
  .auth-shell {
    padding: 10px;
  }

  .auth-card {
    border-radius: 18px;
  }

  .auth-card .card-body {
    padding: 16px !important;
  }

  .auth-title {
    font-size: 1.2rem;
  }

  .auth-subtitle {
    font-size: 0.86rem;
  }

  .auth-role-link {
    font-size: 0.79rem;
    padding: 8px 6px;
  }

  .auth-meta {
    font-size: 0.8rem;
    margin: 10px 0 14px;
  }
}
