@font-face {
  font-family: "Chivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/chivo-variable-latin.woff2') format('woff2');
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/source-sans-3-variable-latin.woff2') format('woff2');
}

body.login {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

body.login #login {
  box-sizing: border-box;
  width: 100%;
  max-width: 384px;
  padding: var(--s7) var(--s4) var(--s5);
  margin: 0 auto;
  overflow-wrap: anywhere;
}

body.login h1 a {
  position: relative;
  width: 132px;
  max-width: 100%;
  height: 40px;
  margin: 0 auto var(--s5);
  padding: 0;
  background-image: none;
  /* Keep the site's link name in the accessibility tree. */
  text-indent: -9999px;
  overflow: hidden;
  white-space: nowrap;
}

/* Mask the pseudo-element so the link's focus outline is never clipped by a mask. */
body.login h1 a::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--ink);
  -webkit-mask-image: url('../img/logo-horizontal.svg');
  mask-image: url('../img/logo-horizontal.svg');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* iThemes also emits itsec-* forms and an unnamed confirmation form here. */
body.login #login > form,
body.login :is(#loginform, #lostpasswordform, #resetpassform, #registerform) {
  margin: var(--s5) 0 0;
  padding: var(--s5);
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: none;
  overflow: visible;
}

body.login label {
  color: var(--ink);
  font-weight: 600;
}

body.login :is(.description, .indicator-hint, .pw-weak, .forgetmenot, #reg_passmail) {
  color: var(--text);
}

body.login :is(input.input, input[type="text"], input[type="email"], input[type="password"], select) {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: var(--s2) var(--s3);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--field-line);
  border-radius: var(--r-ctl);
  box-shadow: none;
  font: inherit;
}

body.login .wp-pwd input {
  padding-right: var(--s7);
}

body.login #login .itsec-login-interstitial-confirm-async-action,
body.login :is(#wp-submit, .button-primary) {
  min-height: 44px;
  max-width: 100%;
  padding: var(--s2) var(--s4);
  background: var(--accent);
  border-color: var(--accent);
  border-radius: var(--r-ctl);
  color: var(--accent-contrast);
  box-shadow: none;
  text-shadow: none;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
}

body.login #login .itsec-login-interstitial-confirm-async-action:is(:hover, :active, :focus),
body.login :is(#wp-submit, .button-primary):is(:hover, :active) {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--accent-contrast);
}

body.login #login .itsec-login-interstitial-confirm-async-action--deny,
body.login #login .itsec-login-interstitial-confirm-async-action--deny:is(:hover, :active, :focus) {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--accent-contrast);
}

body.login #login .itsec-login-interstitial-confirm-async-action--deny:hover {
  text-decoration: underline;
}

body.login #login form[id^="itsec-"] :where(.button:not(.button-primary), .button-link, .itsec-provider__configure),
body.login #login :is(.wp-hide-pw, .wp-tooltip__toggle, .button-secondary),
body.login .language-switcher .button {
  box-sizing: border-box;
  min-width: 24px;
  min-height: 24px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--field-line);
  border-radius: var(--r-ctl);
  box-shadow: none;
  font-family: inherit;
}

body.login #login .wp-hide-pw {
  width: 44px;
  height: 44px;
}

body.login #login form[id^="itsec-"] :where(.button:not(.button-primary), .button-link, .itsec-provider__configure):is(:hover, :active),
body.login #login :is(.wp-hide-pw, .wp-tooltip__toggle, .button-secondary):is(:hover, :active),
body.login .language-switcher .button:is(:hover, :active) {
  color: var(--accent-ink);
}

body.login input[type="checkbox"] {
  width: 24px;
  height: 24px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--field-line);
  border-radius: var(--r-ctl);
  box-shadow: none;
  accent-color: var(--accent);
}

/* Replace core's fixed-color checkmark image using the existing pseudo-element. */
body.login input[type="checkbox"]:checked::before {
  content: "";
  box-sizing: border-box;
  width: 8px;
  height: 14px;
  margin: 1px 0 0 7px;
  border: solid var(--accent);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

body.login form .forgetmenot {
  float: none;
  margin-bottom: var(--s4);
}

body.login .submit {
  display: flow-root;
}

body.login a,
body.login a:focus,
body.login :is(#nav, #backtoblog, .privacy-policy-page-link) a,
body.login :is(#nav, #backtoblog, .privacy-policy-page-link) a:focus {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

body.login a:is(:hover, :active),
body.login :is(#nav, #backtoblog, .privacy-policy-page-link) a:is(:hover, :active) {
  color: var(--accent-ink);
}

body.login :is(#nav, #backtoblog, .privacy-policy-page-link) {
  padding: 0;
  margin: var(--s5) 0 0;
}

/* Core sets these links to 13px by ID; keep body size and a 24px target (SC 2.5.8). */
body.login #login form[id^="itsec-"] a,
body.login :is(#nav, #backtoblog) a {
  display: inline-block;
  min-height: 24px;
  font-size: 16px;
}

body.login #login .itsec-notice,
body.login #itsec-2fa-on-board noscript,
body.login #itsec-2fa > div:first-child[style],
body.login :is(#login_error, .message, .notice, .success, #pass-strength-result, .wp-tooltip__content) {
  box-sizing: border-box;
  max-width: 100%;
  padding: var(--s3) var(--s4);
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-ctl);
  box-shadow: none;
}

body.login #login .itsec-notice-error,
body.login #itsec-2fa-on-board noscript,
body.login :is(#login_error, #login-error, .notice-error, #pass-strength-result.short, #pass-strength-result.bad, #caps-warning) {
  background: var(--danger-wash);
  color: var(--text);
  border-left: 4px solid var(--danger);
}

/* The plugin prints these colors in style attributes; override only those colors. */
body.login #login #login-error,
body.login #itsec-2fa > div:first-child[style] {
  background: var(--danger-wash) !important;
  color: var(--text);
  border-left-color: var(--danger) !important;
}

/* Override the plugin's 28px fixed height and zero line-height on confirmation buttons. */
body.login #login .itsec-login-interstitial-confirm-async-action {
  height: auto;
}

body.login #login form[id^="itsec-"] button {
  min-width: 24px;
  min-height: 44px;
  height: auto;
  max-width: 100%;
  white-space: normal;
}

body.login #itsec-2fa-on-board .itsec-provider__status,
body.login #itsec-2fa-on-board .itsec-totp__secret {
  background: var(--bg);
  color: var(--text);
}

body.login #itsec-2fa-on-board .itsec-backup-codes__code-list li {
  color: var(--text);
}

body.login .language-switcher {
  box-sizing: border-box;
  max-width: 100%;
  padding: 0 var(--s4) var(--s5);
}

body.login .language-switcher form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--s2);
}

/* Higher specificity than core's ID-based focus styles, including password toggles. */
body.login :is(#login, .language-switcher, .privacy-policy-page-link) :focus-visible,
body.login :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
}
