/* Namespaced styles to avoid bleeding into the rest of the app */
.refex-login {
  --refex-bg: #0f172a;            /* tumma siniharmaa */
  --refex-card: #ffffff;
  --refex-text: #0b132b;          /* tumma teksti */
  --refex-muted: #475569;         /* sekundääriteksti */
  --refex-primary: #0f766e;       /* sinivihreä (logo) */
  --refex-primary-contrast: #ffffff;
  --refex-border: #e5e7eb;
  color: var(--refex-text);
}

.refex-login__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.refex-login .card-body {
  background: var(--refex-card);
}

.refex-login h2 {
  margin: 0 0 1rem;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--refex-text);
  text-align: center;
}
/* Login-sivun footer-linkit */
.login-form + .login-links a {
  display: block;
  text-align: center;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--refex-primary);
  text-decoration: none;
  font-weight: 500;
}

.login-form + .login-links a:hover {
  text-decoration: underline;
  color: var(--refex-primary-600);
}

.login-form + .login-links {
  margin-top: 1.2rem;
}

/* Focus-rengas (saavutettavuus) */
.login-links a:focus-visible {
  outline: 3px solid var(--refex-focus);
  outline-offset: 3px;
  border-radius: 4px;
}


.refex-login .form-label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.refex-login .form-hint {
  display: block;
  font-size: 0.875rem;
  color: var(--refex-muted);
  margin-top: 0.25rem;
}

.refex-login .form-control {
  min-height: 44px;                 /* saavutettava kosketusetäisyys */
  border-radius: 8px;
  border: 1px solid var(--refex-border);
  box-shadow: none;
}

.refex-login .form-control:focus {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px rgba(15,118,110,.35);
  border-color: var(--refex-primary);
}

.refex-login .btn.btn-primary {
  min-height: 44px;
  border-radius: 10px;
  font-weight: 700;
  background-color: var(--refex-primary);
  border-color: var(--refex-primary);
  color: var(--refex-primary-contrast);
}

.refex-login .btn.btn-primary:hover { filter: brightness(0.95); }

.refex-login .form-errors {
  background: #fef2f2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: .75rem 1rem;
  margin: .75rem 0 1rem;
}

.refex-login .login-links a {
  color: var(--refex-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.refex-login .actions { margin-top: 1rem; }

/* Responsiivisuus */
@media (max-width: 575.98px) {
  .card.card-signin.my-5 { margin: 1rem 0 !important; }
  .refex-login h2 { font-size: 1.375rem; }
}

/* ----------------------------------------------------
   Password hints and guidance
   ---------------------------------------------------- */
.password-hints {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.password-hints p.form-hint {
  font-weight: 600;
  color: var(--refex-text);
  margin-bottom: 0.25rem;
}

.password-hints ul {
  margin-top: 0.25rem;
  margin-left: 1.25rem;
  padding-left: 0;
  list-style-type: disc;
  color: var(--refex-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.password-hints li {
  margin-bottom: 0.25rem;
}

/* Better spacing on very small screens */
@media (max-width: 575.98px) {
  .password-hints ul {
    margin-left: 1rem;
    font-size: 0.875rem;
  }
}

/* ----------------------------------------------------
   MFA form and QR display
   ---------------------------------------------------- */
.mfa-qr {
  margin-top: 1.25rem;
}

.mfa-qr__image {
  display: inline-block;
  margin-top: 0.75rem;
  max-width: 180px;
  height: auto;
  border: 1px solid var(--refex-border);
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}

.refex-login input[pattern="[0-9]*"] {
  font-family: monospace;
  font-size: 1.25rem;
  letter-spacing: 0.25rem;
  text-align: center;
}
