/* ─────────────────────────────────────────────────────────
   Wave animated background
───────────────────────────────────────────────────────── */

html,
body {
  background: var(--color-primary-strong);
  overflow: hidden;
}

html.mfa-enrollment-scroll,
body.mfa-enrollment-scroll {
  overflow-y: auto;
}

.wave,
.wave::before,
.wave::after {
  z-index: 1;
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250vw;
  height: 250vw;
  margin-left: -125vw;
  transform-origin: 50% 50%;
  background-color: transparent;
  border-radius: 38% 42%;
  box-shadow: inset 0 0 10vw rgba(42, 45, 100, 0.85);
  animation: spin 41s infinite linear;
  mix-blend-mode: screen;
}

.wave::before {
  content: '';
  position: absolute;
  width: 105%;
  height: 95%;
  top: 0;
  left: 0;
  margin-top: -125vw;
  transform-origin: 49% 51%;
  border-radius: 40% 38%;
  box-shadow: inset 0 0 10vw rgba(61, 79, 138, 0.85);
  animation: spin 38s infinite linear;
}

.wave::after {
  content: '';
  position: absolute;
  width: 102%;
  height: 98%;
  top: 0;
  left: 0;
  margin-top: -125vw;
  transform-origin: 51% 49%;
  border-radius: 48% 42%;
  box-shadow: inset 0 0 10vw rgba(106, 134, 194, 0.85);
  animation: spin 25s infinite linear;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────
   Login page layout
───────────────────────────────────────────────────────── */

.login-page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

body.mfa-enrollment-scroll .login-page {
  align-items: flex-start;
  padding-top: 20px;
  padding-bottom: 20px;
}

.login-card {
  width: min(560px, calc(100vw - 56px));
  width: min(560px, calc(100dvw - 56px));
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  padding: 36px 34px 28px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ─────────────────────────────────────────────────────────
   Logo
───────────────────────────────────────────────────────── */

.login-logo {
  width: 160px;
  max-width: 75%;
  height: auto;
  object-fit: contain;
  margin-bottom: 22px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.36)) brightness(1.08);
}

/* ─────────────────────────────────────────────────────────
   Header
───────────────────────────────────────────────────────── */

.login-panel-header {
  width: 100%;
  margin-bottom: 16px;
}

.login-panel-header h2 {
  margin: 0;
  font-size: 1.45rem;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────
   Form fields — override basestyles for dark card surface
───────────────────────────────────────────────────────── */

.login-card .label {
  color: rgba(255, 255, 255, 0.82);
}

.login-card .input {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.login-card .input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.login-card .input:focus {
  outline: 2px solid var(--color-tertiary);
  border-color: var(--color-tertiary);
  background: rgba(255, 255, 255, 0.18);
}

.login-form {
  width: 100%;
}

.login-password-label {
  margin-top: 14px;
  display: block;
}

.mfa-stage {
  margin-top: 8px;
}

.mfa-title {
  color: #ffffff;
  font-weight: 700;
  margin: 8px 0 4px;
}

.mfa-help {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.mfa-recovery-toggle {
  margin-top: 10px;
  width: 100%;
}

.mfa-trust-option {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
}

.mfa-trust-option input {
  width: 16px;
  height: 16px;
}

.mfa-enroll-stage {
  margin-top: 6px;
}

.mfa-enroll-layout {
  display: grid;
  gap: 14px;
}

.mfa-enroll-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.mfa-enroll-qr {
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
}

.mfa-enroll-qr-caption,
.mfa-enroll-uri {
  text-align: center;
  word-break: break-word;
}

.mfa-enroll-details {
  display: grid;
  gap: 10px;
}

.mfa-enroll-steps {
  margin: 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.86);
}

.mfa-enroll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mfa-manual-setup {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

/* ─────────────────────────────────────────────────────────
   Actions row
───────────────────────────────────────────────────────── */

.login-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-submit {
  min-width: 112px;
  background: var(--color-secondary);
  color: #ffffff;
}

.login-submit:hover {
  background: var(--color-primary);
}

.login-forgot {
  color: rgba(255, 255, 255, 0.70);
  text-decoration: none;
  font-size: 0.9rem;
}

.login-forgot:hover {
  color: #ffffff;
}

.login-forgot[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────────
   Success message (e.g. after password reset)
───────────────────────────────────────────────────────── */

#login-success {
  display: none;
  text-align: center;
  margin-top: 14px;
  margin-bottom: 8px;
  color: #6dffc4;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────
   Error
───────────────────────────────────────────────────────── */

.login-card .error {
  color: #ffb4b4;
  margin-top: 10px;
}

/* ─────────────────────────────────────────────────────────
   Tagline
───────────────────────────────────────────────────────── */

.login-tagline {
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px 22px;
  }
}

