/* Login screen — hand-ported from the wireframe's "LOGIN" section. */

html, body {
  margin: 0;
  font-family: var(--font-family);
}

/* The shell, shared by login, register, verify, forgot and reset.

   Scrolls and top-aligns as of the 2026-09-08 design, which changed it for a
   reason: the register card is five fields plus the role cards, and a
   centred, non-scrolling card cut its bottom off on a laptop. `margin: auto`
   keeps it centred while there is room and lets it scroll once there is not. */
.login-page {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 0;
  box-sizing: border-box;
  background: var(--color-navy);
  align-items: flex-start;
  justify-content: center;
}

.login-card {
  width: min(440px, 92vw);
  margin: auto;
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: clamp(26px, 2.6vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  box-sizing: border-box;
}

.login-back {
  cursor: pointer;
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: var(--font-weight-bold);
  font-size: 11px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.login-brand img {
  width: 52px;
  height: auto;
}

.login-brand-title {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--color-navy);
  text-align: center;
}

.login-brand-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.login-error {
  padding: 10px 14px;
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--color-warning);
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-text-body);
}

.login-field input[type="email"],
.login-field input[type="password"] {
  padding: 11px 13px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text-body);
}

/* The password box and its eye (Mark, 2026-09-11). The border and padding
   live on the wrapper, not the input: the rule above is keyed on
   input[type="password"] and stops applying the instant the reveal switches
   the type to text, which stripped the field of its box mid-interaction. */
.login-password {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  background: var(--color-white);
}

.login-password input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text-body);
}

.login-password input:focus {
  outline: none;
}

/* Focus shown on the wrapper, since the input no longer carries the border. */
.login-password:focus-within {
  border-color: var(--color-accent);
}

.login-password-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0 12px;
  border: none;
  background: none;
  color: var(--color-text-muted);
}

.login-password-toggle:hover {
  color: var(--color-text-body);
}

/* The `hidden` attribute does not hide an <svg>: the UA stylesheet's
   [hidden] rule applies to HTML elements, and display on an SVG element is
   its own presentation property — so both eyes rendered side by side until
   this rule existed. Caught by looking at the page, not by the build. */
.login-password-icon[hidden] {
  display: none;
}

.login-submit {
  cursor: pointer;
  padding: 13px;
  background: var(--color-accent);
  border: none;
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-white);
}

.login-submit:hover {
  background: var(--color-accent-hover);
}

/* The access-denied page's way on is a link, not a form button. */
a.login-submit {
  display: block;
  text-decoration: none;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--color-border-input);
}

.login-divider span {
  padding: 0 10px;
}

.login-staff {
  cursor: pointer;
  padding: 13px;
  background: var(--color-white);
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text-body);
  text-decoration: none;
}

.login-staff:hover {
  background: var(--color-bg-subtle, #f5f4f0);
}

/* ===========================================================================
   Register, verify, forgot and reset (Mark's designs, 2026-09-08).

   All four reuse the shell and .login-field/.login-submit above; what follows
   is only what those screens add. Values are the design's own.
   ========================================================================= */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* The design puts "Forgot password?" on the same line as the Password label,
   right-aligned and baseline-matched. */
.login-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* A button rather than a link, so the typed email posts with it — styled
   back down to look exactly like the link the design draws. */
.login-forgot {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-landlord);
  text-decoration: none;
}

/* Log in and Register share the row, equal width, as drawn. */
.login-actions {
  display: flex;
  gap: 10px;
}

.login-actions .login-submit,
.login-register {
  flex: 1;
}

.login-register {
  padding: 13px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
  text-decoration: none;
  box-sizing: border-box;
}

/* Navy rather than the role accent on every reset screen — at that point we
   do not know the role, which is exactly why the design changes it. */
.login-submit--navy {
  background: var(--color-navy);
}

/* The register button takes the selected role's colour. */
.login-submit--landlord {
  background: var(--color-accent-landlord);
}

.login-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
}

.login-hint--centred {
  text-align: center;
}

.login-field-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-body);
}

.login-brand-subtitle--wide {
  line-height: 1.6;
  text-align: center;
  max-width: 32ch;
}

/* The envelope in a circle, on both code screens. */
.login-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-border-divider);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-alt-link {
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-decoration: none;
}

/* ---- user type ----
   Real radios, visually replaced, so the choice is keyboard-reachable and
   posts without script. */
.login-roles {
  display: flex;
  gap: 10px;
}

.login-role {
  flex: 1;
  cursor: pointer;
}

.login-role input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.login-role-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  color: var(--color-text-body);
}

.login-role-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
}

.login-role-sub {
  font-size: var(--font-size-xs);
  opacity: .7;
}

/* Selected: the role's own colour, filled, as the design's cardStyle does. */
.login-role--provider input:checked + .login-role-box {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-white);
}

.login-role--landlord input:checked + .login-role-box {
  border-color: var(--color-accent-landlord);
  background: var(--color-accent-landlord);
  color: var(--color-white);
}

.login-role input:focus-visible + .login-role-box {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}

/* ---- the six code boxes ----
   Six boxes, one input. The input is the real control and sits invisibly over
   the boxes; the boxes render what it holds. Six separate inputs would look
   identical and break paste, backspace and one-time-code autofill.

   Nothing here applies until the script adds is-enhanced, so with script off
   the input stays a plain visible field instead of an invisible one floating
   over decoration. */
.login-code {
  position: relative;
}

.login-code-boxes {
  display: none;
}

.login-code-input {
  padding: 10px 12px;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  letter-spacing: .35em;
  text-align: center;
  text-transform: uppercase;
  box-sizing: border-box;
  width: 100%;
}

.login-code.is-enhanced .login-code-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

/* Over the boxes and invisible: it still takes focus, typing, paste and
   autofill, and the boxes below show the result. The caret goes with it,
   which is what .is-next replaces. */
.login-code.is-enhanced .login-code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  color: transparent;
  caret-color: transparent;
  letter-spacing: normal;
  z-index: 1;
  cursor: pointer;
}

.login-code-boxes span {
  padding: 13px 0;
  border: 1px solid var(--color-border-input);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
  min-height: 1.2em;
  line-height: 1.2;
}

.login-code-boxes span.is-filled {
  border-color: var(--color-text-body);
}

/* Where the next character lands — standing in for the caret the invisible
   input takes away. */
.login-code-boxes span.is-next {
  border-color: var(--color-navy);
  box-shadow: inset 0 0 0 1px var(--color-navy);
}

/* Focus has to show on the boxes, since the thing actually focused cannot be
   seen. */
.login-code.is-enhanced:focus-within .login-code-boxes span {
  border-color: var(--color-border-input);
}

.login-code.is-enhanced:focus-within .login-code-boxes span.is-filled {
  border-color: var(--color-text-body);
}

.login-resend-form {
  display: flex;
  justify-content: center;
  margin-bottom: -12px;
}

.login-resend {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent-landlord);
}

/* "I already have a code" on the forgot screen: a second submit of the same
   form, drawn as the link beside it rather than as another button. */
.login-alt-link--button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
