/* The login family: Logg inn, Glemt passord, Velg passord and Lenken er utløpt (UI-SPEC 6.2,
   sketch 003 #login). Loaded after the base and shell stylesheets; it uses their tokens and forks none. */

/* Brand slot: the stacked logo sits above the heading, decorative (the h1 says the name) */
.login-card__title {
  margin-bottom: var(--space-sm);
}

.login-card .login-card__logo {
  height: 40px;
}

.login-card__heading {
  margin: 0;
  font-size: var(--text-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  text-align: center;
}

.login-card .login-card__lead {
  margin-top: var(--space-xs);
  text-align: center;
}

/* The card and the optional examples panel: side by side from 1024px, stacked below that */
.page:has(> .login-card) {
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.login-card {
  margin: 0;
}

.login-examples {
  width: 100%;
  max-width: 560px;
  padding: var(--space-xl);
}

.login-examples .heading {
  margin: 0;
}

.login-examples .ba {
  margin-top: var(--space-md);
}

.login-examples__caption {
  margin-top: var(--space-md);
}

@media (max-width: 1023px) {
  .page:has(> .login-card) {
    flex-direction: column;
    justify-content: center;
  }

  .login-examples {
    max-width: var(--login-card-width);
  }
}

@media (max-width: 480px) {
  .login-card,
  .login-examples {
    padding: var(--space-lg);
  }
}

/* The calm banner for "your session expired" and the temporary-login note */
.banner--info {
  color: var(--color-text);
  background: var(--color-canvas);
  border-color: var(--palette-light-gray);
}

/* Fields */
.login-form .form-field {
  margin: 0;
}

.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.field-row a {
  font-size: 15px;
}

.pw {
  position: relative;
}

.pw .input {
  padding-right: 64px;
}

.pw__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  min-height: 32px;
  padding: 4px 10px;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transform: translateY(-50%);
}

.pw__toggle:hover {
  background: var(--color-canvas);
}

.pw-rules {
  margin: 2px 0 0;
  padding: 0;
  color: var(--color-text-muted);
  font-size: 15px;
  list-style: none;
}

.pw-rules li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pw-rules li::before {
  width: 8px;
  height: 8px;
  background: var(--palette-light-gray);
  border-radius: 2px;
  content: "";
}

/* A met rule changes weight as well as colour, so colour is never the only signal */
.pw-rules li.ok {
  color: var(--tone-success-text);
  font-weight: 600;
}

.pw-rules li.ok::before {
  background: var(--palette-green);
}

.readonly-field {
  padding: 10px 12px;
  overflow-wrap: anywhere;
  font-size: 16px;
  background: var(--color-canvas);
  border-radius: var(--radius-control);
}

.login-form .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.login-form .button[hidden],
.login-form .spinner[hidden] {
  display: none;
}

.login-card__note,
.login-card__terms {
  margin-top: var(--space-lg);
  color: var(--color-text-muted);
  font-size: 15px;
}

.login-card__terms {
  margin-top: var(--space-md);
}

.login-card__legal {
  display: flex;
  gap: 14px;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 15px;
}

.login-card__legal a {
  color: var(--color-text-muted);
}

.login-card__back {
  display: inline-block;
  margin-top: var(--space-md);
  font-size: 16px;
}

.login-card .banner .heading {
  margin: 0 0 2px;
}

.login-card .banner p {
  margin: 0;
}

.login-card__action {
  margin-top: var(--space-md);
}
