/* banjo.vet login page -- black background with the dog on the left.
 *
 * Served by caddy-security at /auth/assets/css/custom.css and loaded AFTER
 * basic.css, so these rules win. The dog image is registered as a static_asset
 * at assets/images/dog.png (browser URL /auth/assets/images/dog.png); until that
 * file is in place the panel is simply empty -- the black background still works.
 */

:root {
  --brand-page: #000000;
  /* drop the stock decorative background; the dog is drawn separately below */
  --brand-page-image: none;
}

body.basic-theme {
  background-color: #000000;
  background-image: none;
}

/* The dog: a fixed panel pinned to the left, behind the login card. */
body.basic-theme::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;          /* top:0 right:auto bottom:0 left:0 */
  width: 46vw;
  background-image: url("../images/dog.png");
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}

/* Keep the login card above the dog and readable. */
.basic-theme .app-content { position: relative; z-index: 1; }

/* Wide screens: shift the card into the right half so it never covers the dog. */
@media (min-width: 900px) {
  .basic-theme .app-content { margin-left: auto; margin-right: 8vw; }
}

/* Narrow screens: no room beside the form -- fade the dog to a faint backdrop. */
@media (max-width: 899px) {
  body.basic-theme::before {
    width: 100vw;
    opacity: 0.15;
    background-position: center bottom;
  }
}

/* Portal logo = the "SINCE 2019" dog badge (set via `logo url` in the ui block,
 * served at /auth/assets/images/logo.jpg). Bumped up a bit and rounded so the
 * square badge reads as a medallion inside the card. */
.basic-theme .logo-img {
  width: 132px;
  height: 132px;
  border-radius: 50%;
}

/* --- Two-factor method selection (the "mfa_mixed_auth" screen) -------------
 * Shown when BOTH a security key and an authenticator app are enrolled. The
 * plugin renders a plain two-item list (authenticator app first, security key
 * second). We make the SECURITY KEY the big primary button shown first, and
 * demote the authenticator app to a small "use the app instead" link beneath
 * it -- so a fingerprint/Hello tap is the default and the app is the fallback.
 *
 * Pure CSS over the existing DOM (no template edit). The choices have no ids,
 * so we target them by the link's action suffix:
 *   security key  -> a[href$="mfa-u2f-auth"]  (icon i.la-microchip)
 *   authenticator -> a[href$="mfa-app-auth"]  (icon i.la-mobile)
 * Every rule is scoped to the list that actually contains the security-key
 * link, so the portal's own app list (also a ul[role=list]) is untouched.
 * :has() is required and is supported by current Chrome/Edge/Safari/Firefox.
 */
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 0;
}
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li { border: 0; margin: 0; }

/* Security key -> prominent primary button, ordered first, whole row clickable */
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-u2f-auth"]) {
  order: 0;
  position: relative;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #324960;
  cursor: pointer;
}
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-u2f-auth"]) i {
  color: #fff;
  font-size: 1.6rem;
  margin: 0;
}
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-u2f-auth"]) > div {
  margin: 0;
}
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-u2f-auth"]) a {
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}
/* stretch the link over the whole row so the padding is clickable too */
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-u2f-auth"]) a::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Authenticator app -> small secondary link, ordered below */
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-app-auth"]) {
  order: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 0 0;
  opacity: 0.75;
}
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-app-auth"]) i {
  font-size: 0.95rem;
}
.basic-theme ul[role="list"]:has(a[href$="mfa-u2f-auth"]) > li:has(a[href$="mfa-app-auth"]) a {
  font-size: 0.82rem;
  /* Read as plain secondary text, not a blue hyperlink -- it still works when
   * tapped, it just should not look like a link. */
  text-decoration: none;
  color: inherit;
}
