@font-face {
  font-family: "FB DM Sans";
  src: url("fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "FB Manrope";
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

html.dark-mode { color-scheme: dark; }
html body {
  font-family: "FB DM Sans", system-ui, sans-serif;
  font-size: 14px;
  color: var(--fb-text);
  background: var(--fb-canvas);
}
h1, h2, h3, .header-title {
  font-family: "FB Manrope", "FB DM Sans", system-ui, sans-serif;
}
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--fb-accent);
  outline-offset: -2px;
}
html body a, html body a:hover { color: var(--fb-accent); }
html body .btn-primary {
  color: var(--fb-button-text);
  background: var(--fb-button);
  border: 1px solid var(--fb-button);
  border-radius: 8px;
  font-weight: 700;
}
html body .btn-primary:hover, html body .btn-primary:focus {
  color: var(--fb-button-text);
  background: var(--fb-button);
  border-color: var(--fb-button);
  filter: brightness(1.11);
}
html body .btn-secondary, html body .btn-secondary:hover {
  color: var(--fb-text);
  background: var(--fb-card);
  border-color: var(--fb-line);
  border-radius: 8px;
}

/* Login uses the mail palette with its own illustration surface. */
html body.task-login, body.task-login #layout, body.task-login #layout-content.fb-login {
  color-scheme: dark;
  color: #f2f3f5;
  background: #17191d;
}
body.task-login #layout-content.fb-login {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: clamp(16px, 5vw, 64px);
}
.fb-login-shell {
  width: min(940px, 100%);
  min-height: 470px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #343740;
  border-radius: 22px;
  overflow: hidden;
  background: #1b1d21;
  box-shadow: 0 22px 90px #07070b80;
}
.fb-login-brand {
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: clamp(22px, 4vw, 42px);
  border-right: 1px solid #343740;
  background-color: #202227;
  background-image: linear-gradient(#bdc2cd0b 1px, transparent 1px), linear-gradient(90deg, #bdc2cd0b 1px, transparent 1px);
  background-size: 26px 26px;
}
.fb-login-wordmark { display: inline-flex; width: fit-content; }
body.task-login .fb-login-brand #logo {
  width: 196px;
  height: auto;
  max-width: min(100%, 196px);
  margin: 0;
}
.fb-login-domain {
  font-family: "FB DM Sans", system-ui, sans-serif;
  color: #a1a8b6;
  font-size: 12px;
  letter-spacing: .055em;
}
.fb-login-illustration { position: relative; min-height: 190px; }
.fb-envelope {
  position: absolute;
  width: min(200px, 78%);
  aspect-ratio: 1.62;
  left: 50%;
  top: 53%;
  border: 1px solid #54516a;
  border-radius: 17px;
  overflow: hidden;
}
.fb-envelope-back { transform: translate(-42%, -61%) rotate(12deg); background: #282a34; }
.fb-envelope-front {
  transform: translate(-57%, -45%) rotate(-9deg);
  background: #343344;
  box-shadow: 0 18px 46px #0c081e80;
}
.fb-envelope-fold {
  position: absolute;
  width: 74%;
  aspect-ratio: 1;
  border: 1px solid #69627e;
  border-radius: 16px;
  left: 50%;
  top: -86%;
  transform: translateX(-50%) rotate(45deg);
  background: #45405b;
}
.fb-envelope-seal {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  top: 47%;
  left: 50%;
  transform: translateX(-50%);
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: #b5a3ff;
}
.fb-envelope-seal span { width: 4px; height: 12px; background: #18122b; transform: skew(-28deg); }
.fb-login-form { display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 54px); min-width: 0; }
.fb-login-form h1 {
  color: #f2f3f5;
  font-weight: 750;
  letter-spacing: -.055em;
  font-size: clamp(34px, 5vw, 50px);
  margin: 0 0 12px;
}
.fb-login-form p { color: #bdc2cd; margin: 0 0 28px; }
body.task-login .fb-login-form #login-form { width: 100%; max-width: none; margin: 0; }
body.task-login .fb-login-form #login-form .form-control,
body.task-login .fb-login-form #login-form .input-group-text {
  min-height: 48px;
  background: #26292f;
  color: #f2f3f5;
  border-color: #535865;
}
body.task-login .fb-login-form #login-form .input-group-text { color: #b5a3ff; }
body.task-login .fb-login-form .form-control::placeholder { color: #a1a8b6; }
body.task-login .fb-login-form #rcmloginsubmit {
  min-height: 46px;
  color: #19132a;
  background: #b5a3ff;
  border-color: #b5a3ff;
}
body.task-login .fb-login-form #login-footer:empty { display: none; }


html:not(.dark-mode) body.task-login,
html:not(.dark-mode) body.task-login #layout,
html:not(.dark-mode) body.task-login #layout #layout-content.fb-login {
  color-scheme: light;
  color: var(--fb-text);
  background: var(--fb-canvas);
}
html:not(.dark-mode) body.task-login .fb-login-shell {
  background: var(--fb-card);
  border-color: var(--fb-line);
  box-shadow: var(--fb-shadow);
}
html:not(.dark-mode) body.task-login .fb-login-brand {
  border-color: var(--fb-line);
  background-color: var(--fb-panel);
  background-image: linear-gradient(#53586510 1px, transparent 1px), linear-gradient(90deg, #53586510 1px, transparent 1px);
}
html:not(.dark-mode) body.task-login .fb-login-brand #logo {
  padding: 6px 8px;
  border-radius: 6px;
  background: #202227;
}
html:not(.dark-mode) body.task-login .fb-login-form h1 { color: var(--fb-text); }
html:not(.dark-mode) body.task-login :is(.fb-login-domain, .fb-login-form p) { color: var(--fb-muted); }
html:not(.dark-mode) body.task-login .fb-login-form #login-form :is(.form-control, .input-group-text) {
  background: var(--fb-fill);
  color: var(--fb-text);
  border-color: var(--fb-edge);
}
html:not(.dark-mode) body.task-login .fb-login-form #login-form .input-group-text { color: var(--fb-accent); }
html:not(.dark-mode) body.task-login .fb-login-form .form-control::placeholder { color: var(--fb-dim); }
html:not(.dark-mode) body.task-login .fb-login-form #rcmloginsubmit {
  color: var(--fb-button-text);
  background: var(--fb-button);
  border-color: var(--fb-button);
}

@media (max-width: 680px) {
  .fb-login-shell { grid-template-columns: 1fr; min-height: auto; border-radius: 17px; max-width: 440px; }
  .fb-login-brand { border-right: 0; border-bottom: 1px solid #343740; padding: 20px 24px; }
  .fb-login-illustration, .fb-login-domain { display: none; }
  .fb-login-form { padding: 28px 24px 30px; }
  .fb-login-form p { margin-bottom: 22px; }
}

body.task-login .fb-login-brand #logo,
body.task-login .fb-login-form #login-form { position: static; inset: auto; transform: none; }
body.task-login .fb-login-form { text-align: left; }
body.task-login .fb-login-form .form-control { border-radius: 0 8px 8px 0; }
body.task-login .fb-login-form .input-group-text { border-radius: 8px 0 0 8px; }
