/* =============================================
AMFE - LOGIN PAGE (FIXED)
============================================= */

/* ── GLOBAL FIX ── */
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100%;
  background: #f5f7f6; /* optional: soft background */
}

/* ❌ REMOVE padding-top (important fix) */
/* body { padding-top: 90px; } */

/* ── LOGIN WRAPPER ── */
.login-wrapper {
  min-height: calc(100dvh - 5rem);
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  padding: clamp(1.25rem, 4vh, 2.5rem) var(--page-gutter);
  box-sizing: border-box;
}

.login-wrapper > div {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ── LOGIN CARD ── */
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: clamp(2rem, 4vw, 2.75rem) clamp(1.5rem, 4vw, 2.5rem);
  width: 100%;
  max-width: 650px;
  margin-inline: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
}

/* ── LOGO ── */
.login-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
}

/* ── TITLE ── */
.login-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
}

/* ── SUBTITLE ── */
.login-card .sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── FORM ── */
.form-control {
  border-radius: 10px;
}

/* ── PASSWORD FIELD ── */
.input-eye-wrap {
  position: relative;
}

.eye-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #000;
  line-height: 0;
}

.eye-btn:hover,
.eye-btn:focus-visible {
  color: #000;
}

/* ── reCAPTCHA ── */
.recaptcha-full {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.recaptcha-full > div {
  flex: 0 0 304px;
}

/* ── BUTTON ── */
.btn-signin {
  width: 100%;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  transition: 0.2s ease;
  cursor: pointer;
}

.btn-signin:hover {
  background: var(--green-mid);
}

/* ── FORGOT PASSWORD LINK ── */
.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.forgot-link {
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.forgot-password-help {
  text-align: justify;
  text-justify: inter-word;
}

/* ── LINKS ── */
.join-link {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
}

.join-link a {
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: none;
}

.join-link a:hover {
  text-decoration: underline;
}

.reset-code-timer {
  margin-top: .45rem;
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 700;
}

.reset-code-timer.is-expired {
  color: #b42318;
}

.reset-email-change {
  display: inline-block;
  margin-top: .4rem;
  color: var(--green-dark);
  font-size: .8rem;
  font-weight: 700;
  text-underline-offset: 2px;
}

.reset-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .9rem;
  color: var(--text-muted);
  font-size: 13px;
}

.reset-resend-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.reset-resend-button:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.reset-resend-button:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Used on both a plain <a> (Back to Home/Login) and a <button> that runs a
   client action (TwoFactorChallenge's mode switch, both pages' logout) — the
   reset properties below only matter for the <button> case, since an <a> has
   no border/background/font chrome to begin with. Without them the button
   kept Chrome's default outset border and system font, showing as a boxed
   control instead of the plain link text every other use of this class is. */
.back-home-inside {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  /* Underlined and brand-colored by default, not just on hover: a "Cancel
     and start over" that reads as plain instructional text instead of a
     control is easy to miss until it's too late — it discards the pending
     sign-in. An underline-on-hover-only treatment relied on the leading
     arrow ("← Back to Home") every other use of this class has, which
     TwoFactorChallenge's and ChangePassword's buttons don't. */
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.back-home-inside:hover {
  color: var(--green-mid);
}

.back-home-inside:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── TABLET ── */
@media (max-width: 768px) {
  .login-wrapper {
    min-height: calc(100svh - 4.75rem);
  }

  .login-card {
    width: 100%;
    max-width: 520px;
    padding: 2rem 1.5rem;
  }
}

/* ── MOBILE ── */
@media (max-width: 480px) {
  .login-wrapper {
    padding: clamp(1rem, 3vh, 1.5rem) 0;
  }

  .login-card {
    padding: 1.75rem 1.125rem;
    border-radius: 14px;
  }

  .login-card h2 {
    font-size: 1.5rem;
  }

  .login-logo {
    width: 60px;
    height: 60px;
  }

  .btn-signin {
    font-size: 14px;
  }

  /* The widget is a fixed 304px iframe; scale it down so it stops
     pushing past the card on narrow phones. */
  .join-link,
  .back-home-inside {
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .recaptcha-full {
    width: 267.5px;
    height: 68.7px;
    max-width: 100%;
    margin-inline: auto;
    justify-content: flex-start;
  }
  .recaptcha-full > div {
    width: 304px;
    height: 78px;
    flex-basis: 304px;
    transform: scale(.88);
    transform-origin: top left;
  }
}

@media (max-width: 339.98px) {
  .recaptcha-full {
    width: 249.3px;
    height: 64px;
  }

  .recaptcha-full > div {
    transform: scale(.82);
  }
}

@media (max-width: 767.98px) {
  .login-card { padding: 1.75rem 1.25rem; }
  .login-card .form-control,
  .login-card .btn-signin { min-height: 2.75rem; font-size: 1rem; }
}

/* Short phones and landscape devices need scrolling from the top instead of
   centering a card taller than the available viewport. */
@media (max-height: 720px) {
  .login-wrapper {
    align-items: flex-start;
    padding-block: 1rem;
  }

  .login-card {
    padding-block: 1.5rem;
  }

  .login-logo {
    width: 52px;
    height: 52px;
    margin-bottom: 6px;
  }

  .login-card .sub {
    margin-bottom: 1.25rem;
  }
}
