/* Diamond ERP — Auth: full image + centered glass form */

.dm-auth-page {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  font-family: var(--dm-font, 'Inter', system-ui, sans-serif);
}

/* ─── Background image (sharp, fully visible) ─── */
.dm-auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.dm-auth-bg__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition:
    filter 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Top utilities ─── */
.dm-auth-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  pointer-events: none;
}

.dm-auth-topbar .dm-theme-toggle {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
}

/* ─── Glass form card ─── */
@keyframes dm-auth-enter {
  from {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dm-auth-glass {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 23rem;
  padding: clamp(2rem, 5vw, 2.75rem) clamp(1.75rem, 4vw, 2.25rem);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 1.25rem 2.5rem rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  color: #fff;
  transform: translateZ(0);
  animation: dm-auth-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition:
    opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.dm-auth-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 42%);
}

.dm-auth-glass__logo {
  display: block;
  height: clamp(2rem, 5vw, 2.75rem);
  width: auto;
  margin: 0 auto 1.25rem;
}

.dm-auth-glass__title {
  position: relative;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.28);
}

.dm-auth-glass__subtitle {
  position: relative;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 1.5rem;
  line-height: 1.45;
}

/* Underlined fields with icons */
.dm-auth-glass .form-group,
.dm-auth-glass .dm-field {
  margin-bottom: 0;
}

.dm-auth-glass label {
  display: none;
}

.dm-auth-field {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  margin-bottom: 1.375rem;
  transition: border-color 0.2s ease;
}

.dm-auth-field:focus-within {
  border-bottom-color: #fff;
  box-shadow: 0 4px 12px -6px rgba(255, 255, 255, 0.45);
}

.dm-auth-field__icon {
  flex-shrink: 0;
  width: 1.125rem;
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
}

.dm-auth-field .form-control,
.dm-auth-field .dm-input {
  flex: 1;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.75rem 0;
  min-height: auto;
  font-size: 0.875rem;
  color: #fff;
  border-radius: 0;
}

.dm-auth-field .form-control::placeholder,
.dm-auth-field .dm-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.dm-auth-field .form-control:focus,
.dm-auth-field .dm-input:focus {
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.dm-auth-field .dm-date-field .form-control:focus {
  color: #fff;
}

.dm-auth-field .input-group {
  flex: 1;
  flex-wrap: nowrap;
}

.dm-auth-field .input-group .form-control {
  border-radius: 0;
}

.dm-auth-field .input-group-append .input-group-text {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  padding-right: 0;
  cursor: pointer;
}

.dm-auth-glass .form-text {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.65);
  margin: -0.75rem 0 1rem;
}

/* Ghost button */
.dm-auth-glass .btn-primary,
.dm-auth-glass .btn-auth {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6875rem 1rem;
  min-height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 0.375rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.dm-auth-glass .btn-primary:hover,
.dm-auth-glass .btn-auth:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #1e2d6e;
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.dm-auth-glass .btn-primary:active,
.dm-auth-glass .btn-auth:active {
  transform: translateY(0);
}

.dm-auth-glass .btn-secondary {
  width: 100%;
  margin-top: 0.625rem;
  padding: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 0.25rem;
}

.dm-auth-glass .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dm-auth-glass__links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.25rem 0 1.25rem;
  font-size: 0.75rem;
}

.dm-auth-glass__links a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-weight: 500;
}

.dm-auth-glass__links a:hover {
  color: #fff;
  text-decoration: underline;
}

.dm-auth-glass__footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
}

.dm-auth-glass__footer a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.dm-auth-glass__footer a:hover {
  text-decoration: underline;
}

.dm-auth-page #messages {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.dm-auth-page .dm-toast-stack {
  top: 1rem;
}

/* Dark theme — glass stays light-on-image */
[data-theme="dark"] .dm-auth-glass {
  background: rgba(12, 16, 28, 0.42);
  border-color: rgba(255, 255, 255, 0.22);
}

@media (max-width: 480px) {
  .dm-auth-glass {
    padding: 1.75rem 1.375rem;
  }

  .dm-auth-glass__links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dm-auth-glass {
    animation: none;
  }

  .dm-auth-field,
  .dm-auth-glass .btn-primary,
  .dm-auth-glass .btn-auth {
    transition: none;
  }
}
