:root {
  --brand-primary: #2a0f4d;
  --brand-secondary: #4c2ca6;
  --brand-accent: #6f3cb8;
  --brand-highlight: #d9b980;
}

body.auth-background {
  font-family: 'Noto Sans Thai', sans-serif;
  background: #f7f3ff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem 1rem;
}

body.auth-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(42, 15, 77, 0.82) 0%, rgba(76, 44, 166, 0.68) 60%, rgba(111, 60, 184, 0.72) 100%);
  opacity: 0.94;
}

.container {
  position: relative;
  z-index: 1;
}

.brand-header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-header a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  gap: 0.9rem;
}

.brand-header img {
  width: 60px;
  height: 60px;
}

.brand-title {
  color: var(--brand-highlight);
  font-size: 1.5rem;
  font-weight: 600;
  display: block;
}

.brand-subtitle {
  color: #f8f4ff;
  font-size: 0.875rem;
  display: block;
}

.brand-caption {
  color: rgba(248, 244, 255, 0.75);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  display: block;
}

.auth-card {
  border-radius: 22px;
  overflow: hidden;
  border: none;
  background: #ffffff;
  box-shadow: 0 24px 45px rgba(42, 15, 77, 0.28);
}

.auth-card .card-body {
  background: linear-gradient(180deg, rgba(76, 44, 166, 0.18) 0%, rgba(255, 255, 255, 0.95) 28%, #ffffff 100%);
}

.text-brand {
  color: var(--brand-primary);
  font-weight: 600;
}

.form-label {
  font-weight: 500;
  color: var(--brand-primary);
}

.form-control-user {
  border-radius: 14px;
  border: 1px solid rgba(42, 15, 77, 0.2);
  padding: 0.85rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-user:focus {
  border-color: var(--brand-secondary);
  box-shadow: 0 0 0 0.2rem rgba(76, 44, 166, 0.2);
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 60%, var(--brand-accent) 100%);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
  padding: 0.9rem 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(42, 15, 77, 0.25);
  color: #fff;
}

.brand-outline {
  border-radius: 999px;
  color: var(--brand-primary);
  font-weight: 500;
  padding: 0.9rem 1.25rem;
  border-color: rgba(42, 15, 77, 0.26) !important;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.brand-outline:hover {
  background: rgba(187, 138, 44, 0.15);
  transform: translateY(-2px);
  color: var(--brand-primary);
}

.alert {
  border-radius: 14px;
  border: none;
  box-shadow: 0 12px 18px rgba(215, 77, 79, 0.25);
}

.input-group .form-control-user {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-toggle {
  border: 1px solid rgba(42, 15, 77, 0.2);
  border-left: 0;
  background: #fff;
  color: var(--brand-secondary);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
  padding: 0 0.9rem;
}

.btn-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(76, 44, 166, 0.2);
}

.d-grid {
  display: grid;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 1rem;
}

.me-1 {
  margin-right: 0.25rem;
}

.me-2 {
  margin-right: 0.5rem;
}

.me-3 {
  margin-right: 1rem;
}

.text-start {
  text-align: left;
}

@media (max-width: 575.98px) {
  .brand-header {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
  }

  .brand-header img {
    width: 48px;
    height: 48px;
  }

  .auth-card {
    margin-top: 1rem;
  }

  .card-body {
    padding: 2.5rem 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-brand,
  .brand-outline,
  .form-control-user {
    transition: none;
  }
}
