/*
 * Login, register, forgotten and reset password, email verification and my account pages (migration
 * order 5), moving to the design system. Each page's content is inside .accountPage.
 *
 * Not myAccount.css, which is legacy CSS for the my account page, added with setCss().
 *
 * Loaded on every main-site page, as the password forms are CMS widgets. Unlayered, like shell.css,
 * so these rules win over everything in the legacy layer, including legacy rules on IDs: keep
 * selectors scoped to .accountPage and set only the properties that need to change. Colours are
 * changed in default.css in place, so the legacy cascade between its rules is unchanged.
 */

/* Keyboard focus. Legacy CSS removes the outline from fields. */
.accountPage :focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* Links in text are underlined, as in the style guide (.ds-link): steel is too close to the text
   colour for colour alone to show them */
.accountPage :is(p, span, label) a:not(.button) {
	text-decoration: underline;
}

/* Sentence case: legacy CSS puts every button in capitals. And the page's font: browsers give <button>s
   and submit inputs their own, and many of these were <div>s in Open Sans. */
.accountPage button,
.accountPage .button,
.accountPage input[type="submit"] {
	text-transform: none;
	font-family: inherit;
}

/* Login: each field's label shows above it (they were placeholders, which go as soon as you type) */
.accountPage .loginForm .ds-label {
	display: block;
	margin-bottom: var(--space-1);
}

/* Registration's organisation type tiles (now role="button") and the private organisations link:
   the hover text shows on keyboard focus too */
.accountPage .typeSelect:focus-visible .headerHover,
.accountPage .selectableTypes a:focus-visible .headerHover {
	opacity: 1;
}

/* My account's servicing profile editor: the checkboxes are invisible over the boxes drawn for them,
   so the drawn box shows the focus */
.accountPage .eventContainer input:focus-visible ~ .eventCheckmark {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* My account (libraries) is inside the CMS template's .container: its own .container fills that one,
   rather than taking the fixed width legacy CSS gives every .container on phones (420px on a 412px
   screen, so it ran off the side) */
.cmsContent .container.accountPage {
	width: auto;
}

/* My account (libraries): the branch order's Move up and Move down buttons, next to the drag handle.
   24px to press; a move that isn't possible (first up, last down) is faded. */
.accountPage .branchMoveButtons {
	white-space: nowrap;
}

.accountPage .branchMove {
	min-width: 24px;
	min-height: 24px;
	color: var(--color-primary);
}

.accountPage .branchMove[aria-disabled="true"] {
	color: var(--color-text-muted);
	opacity: .5;
	cursor: default;
}

/* Registration's Next, Back and Register, which were <div>s: keep the <div>'s line height */
.accountPage .navigationContainer button {
	line-height: inherit;
}
