:root {
  --auth-primary: #5f6fff;
  --auth-primary-strong: #5543f0;
  --auth-text: #2f3552;
  --auth-muted: #78809a;
  --auth-border: #dce1ef;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.auth-page {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 15% 15%, #f2f4ff 0%, #eef2ff 22%, #f7f8ff 46%, #f4f5fb 100%),
    linear-gradient(160deg, #f8f9ff 0%, #f3f5ff 100%);
  overflow-x: hidden;
}

.auth-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  opacity: 0.42;
  animation: orbFloat 16s ease-in-out infinite;
}

.orb-a {
  width: 340px;
  height: 340px;
  top: -80px;
  right: -70px;
  background: radial-gradient(circle at 30% 30%, #7b8eff 0%, #556dff 60%, #5f48d9 100%);
}

.orb-b {
  width: 300px;
  height: 300px;
  bottom: -110px;
  left: -70px;
  animation-duration: 20s;
  background: radial-gradient(circle at 45% 35%, #7ce2ff 0%, #62b8ff 55%, #5f7dff 100%);
}

.orb-c {
  width: 220px;
  height: 220px;
  top: 52%;
  left: 45%;
  animation-duration: 18s;
  background: radial-gradient(circle at 38% 38%, #d9ddff 0%, #bfc8ff 70%, #acb8ff 100%);
}

.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 520px);
  gap: 1.5rem;
  align-items: stretch;
}

.auth-intro {
  align-items: stretch;
}

.auth-intro-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 24px;
  padding: 2.25rem;
  color: #ffffff;
  background: linear-gradient(145deg, #2d47ff 0%, #5d73ff 55%, #7a8eff 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 24px 60px rgba(53, 75, 201, 0.34);
  animation: slideIn 0.8s ease both;
}

.auth-intro-card::before,
.auth-intro-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.24;
  pointer-events: none;
}

.auth-intro-card::before {
  width: 220px;
  height: 220px;
  right: -70px;
  top: -70px;
  background: #ffffff;
}

.auth-intro-card::after {
  width: 180px;
  height: 180px;
  bottom: -70px;
  left: -60px;
  background: #b7c8ff;
}

.intro-logo {
  display: block;
  max-height: 56px;
  width: auto;
  max-width: 220px;
  margin-bottom: 1.25rem;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(16, 28, 86, 0.26));
}

.auth-intro-card h1 {
  margin: 0 0 0.75rem;
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 700;
}

.auth-intro-card p {
  margin: 0;
  max-width: 440px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.97rem;
}

.intro-points {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.intro-points li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(2px);
  font-size: 0.91rem;
}

.intro-points li i {
  margin-top: 0.05rem;
  font-size: 1rem;
  line-height: 1;
  color: #ebf4ff;
}

.auth-panel {
  position: relative;
  animation: fadeUp 0.85s ease both;
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(127, 143, 199, 0.35);
  background: rgba(255, 255, 255, 0.58);
  color: #6e7592;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.22s ease;
}

.lang-switch a:hover {
  color: #4e5680;
  transform: translateY(-1px);
}

.lang-switch a.active {
  background: #ffffff;
  color: var(--auth-primary-strong);
  border-color: rgba(95, 111, 255, 0.55);
  box-shadow: 0 8px 18px rgba(89, 109, 248, 0.16);
}

.auth-card {
  border: 1px solid rgba(192, 202, 230, 0.55);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 52px rgba(54, 72, 145, 0.18);
  overflow: hidden;
}

.auth-card .card-body {
  padding: 2rem 1.75rem 1.85rem;
}

.app-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.35rem;
}

.app-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.app-brand-logo {
  display: block;
  max-height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.app-brand-name {
  font-size: 1.06rem;
  font-weight: 700;
  color: #27304f;
  letter-spacing: 0.02em;
}

.auth-header {
  margin-bottom: 1.15rem;
}

.auth-header h4 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #252e4d;
}

.auth-header p {
  margin: 0.42rem 0 0;
  color: var(--auth-muted);
  font-size: 0.92rem;
}

.form-floating > .form-control {
  height: 3.25rem;
  border-radius: 12px;
  border-color: var(--auth-border);
  color: var(--auth-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.form-floating > .form-control::placeholder {
  color: transparent;
}

.form-floating > label {
  color: #7c849d;
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
  border-color: #6a7bff;
  box-shadow: 0 0 0 0.18rem rgba(95, 111, 255, 0.14);
}

.form-floating > .form-control:focus {
  transform: translateY(-1px);
}

.form-control.is-invalid {
  border-color: #dc5a68 !important;
  background-image: none !important;
}

.form-hint {
  display: block;
  margin-top: 0.45rem;
  color: #8d93aa;
  font-size: 0.75rem;
}

.form-password-toggle .input-group .form-floating > .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.form-password-toggle .input-group .input-group-text {
  border: 1px solid var(--auth-border);
  border-left: 0;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  background: #ffffff;
  color: #7683a8;
  padding-inline: 0.82rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.form-password-toggle .input-group .input-group-text i {
  font-size: 1.04rem;
}

.form-password-toggle .input-group:focus-within .input-group-text {
  border-color: #6a7bff;
  box-shadow: 0 0 0 0.18rem rgba(95, 111, 255, 0.14);
  color: var(--auth-primary);
}

.submit-btn {
  border: 0;
  border-radius: 13px;
  padding: 0.86rem 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #6171ff 0%, #6e59ff 100%);
  box-shadow: 0 16px 30px rgba(87, 107, 246, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.submit-btn i {
  transition: transform 0.2s ease;
}

.submit-btn:hover,
.submit-btn:focus {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(86, 104, 236, 0.36);
}

.submit-btn:hover i,
.submit-btn:focus i {
  transform: translateX(2px);
}

.alert {
  border: 0;
  border-radius: 12px;
  font-size: 0.875rem;
  padding: 0.85rem 0.95rem;
  animation: fadeIn 0.35s ease;
}

.alert-danger {
  background: #fff1f4;
  color: #b03f52;
}

.alert-success {
  background: #ecfbf2;
  color: #147345;
}

.success-box {
  animation: fadeUp 0.55s ease;
}

.success-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 185, 99, 0.13);
  color: #1bb963;
  font-size: 1.55rem;
  margin-bottom: 0.95rem;
  position: relative;
}

.success-icon::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(27, 185, 99, 0.28);
  animation: pulseRing 2s ease-out infinite;
}

@keyframes orbFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -16px, 0) scale(1.04);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseRing {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(1.22);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

@media (max-width: 1199.98px) {
  .auth-grid {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 490px);
  }
}

@media (max-width: 991.98px) {
  .auth-shell {
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .auth-grid {
    grid-template-columns: minmax(0, 540px);
    justify-content: center;
    gap: 0.9rem;
  }

  .lang-switch {
    justify-content: center;
  }

  .auth-card .card-body {
    padding: 1.65rem 1.35rem 1.45rem;
  }
}

@media (max-width: 575.98px) {
  .auth-shell {
    padding-inline: 0.5rem;
  }

  .auth-card {
    border-radius: 18px;
  }

  .auth-card .card-body {
    padding: 1.35rem 1rem;
  }

  .app-brand-logo {
    max-height: 36px;
  }

  .app-brand-name {
    font-size: 1rem;
  }

  .lang-switch a {
    min-width: 0;
    width: 48%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
