:root {
  --bg: #1e1e1d;
  --card-bg: rgba(40,40,40,0.85);
  --accent: #f1c40f;
  --input-bg: #2c2c2c;
  --input-border: #343434;
  --error-bg: #e43b2f;
}

* {
  box-sizing: border-box;
  /*margin: 0;*/
  /*padding: 0;*/
}

html, body {
  height: 100%;
  background-color: #1e1e1daa;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  font-style: normal;
  /* allow scrolling on mobile */
  overflow-y: auto;
}


.bg-svg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/2149360640.jpg') center center / cover no-repeat;
  opacity: 0.15;
  filter: grayscale(100%);
  z-index: -1;
}

/* Centered card container */
.login-container {
  position: relative;
  width: 90%;
  max-width: 380px;
  margin: auto;
  top: 50%;
  transform: translateY(-60%);
  background: var(--card-bg);
  border: 1px solid #424242;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  animation: slideFadeIn 0.5s ease-out forwards;
}

@keyframes slideFadeIn {
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

/* Logo */
.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-logo img {
  max-width: 180px;
  height: auto;
}

/* Form fields */
.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  /*color: var(--accent);*/
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 0.5rem;
  color: #fff;
  font-size: 1rem;
  transition: background 0.2s, border-color 0.2s;
}
.field input::placeholder {
  color: #777;
}
.field input:focus {
  background: #323232;
  border-color: var(--accent);
  outline: none;
}

/* Password toggle */
.password-field .input-icon-wrapper {
  position: relative;
}
.toggle-visibility {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.1rem;
}

/* Remember me */
.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.remember-me label {
  font-size: 0.9rem;
  color: #ccc;
}

/* Error messages */
.error {
  position: relative;
  background: var(--error-bg);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.error button {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

/* Actions (links + button) */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.actions a {
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}
.actions a:hover {
  color: #e0ac08;
}

/* Submit button */
.btn-submit {
  background: var(--accent);
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.2s;
}
.btn-submit:hover {
  background: #e0ac08;
  transform: scale(1.03);
}
.spinner {
  font-size: 1.1em;
}

/* Adjust font + spacing on very small devices */
@media (max-width: 360px) {
  .login-container {
    padding: 1rem;
    border-radius: 0.75rem;
  }
  .field label {
    font-size: 0.85rem;
  }
  .btn-submit {
    padding: 0.65rem 1.2rem;
  }
}

/* --- Harmonize MFA with dark card --- */
.mfa-panel {
  margin-top: 1rem;
  padding: 1rem;

  color: #fff;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}
.mfa-panel.is-active { opacity: 1; transform: translateY(0); }

/* Inputs inherit your dark field styles; only tweak OTP look */
#mfa-code {
  font-size: 1.25rem;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 0.85rem 1rem;
}

/* Subtle helper text in your palette */
.mfa-panel .hint,
.mfa-panel .muted { color: #cbd5e1; }

/* Buttons aligned to theme */
.mfa-panel .btn-secondary {
  background: transparent;
  color: #e5e7eb;
  border: 1px solid #4b4b4b;
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
}
.mfa-panel .btn-secondary:hover { border-color: #6b6b6b; }

.mfa-panel .btn-link {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}

/* Dark-mode error inside MFA (don’t let the light block override it) */
.mfa-panel .error {
  background: #3b1f1d;
  border-left: 4px solid #ef4444;
  color: #fff;
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
}

/* Logo text weight/spacing to match the card */
.brand-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* === Buttons: Back & Resend (dark theme, accessible) === */

/* Back = secondary button */
.btn-secondary {
  --btn-bg: transparent;
  --btn-fg: #e5e7eb;
  --btn-bd: #4b4b4b;

  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.04);
  border-color: #6b6b6b;
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-secondary:disabled,
.btn-secondary.disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* Focus ring (keyboard) */
.btn-secondary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(241,196,15,0.35); /* accent glow */
  border-color: var(--accent);
}

/* Optional small variant */
.btn-secondary.btn-sm {
  padding: 0.45rem 0.7rem;
  border-radius: 0.45rem;
  font-size: .9rem;
}


/* Resend = link-style button with accent */
.btn-link {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0.25rem 0.25rem;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  border-radius: 0.25rem;
  transition: color .15s ease, text-decoration-color .15s ease;
  text-decoration: underline;
  text-decoration-color: transparent; /* no layout shift on hover */
}

.btn-link:hover {
  text-decoration-color: currentColor;
}

.btn-link:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(241,196,15,0.35);
}

.btn-link:disabled,
.btn-link.disabled {
  color: #8f8f8f;
  text-decoration-color: transparent;
  cursor: not-allowed;
}

/* Place inside MFA card without crowding */
.mfa-panel .actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Optional: icon sizing if you add an arrow/back icon */
.btn-secondary .icon,
.btn-link .icon {
  width: 1em;
  height: 1em;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn-secondary,
  .btn-link { transition: none; }
}

/* Enrolment panel matches dark card */
.enroll-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--card-bg);
  border: 1px solid #424242;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  color: #fff;
}

.enroll-step { margin-top: .25rem; }
.enroll-title { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 600; }
.enroll-subtitle { margin: 0 0 1rem; color: #cbd5e1; font-size: .95rem; }

.enroll-methods { display: grid; gap: .5rem; margin-top: .5rem; }
.btn-block { width: 100%; justify-content: center; }

.qr-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #222; border: 1px solid #3a3a3a; border-radius: .5rem;
  padding: 12px; margin-bottom: .75rem;
}
.qr-wrap img { max-width: 220px; height: auto; display: block; }

.backup-codes {
  background: #101010; border: 1px dashed #3a3a3a; color: #e5e7eb;
  padding: .75rem; border-radius: .5rem; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .95rem; line-height: 1.3;
}

.mt-12 { margin-top: 12px; }

.chooser-grid { display:grid; gap:.5rem; margin:.5rem 0 0 0; }
