/**
 * PROJECT NOCTURNE — Auth surface (login / register / password)
 * True light + dark themes using design-system semantic tokens.
 */

html {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body.auth-nocturne {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgb(var(--ds-primary-500) / 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgb(var(--ds-info-500) / 0.10), transparent 50%),
    rgb(var(--ds-surface-page));
  color: rgb(var(--ds-fg));
}

html.ds-rtl body.auth-nocturne,
html[dir="rtl"] body.auth-nocturne {
  font-family: 'Cairo', var(--ds-font-sans, system-ui), sans-serif;
}

.auth-nocturne-shell {
  min-height: 100vh;
}

/* Card / panel */
body.auth-nocturne .bg-theme-white,
body.auth-nocturne .bg-white,
body.auth-nocturne .card,
body.auth-nocturne .rounded-15.shadow-md {
  background: rgb(var(--ds-surface)) !important;
  color: rgb(var(--ds-fg)) !important;
  border: 1px solid rgb(var(--ds-border));
  box-shadow: var(--ds-shadow-md);
}

body.auth-nocturne h1,
body.auth-nocturne h2,
body.auth-nocturne h3,
body.auth-nocturne .fs-2,
body.auth-nocturne .fs-3,
body.auth-nocturne label,
body.auth-nocturne .form-label,
body.auth-nocturne .text-dark,
body.auth-nocturne .text-gray-800,
body.auth-nocturne .text-gray-900 {
  color: rgb(var(--ds-fg)) !important;
}

body.auth-nocturne .text-muted,
body.auth-nocturne .text-gray-500,
body.auth-nocturne .text-gray-600,
body.auth-nocturne .form-text,
body.auth-nocturne small {
  color: rgb(var(--ds-fg-muted)) !important;
}

body.auth-nocturne .form-control,
body.auth-nocturne .form-select,
body.auth-nocturne input[type="email"],
body.auth-nocturne input[type="password"],
body.auth-nocturne input[type="text"] {
  background: rgb(var(--ds-surface-sunken)) !important;
  color: rgb(var(--ds-fg)) !important;
  border: 1px solid rgb(var(--ds-border)) !important;
  border-radius: var(--ds-radius-md, 0.5rem);
}

body.auth-nocturne .form-control:focus,
body.auth-nocturne input:focus {
  border-color: rgb(var(--ds-border-focus)) !important;
  box-shadow: 0 0 0 3px rgb(var(--ds-primary-500) / 0.22) !important;
  outline: none;
}

body.auth-nocturne .form-control::placeholder {
  color: rgb(var(--ds-fg-subtle)) !important;
}

body.auth-nocturne .btn-primary,
body.auth-nocturne button[type="submit"] {
  background: rgb(var(--ds-accent)) !important;
  border-color: rgb(var(--ds-accent)) !important;
  color: rgb(var(--ds-accent-fg)) !important;
}

body.auth-nocturne .btn-primary:hover,
body.auth-nocturne button[type="submit"]:hover {
  background: rgb(var(--ds-accent-hover)) !important;
  border-color: rgb(var(--ds-accent-hover)) !important;
}

body.auth-nocturne a:not(.btn):not(.dropdown-item) {
  color: rgb(var(--ds-fg-brand));
}

body.auth-nocturne .dropdown-menu {
  background: rgb(var(--ds-surface-raised)) !important;
  border: 1px solid rgb(var(--ds-border)) !important;
  color: rgb(var(--ds-fg));
}

body.auth-nocturne .dropdown-item {
  color: rgb(var(--ds-fg)) !important;
}

body.auth-nocturne .dropdown-item:hover,
body.auth-nocturne .dropdown-item:focus {
  background: rgb(var(--ds-surface-sunken)) !important;
}

body.auth-nocturne .dropdown-item.bg-primary {
  background: rgb(var(--ds-accent)) !important;
  color: rgb(var(--ds-accent-fg)) !important;
}

body.auth-nocturne .alert-danger {
  background: rgb(var(--ds-danger-50) / 0.25);
  border-color: rgb(var(--ds-danger-500) / 0.4);
  color: rgb(var(--ds-danger-700));
}

html.dark body.auth-nocturne .alert-danger {
  color: rgb(229 231 235);
}

/* Theme toggle (compact) — opposite corner from language switcher */
.auth-theme-toggle {
  position: fixed;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--ds-border));
  background: rgb(var(--ds-surface));
  color: rgb(var(--ds-fg));
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--ds-shadow-sm);
  cursor: pointer;
}

.auth-theme-toggle:hover {
  background: rgb(var(--ds-surface-raised));
}

/* Logo visibility on dark */
html.dark body.auth-nocturne .logo-img,
html.dark body.auth-nocturne img.logo {
  filter: none;
}
