/* Auth Page Styling */
:root {
  --auth-bg-light: linear-gradient(135deg, #AC88FF 0%, #9769FF 100%);
  --auth-bg-dark: linear-gradient(135deg, #101924 0%, #364A63 100%);
  --card-bg-light: rgba(255, 255, 255, 0.95);
  --card-bg-dark: rgba(30, 41, 59, 0.95);
  --text-primary-light: #1e293b;
  --text-primary-dark: #f8fafc;
  --text-secondary-light: #64748b;
  --text-secondary-dark: #94a3b8;
  --border-light: rgba(148, 163, 184, 0.2);
  --border-dark: rgba(148, 163, 184, 0.1);
  --input-bg-light: rgba(255, 255, 255, 0.9);
  --input-bg-dark: rgba(51, 65, 85, 0.8);
  --shadow-light: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-dark: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Default light theme variables */
body {
  --auth-bg: var(--auth-bg-light);
  --card-bg: var(--card-bg-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --border-color: var(--border-light);
  --input-bg: var(--input-bg-light);
  --shadow: var(--shadow-light);
}

/* Dark mode overrides */
.dark-mode {
  --auth-bg: var(--auth-bg-dark);
  --card-bg: var(--card-bg-dark);
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
  --border-color: var(--border-dark);
  --input-bg: var(--input-bg-dark);
  --shadow: var(--shadow-dark);
}

body {
  background: var(--auth-bg) !important;
  min-height: 100vh;
  transition: background 0.6s ease, color 0.6s ease;
}

.card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 10px !important;
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

/* Typography refinement */
body,
input,
button {
  font-weight: 400;
  letter-spacing: 0.01em;
}

.card-inner {
  padding: 3rem !important;
}

.nk-block-title,
.form-label {
  color: var(--text-primary) !important;
  font-weight: 600;
}

.nk-block-des p,
.form-note-s2 {
  color: var(--text-secondary) !important;
}

.form-control {
  background-color: var(--input-bg) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  padding: 0.875rem 1rem !important;
  font-size: 0.925rem;
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, transform 0.4s ease;
  backdrop-filter: blur(10px);
}

.form-control:focus {
  background-color: var(--input-bg) !important;
  border-color: #9769FF !important;
  color: var(--text-primary) !important;
  box-shadow: 0 0 0 3px rgba(151, 105, 255, 0.1) !important;
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--text-secondary) !important;
  opacity: 0.7;
}

.btn-primary {
  background: linear-gradient(135deg, #9769FF 0%, #AC88FF 100%) !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0.875rem 1rem !important;
  font-weight: 600;
  font-size: 0.925rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(151, 105, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(151, 105, 255, 0.6);
}

.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 64px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.toggle-thumb {
  width: 24px;
  height: 24px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: absolute;
  top: 3px;
  left: 4px;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* Show sun when in light mode */
.theme-toggle.light .sun-icon {
  opacity: 1;
}

/* Show moon when in dark mode */
.theme-toggle.dark .moon-icon {
  opacity: 1;
}

/* Thumb slides right in dark mode */
.theme-toggle.dark {
  background: #4b5563;
  justify-content: flex-end;
}

.theme-toggle.dark .toggle-thumb {
  transform: translateX(2px);
  background: rgba(30, 41, 59, 0.9);
}

/* Logo Styling */
.brand-logo {
  margin-bottom: 2rem;
}

.logo-link {
  display: inline-block;
}

.logo-img {
  max-height: 48px;
  width: auto;
}

/* Link Styling */
.link-primary {
  color: #9769FF !important;
  transition: all 0.3s ease;
}

.link-primary:hover {
  color: #AC88FF !important;
  text-decoration: none !important;
}

.form-note-s2 a {
  color: #9769FF !important;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-note-s2 a:hover {
  color: #AC88FF !important;
  text-decoration: underline;
}

/* Special styling for icon status elements */
.icon-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.icon-status-success {
  background-color: rgba(46, 204, 64, 0.1);
  color: #2ecc40;
}

.icon-status-danger {
  background-color: rgba(255, 65, 54, 0.1);
  color: #ff4136;
}

.icon-status .icon {
  font-size: 30px;
}

/* Alert styling */
.alert {
  border-radius: 10px !important;
  background-color: var(--input-bg) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.alert-info {
  background-color: rgba(151, 105, 255, 0.1) !important;
  border-color: rgba(151, 105, 255, 0.2) !important;
  color: var(--text-primary) !important;
}

.text-muted {
  color: var(--text-secondary) !important;
}

/* Soft fade-in animation */
@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

body,
.card,
.form-control,
.btn,
.theme-toggle {
  transition:
    background-color 0.5s ease,
    color 0.5s ease,
    border-color 0.5s ease,
    box-shadow 0.5s ease,
    transform 0.4s ease;
}