/*
 * The sign-in screens (sign in, forgot / reset password, invites, email-link sign-in, installer):
 * two navy fields split on a diagonal, the brand's logo large on the left and the form card on the
 * right. The navy and card colours are fixed; the button and links take the brand accent
 * (Settings → Branding), with --login-on-accent a readable text colour on it. The same look in
 * light and dark theme. Phones and tablets stack the logo above the card.
 */
#loginScreen {
  --login-left: 27 60 97;      /* #1B3C61 */
  --login-right: 14 28 69;     /* #0E1C45 */
  --login-card: 38 56 108;     /* #26386C */
  --login-card-line: 58 78 138;
  --login-field: 232 239 253;  /* #E8EFFD */
  --login-field-text: 15 23 42;
  --login-label: 201 211 238;
  --login-muted: 160 174 214;
  /* The shared text variables, light on navy, for the classes the cards use. */
  --color-white: 255 255 255;
  --slate-200: 236 241 252;
  --slate-300: 222 230 248;
  --slate-400: 201 211 238;
  --slate-500: 168 182 220;
  --slate-600: 150 165 206;
  --color-line: 58 78 138;
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: rgb(var(--login-left));
  color: rgb(var(--slate-200));
}
/* The darker field: a diagonal from about four-fifths across the top to about half-way across the bottom. */
#loginScreen .login-split {
  position: absolute; inset: 0; pointer-events: none;
  background: rgb(var(--login-right));
  clip-path: polygon(78.5% 0, 100% 0, 100% 100%, 47% 100%);
}
#loginScreen .login-stage {
  position: relative; z-index: 1;
  min-height: 100vh; box-sizing: border-box;
  max-width: 1440px; margin: 0 auto; padding: 48px 6vw;
  display: flex; align-items: center; justify-content: space-between; gap: 6vw;
}
#loginScreen .login-brand { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
#loginScreen .login-logo { display: block; width: 100%; max-width: 820px; max-height: 260px; object-fit: contain; object-position: left center; }
/* No logo uploaded yet: the default mark with the brand name beside it. */
#loginScreen .login-mark { display: flex; align-items: center; gap: 20px; }
#loginScreen .login-mark img { width: 96px; height: 96px; object-fit: contain; }
#loginScreen .login-mark span { font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: #fff; }
#loginScreen .login-panel { flex: 0 0 400px; width: 400px; }
#loginScreen .login-panel.is-wide { flex-basis: 640px; width: 640px; }

/* The card and its fields. */
#loginScreen :is(.bg-panel\/40, .bg-panel, .bg-panel2) {
  background-color: rgb(var(--login-card)) !important;
  border-color: rgb(var(--login-card-line)) !important;
  backdrop-filter: none;
}
#loginScreen :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  background-color: rgb(var(--login-field)) !important;
  color: rgb(var(--login-field-text)) !important;
  border-color: transparent !important;
  border-radius: 8px;
}
#loginScreen :is(input, select, textarea)::placeholder { color: rgb(100 116 139) !important; }
#loginScreen :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  outline: 2px solid rgb(var(--brand-accent)); outline-offset: 1px;
}
#loginScreen label, #loginScreen .text-slate-400 { color: rgb(var(--login-label)); }
#loginScreen :is(.text-slate-500, .text-slate-600) { color: rgb(var(--login-muted)); }

/* Brand accent: buttons filled, links and the checkbox in its lighter tint. */
#loginScreen button[type="submit"].bg-electric {
  background-color: rgb(var(--brand-accent)) !important;
  color: rgb(var(--login-on-accent)) !important;
}
#loginScreen button[type="submit"].bg-electric:hover { filter: brightness(1.06); }
#loginScreen :is(a, button).text-electric { color: rgb(var(--brand-accent-light)) !important; }
#loginScreen input[type="checkbox"] { accent-color: rgb(var(--brand-accent)); }

/* Phones and tablets: the logo above the card, on one navy field. */
@media (max-width: 1023.98px) {
  #loginScreen .login-split { clip-path: polygon(0 62%, 100% 38%, 100% 100%, 0 100%); }
  #loginScreen .login-stage { flex-direction: column; justify-content: center; gap: 36px; padding: 40px 20px; }
  #loginScreen .login-brand { align-items: center; flex: 0 0 auto; width: 100%; }
  #loginScreen .login-logo { max-width: min(520px, 100%); max-height: 150px; object-position: center; }
  #loginScreen .login-mark span { font-size: 36px; }
  #loginScreen .login-mark img { width: 64px; height: 64px; }
  #loginScreen .login-panel, #loginScreen .login-panel.is-wide { flex: 0 0 auto; width: 100%; max-width: 440px; }
  #loginScreen .login-panel.is-wide { max-width: 640px; }
}
/* The installer's wider form sits under the logo on every screen. */
#loginScreen .login-stage.is-wide { flex-direction: column; justify-content: center; gap: 36px; }
#loginScreen .login-stage.is-wide .login-brand { align-items: center; flex: 0 0 auto; }
#loginScreen .login-stage.is-wide .login-logo { max-width: 520px; max-height: 150px; object-position: center; }
