/*
 * The login pages' own layer, after bridge.css: the page and the card, the logo and the title, the
 * larger sizes of the apps' login screens, and the Phonero-only pieces (BankID, the illustration,
 * choice cards, the footer). scripts/generate-theme-css.mjs copies it into the login theme as
 * css/phonero.css; edit it here. A brand theme changes the look through brand.css and its own
 * img/ files, never by overriding these.
 */

/* The apps' login screens are larger than a console: 17px body text, and Figma's Button at lg, 48px
   with an 18px label. The sizes are PatternFly's globals, which bridge.css's components read, raised
   for this page only. */
.pf-v5-c-login {
  --pf-v5-global--FontSize--sm: var(--phonero-font-size-sm);
  --pf-v5-global--FontSize--md: var(--phonero-font-size-md);
  --pf-v5-global--FontSize--lg: var(--phonero-font-size-lg);
  --pf-v5-global--LineHeight--md: var(--phonero-line-height-md);
  --pf-v5-c-login__container--MaxWidth: 32rem;
  --pf-v5-c-login__container--PaddingLeft: var(--phonero-spacing-lg);
  --pf-v5-c-login__container--PaddingRight: var(--phonero-spacing-lg);
  --pf-v5-c-login__main--BackgroundColor: transparent;
  --pf-v5-c-login__main--BoxShadow: none;
  --pf-v5-c-login__main-header--PaddingTop: var(--phonero-spacing-xl);
  --pf-v5-c-login__main-header--PaddingRight: 0;
  --pf-v5-c-login__main-header--PaddingLeft: 0;
  --pf-v5-c-login__main-header--md--PaddingRight: 0;
  --pf-v5-c-login__main-header--md--PaddingLeft: 0;
  --pf-v5-c-login__main-body--PaddingRight: 0;
  --pf-v5-c-login__main-body--PaddingLeft: 0;
  --pf-v5-c-login__main-body--md--PaddingRight: 0;
  --pf-v5-c-login__main-body--md--PaddingLeft: 0;
  --pf-v5-c-login__main-footer-band--BorderTopColor: var(--phonero-border-default);
}

.pf-v5-c-login .pf-v5-c-button:not(.pf-m-link, .pf-m-plain, .pf-m-control) {
  --pf-v5-c-button--FontSize: 1.125rem;
  --pf-v5-c-button--PaddingTop: var(--phonero-spacing-md);
  --pf-v5-c-button--PaddingBottom: var(--phonero-spacing-md);
}

/*
 * Depth. On a phone the page is the apps' main surface, edge to edge. From the apps' xs breakpoint
 * the page drops to PatternFly's 200 level (Figma's elevated tint in light, the canvas in dark)
 * and the form sits on the surface as a card, the way the apps lay a Paper on the shell.
 */
.login-pf body {
  background: var(--phonero-background-appshell-main);
  color: var(--phonero-text-default);
  font-family: var(--phonero-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 40em) {
  .login-pf body {
    background: var(--pf-v5-global--BackgroundColor--200);
  }

  .pf-v5-c-login {
    --pf-v5-c-login__main--BackgroundColor: var(--phonero-background-surface);
    --pf-v5-c-login__main--BoxShadow: var(--pf-v5-global--BoxShadow--lg);
    --pf-v5-c-login__main-header--PaddingRight: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-header--PaddingLeft: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-header--md--PaddingRight: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-header--md--PaddingLeft: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-body--PaddingRight: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-body--PaddingLeft: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-body--md--PaddingRight: var(--phonero-spacing-xxl);
    --pf-v5-c-login__main-body--md--PaddingLeft: var(--phonero-spacing-xxl);
  }

  /* The shadow sets the card off the page; no line around it. */
  .pf-v5-c-login__main {
    border-radius: var(--phonero-radius-lg);
    margin-bottom: var(--phonero-spacing-xxl);
  }
}

.pf-v5-c-login__container {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  /* PatternFly pads the container from its xl breakpoint only; a phone needs the gutter too. */
  padding-inline: var(--pf-v5-c-login__container--PaddingLeft) var(--pf-v5-c-login__container--PaddingRight);
}

.pf-v5-c-login__main-header {
  border-top: 0;
  display: flex;
  flex-direction: column;
  text-align: center;
}

/* The logo comes in as loginTitleHtml (messages) and is drawn here, swapped for dark. */
:root {
  --keycloak-logo-url: url("../img/logo-light.svg");
  --keycloak-logo-height: 2.5rem;
  --keycloak-logo-width: 12rem;
}

:root.pf-v5-theme-dark {
  --keycloak-logo-url: url("../img/logo-dark.svg");
}

#kc-header {
  padding-block: var(--phonero-spacing-xxl) var(--phonero-spacing-lg);
}

/*
 * A phone: the page is as tall as what it holds. PatternFly's 100vh is, on iOS, the screen with the
 * browser's bars collapsed - taller than an in-app browser shows - so every page scrolled into an
 * empty band under the footer. Without the card the body is the same surface, so nothing needs the
 * height. The logo starts near the top, as the apps' screens do.
 */
@media (max-width: 39.99em) {
  .pf-v5-c-login {
    --pf-v5-c-login__main-header--PaddingTop: var(--phonero-spacing-lg);
    min-height: 0;
    padding-block-start: 0;
  }

  #kc-header {
    padding-block: var(--phonero-spacing-xl) 0;
  }
}

/* "Log out other devices" right above a page's buttons (update-email), spaced as a field is. */
#kc-form-options + .pf-v5-c-form__group {
  margin-top: var(--phonero-spacing-lg);
}

/* The apps' login title: in Text/Primary, centred, wrapped evenly. */
#kc-page-title {
  color: var(--phonero-text-primary-default);
  font-size: var(--phonero-h2-font-size);
  font-weight: var(--phonero-h1-font-weight);
  line-height: var(--phonero-h2-line-height);
  text-wrap: pretty;
}

/* ---- The top bar (template.ftl): the apps' header ------------------------------------------- */

/*
 * Ditt Phonero's header: 80px on the surface with the small shadow, Phonero's logo at the start, the
 * brand's in the middle where the theme names one (phoneroBarBrand), the signed-out avatar at the end.
 * phoneroBar=desktop draws it from the apps' sm breakpoint (48em) up, where it carries the logo and
 * the menu; phoneroBar=always is Din Bedrift's (below). Below it a phone shows no language control:
 * the app sends its own language (kc_locale), and a choice here would not reach the app.
 */
.phonero-bar-desktop {
  --phonero-bar-height: 5rem;
}

.phonero-bar-always {
  --phonero-bar-height: 3.625rem;
}

.phonero-bar {
  position: relative;
  z-index: 1;
  display: none;
  align-items: center;
  gap: var(--phonero-spacing-md);
  height: var(--phonero-bar-height);
  padding-inline: var(--phonero-spacing-lg);
  background: var(--phonero-background-surface);
  box-shadow: var(--pf-v5-global--BoxShadow--sm);
  font-family: var(--phonero-font-family);
}

.phonero-bar > * {
  display: flex;
  flex: 1;
  align-items: center;
}

.phonero-bar__center {
  justify-content: center;
}

.phonero-bar__end {
  justify-content: flex-end;
}

.phonero-bar__phonero,
.phonero-bar__brand {
  display: block;
  height: 3rem;
  background: center / contain no-repeat;
}

.phonero-bar__phonero {
  width: 7.5rem;
  background-image: url("../img/phonero-light.svg");
}

:root.pf-v5-theme-dark .phonero-bar__phonero {
  background-image: url("../img/phonero-dark.svg");
}

.phonero-bar__brand {
  width: 12.5rem;
  background-image: var(--keycloak-logo-url);
}

@media (min-width: 48em) {
  .phonero-bar-desktop .phonero-bar {
    display: flex;
  }

  /* The bar carries the logo; the page's own would repeat it. */
  .phonero-bar-desktop #kc-header {
    display: none;
  }

  .phonero-bar-desktop .pf-v5-c-login__container {
    padding-top: var(--phonero-spacing-xxl);
  }

  /* PatternFly's page is a screen tall; under the bar it is a screen less the bar, or it scrolls. The
     card's own margin is the space under it, so the page adds none. */
  .phonero-bar-desktop .pf-v5-c-login {
    --pf-v5-c-login--PaddingBottom: 0;
    min-height: calc(100dvh - var(--phonero-bar-height));
  }
}

/* Din Bedrift's header: 58px on every screen, Phonero's logo in the middle; the page keeps the
   brand's logo, and the menu has the language, so the page needs no control of its own. */
.phonero-bar-always .phonero-bar {
  display: flex;
  padding-inline: var(--phonero-spacing-xs);
}

.phonero-bar-always .pf-v5-c-login {
  min-height: calc(100dvh - var(--phonero-bar-height));
}

.phonero-bar-always .phonero-bar__phonero {
  position: absolute;
  inset-inline-start: 50%;
  height: 1.75rem;
  translate: -50% 0;
}

.phonero-bar-always #kc-header {
  padding-top: var(--phonero-spacing-xl);
}

/* The signed-out avatar: the apps' light grey ActionIcon, 44px round, with Phonero's figure. */
.phonero-menu {
  position: relative;
}

.phonero-menu__avatar {
  display: grid;
  place-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--phonero-background-neutral-light);
  color: var(--phonero-text-neutral-default);
  cursor: pointer;
  list-style: none;
  transition: background-color 120ms;
}

.phonero-menu__avatar::-webkit-details-marker {
  display: none;
}

.phonero-menu__avatar:hover,
.phonero-menu[open] .phonero-menu__avatar {
  background: var(--phonero-background-neutral-light-hover);
}

.phonero-menu__avatar::before {
  content: "";
  width: 1.4375rem;
  height: 1.4375rem;
  background-color: currentcolor;
  mask: var(--phonero-icon-user) center / contain no-repeat;
}

.phonero-menu__avatar:focus-visible {
  outline: 2px solid var(--phonero-border-focus-focus);
  outline-offset: 2px;
}

/* The apps' user menu: 300px under the avatar's end, on the grey menu ground, with rows of 32px. */
.phonero-menu__dropdown {
  position: absolute;
  inset-block-start: calc(100% + var(--phonero-spacing-sm));
  inset-inline-end: 0;
  z-index: 10;
  display: grid;
  gap: 2px;
  width: 18.75rem;
  padding: var(--phonero-spacing-md);
  border: 1px solid var(--phonero-popover-color-popover-border);
  border-radius: var(--phonero-radius-sm);
  background: var(--phonero-gray-1);
  box-shadow: var(--pf-v5-global--BoxShadow--sm);
}

:root.pf-v5-theme-dark .phonero-menu__dropdown {
  background: var(--phonero-dark-7);
}

/* A row is the apps' unstyled select: a 16px icon in a 40px section, the value, Phonero's chevron. */
.phonero-menu__row {
  --phonero-row-hover: var(--phonero-background-neutral-light-hover);
  position: relative;
  color: var(--phonero-text-default);
}

:root.pf-v5-theme-dark .phonero-menu__row {
  --phonero-row-hover: var(--phonero-dark-4);
}

.phonero-menu__row::before,
.phonero-menu__row::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  background-color: currentcolor;
  pointer-events: none;
  translate: 0 -50%;
}

.phonero-menu__row::before {
  inset-inline-start: 0.75rem;
  width: 1rem;
  height: 1rem;
  mask: var(--phonero-row-icon) center / contain no-repeat;
}

.phonero-menu__row::after {
  inset-inline-end: 0.625rem;
  width: 1.25rem;
  height: 1.25rem;
  mask: var(--phonero-icon-chevron-down) center / contain no-repeat;
}

.phonero-menu__row select {
  width: 100%;
  height: 2rem;
  padding: 0 2.5rem;
  border: 0;
  border-radius: var(--phonero-radius-sm);
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--phonero-font-size-sm);
  cursor: pointer;
}

.phonero-menu__row select:hover {
  background: var(--phonero-row-hover);
}

.phonero-menu__row select:focus-visible {
  outline: 2px solid var(--phonero-border-focus-focus);
  outline-offset: 0;
}

/* The scheme's icon follows the choice, as the apps' ColorSchemeChanger does. */
.phonero-menu__row--locale { --phonero-row-icon: var(--phonero-icon-globe); }
.phonero-menu__row--scheme { --phonero-row-icon: var(--phonero-icon-sun); }
.phonero-menu__row--scheme:has(option[value="dark"]:checked) { --phonero-row-icon: var(--phonero-icon-moon); }
.phonero-menu__row--scheme:has(option[value="auto"]:checked) { --phonero-row-icon: var(--phonero-icon-screen); }

/* Mantine's Anchor: no underline until hovered. */
a,
.pf-v5-c-button.pf-m-link {
  text-decoration: none;
  text-underline-offset: 0.15em;
}

a:hover,
.pf-v5-c-button.pf-m-link:hover {
  text-decoration: underline;
}

/* ---- Icons: Keycloak's FontAwesome glyphs as bridge.css's Phonero icons ------------------------ */

:is(.fa-eye, .fa-eye-slash, .fa-sync-alt, .fa-info-circle, .fa-exclamation-circle, .fa-exclamation-triangle, .fa-check-circle, .phonero-back, #kc-choose-method)::before {
  content: "";
  flex: none;
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  background-color: currentcolor;
  mask: var(--phonero-icon) center / contain no-repeat;
}

.fa-eye { --phonero-icon: var(--phonero-icon-eye); }
.fa-eye-slash { --phonero-icon: var(--phonero-icon-eye-off); }
.fa-sync-alt { --phonero-icon: var(--phonero-icon-refresh); }
.fa-info-circle { --phonero-icon: var(--phonero-icon-info); }
.fa-exclamation-circle,
.fa-exclamation-triangle { --phonero-icon: var(--phonero-icon-alert); }
.fa-check-circle { --phonero-icon: var(--phonero-icon-success); }

/* The restart button's tooltip, as Mantine's: the neutral fill above the button, flush right. Upstream
   puts it right of the button, off a phone's screen, where it widened the page. */
.kc-login-tooltip .kc-tooltip-text {
  inset: auto 0 calc(100% + var(--phonero-spacing-xs)) auto;
  min-width: 0;
  width: max-content;
  max-width: 16rem;
  padding: var(--phonero-spacing-xs) var(--phonero-spacing-sm);
  border-radius: var(--phonero-radius-sm);
  background: var(--phonero-background-neutral-filled);
  box-shadow: none;
  color: var(--phonero-text-on-filled);
  font-size: var(--phonero-font-size-sm);
  font-weight: var(--phonero-font-weight-regular);
  line-height: var(--phonero-line-height-sm);
  text-align: start;
  transition: opacity 150ms;
}

.kc-login-tooltip .kc-tooltip-text::after {
  content: none;
}

.kc-login-tooltip:is(:hover, :focus-visible) .kc-tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* A back link leads with Phonero's chevron (sms-validation.ftl's comes from buttons.ftl, which takes
   no class). */
.phonero-back,
#kc-choose-method {
  --phonero-icon: var(--phonero-icon-chevron-left);
  display: inline-flex;
  align-items: center;
  gap: var(--phonero-spacing-xs);
}

/* ---- Phonero pieces ------------------------------------------------------------------------ */

.phonero-illustration {
  display: block;
  width: 100%;
  max-width: 18.75rem;
  aspect-ratio: 300 / 225;
  margin: 0 auto var(--phonero-spacing-lg);
  background: url("../img/illustration-light.svg") center / contain no-repeat;
}

:root.pf-v5-theme-dark .phonero-illustration {
  background-image: url("../img/illustration-dark.svg");
}

/* BankID's own button (selfservice-frontend BankIdButton): the brand purple, a pill, 48px. */
.pf-v5-c-button.phonero-bankid {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--phonero-bankid-6);
  --pf-v5-c-button--m-primary--Color: var(--phonero-white);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: #470d70;
  --pf-v5-c-button--m-primary--hover--Color: var(--phonero-white);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: #470d70;
  --pf-v5-c-button--m-primary--active--BackgroundColor: #470d70;
  --pf-v5-c-button--BorderRadius: var(--phonero-radius-rounded);
  --pf-v5-c-button--after--BorderRadius: var(--phonero-radius-rounded);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
}

:root.pf-v5-theme-dark .pf-v5-c-button.phonero-bankid {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--phonero-white);
  --pf-v5-c-button--m-primary--Color: var(--phonero-bankid-6);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: #efeef3;
  --pf-v5-c-button--m-primary--hover--Color: var(--phonero-bankid-6);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: #efeef3;
  --pf-v5-c-button--m-primary--active--BackgroundColor: #efeef3;
}

.phonero-bankid svg {
  width: 1.5rem;
  height: 1.5rem;
  margin-inline-end: 0.375rem;
}

/* "eller" between the BankID button and the rest, as the apps' Divider draws it. */
.phonero-divider {
  display: flex;
  align-items: center;
  gap: var(--phonero-spacing-md);
  margin-block: var(--phonero-spacing-lg);
  color: var(--phonero-text-primary-default);
  font-size: var(--phonero-font-size-md);
  font-weight: var(--phonero-font-weight-medium);
}

.phonero-divider::before,
.phonero-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--phonero-border-default);
}

/* A transparent pill, the apps' "Fortsett uten BankID". */
.pf-v5-c-button.phonero-subtle {
  --pf-v5-c-button--m-link--Color: var(--phonero-text-primary-default);
  --pf-v5-c-button--m-link--hover--Color: var(--phonero-text-primary-default);
  --pf-v5-c-button--BorderRadius: var(--phonero-radius-rounded);
  font-weight: var(--phonero-font-weight-semibold);
}

/* Native radios as Figma's Radio Card: the choice between SMS and e-post, personal or shared. */
.phonero-choices {
  display: grid;
  gap: var(--phonero-spacing-sm);
  border: 0;
  margin: 0;
  padding: 0;
}

.phonero-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--phonero-spacing-md);
  padding: var(--phonero-spacing-lg);
  border: 1px solid var(--phonero-border-default);
  border-radius: var(--phonero-radius-md);
  background: var(--phonero-background-surface-prominent);
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms, background-color 120ms;
}

/* As the apps' Radio.Card, every card tints on hover. */
.phonero-choice:hover {
  background-image: linear-gradient(var(--phonero-background-neutral-light), var(--phonero-background-neutral-light));
}

.phonero-choice:has(input:checked) {
  border-color: var(--phonero-control);
  box-shadow: inset 0 0 0 1px var(--phonero-control);
}

.phonero-choice:has(input:focus-visible) {
  outline: 2px solid var(--phonero-border-focus-focus);
  outline-offset: 2px;
}

/* The apps' Radio at md: 24px, its dot 10px. */
.phonero-choice input[type="radio"] {
  width: 1.5rem;
  height: 1.5rem;
}

.phonero-choice input[type="radio"]::before {
  width: 0.625rem;
  height: 0.625rem;
}

.phonero-choice__label {
  display: block;
  color: var(--phonero-text-title);
  font-weight: var(--phonero-font-weight-semibold);
}

.phonero-choice__description {
  display: block;
  color: var(--phonero-text-dimmed);
  font-size: var(--phonero-font-size-sm);
}

/*
 * Setting up an authenticator app (login-config-totp.ftl): the steps as the apps' numbered cards on
 * the elevated surface, a badge in the primary tint before each title. Full-width parts of a step
 * (the QR code, the key, the fields) run under the badge too, so a phone keeps its width for them.
 */
.phonero-steps {
  display: grid;
  gap: var(--phonero-spacing-md);
  margin: 0 0 var(--phonero-spacing-lg);
  padding: 0;
  list-style: none;
  counter-reset: phonero-step;
}

.phonero-step {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: start;
  gap: var(--phonero-spacing-md);
  padding: var(--phonero-spacing-lg);
  border-radius: var(--phonero-radius-md);
  background: var(--phonero-background-surface-elevated);
  counter-increment: phonero-step;
}

.phonero-step::before {
  content: counter(phonero-step);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--phonero-radius-rounded);
  background: var(--phonero-background-primary-light);
  color: var(--phonero-text-primary-default);
  font-size: var(--phonero-font-size-sm);
  font-weight: var(--phonero-font-weight-semibold);
}

.phonero-step__title {
  align-self: center;
  margin: 0;
  color: var(--phonero-text-title);
  font-weight: var(--phonero-font-weight-semibold);
}

.phonero-step > :not(.phonero-step__title) {
  grid-column: 1 / -1;
}

.phonero-step__link {
  justify-self: center;
  font-weight: var(--phonero-font-weight-medium);
}

.phonero-step__fields {
  display: grid;
  gap: var(--phonero-spacing-lg);
}

.phonero-step__fields .phonero-text-dimmed {
  display: block;
  margin-top: var(--phonero-spacing-xs);
}

/* On a phone (a touch screen without hover) the authenticator app's link and the key replace the QR code, which
   can't be scanned from the screen showing it. */
@media not ((hover: none) and (pointer: coarse)) {
  .phonero-on-phone {
    display: none !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .phonero-on-desktop {
    display: none !important;
  }
}

.phonero-step__key {
  display: grid;
  gap: var(--phonero-spacing-sm);
}

/* The apps that can be used, as the apps' Chip. */
.phonero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--phonero-spacing-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.phonero-chips li {
  padding: var(--phonero-spacing-xs) var(--phonero-spacing-md);
  border: 1px solid var(--phonero-border-default);
  border-radius: var(--phonero-radius-rounded);
  background: var(--phonero-background-surface-prominent);
  color: var(--phonero-text-default);
  font-size: var(--phonero-font-size-sm);
}

/* The QR code on white whatever the scheme (a camera reads dark on light), framed and centred. */
.phonero-qr {
  justify-self: center;
  padding: var(--phonero-spacing-md);
  border: 1px solid var(--phonero-border-default);
  border-radius: var(--phonero-radius-md);
  background: var(--phonero-neutral-white);
  line-height: 0;
}

.phonero-qr img {
  width: 11rem;
  height: 11rem;
  image-rendering: pixelated;
}

/* The key to type in: spaced monospace, selected whole with one tap. */
.phonero-secret {
  margin: 0;
  padding: var(--phonero-spacing-md);
  border: 1px solid var(--phonero-border-default);
  border-radius: var(--phonero-radius-md);
  background: var(--phonero-background-surface-prominent);
  color: var(--phonero-text-title);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--phonero-font-size-md);
  letter-spacing: 0.08em;
  text-align: center;
  overflow-wrap: anywhere;
  user-select: all;
}

.phonero-facts {
  display: grid;
  gap: var(--phonero-spacing-xs);
  margin: 0;
}

.phonero-facts div {
  display: flex;
  justify-content: space-between;
  gap: var(--phonero-spacing-md);
  padding-block: var(--phonero-spacing-xs);
  border-bottom: 1px solid var(--phonero-border-default);
}

.phonero-facts div:last-child {
  border-bottom: 0;
}

.phonero-facts dt {
  color: var(--phonero-text-dimmed);
}

.phonero-facts dd {
  margin: 0;
  color: var(--phonero-text-title);
  font-weight: var(--phonero-font-weight-medium);
}

/* The page's message under the attempted username, which PatternFly spaces only from md up. */
.pf-v5-c-login__main-body > .pf-v5-c-form + .pf-v5-c-alert {
  margin-top: var(--phonero-spacing-md);
}

/* A second form under the main one (send a new code), spaced as a button of the same group. */
.pf-v5-c-form + form,
.pf-v5-c-form + form + form {
  margin-top: var(--phonero-spacing-sm);
}

/* The one-time code field: wide digits, as a code reads. */
input[autocomplete="one-time-code"] {
  font-size: var(--phonero-font-size-lg);
  letter-spacing: 0.2em;
}

.phonero-text {
  margin-bottom: var(--phonero-spacing-lg);
}

.phonero-text-dimmed {
  color: var(--phonero-text-dimmed);
  font-size: var(--phonero-font-size-sm);
}

.phonero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--phonero-spacing-sm) var(--phonero-spacing-lg);
  margin-top: var(--phonero-spacing-lg);
}

/* GDPR, Personvern, Vilkår under every page. */
.phonero-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--phonero-spacing-sm) var(--phonero-spacing-xl);
  padding-block: var(--phonero-spacing-xl);
  font-size: var(--phonero-font-size-sm);
}

.phonero-footer a {
  color: var(--phonero-text-dimmed);
}
